aboutsummaryrefslogtreecommitdiff
path: root/src/shader_recompiler
diff options
context:
space:
mode:
authorCamilleLaVey <camillelavey99@gmail.com>2025-07-11 19:57:21 +0200
committerCamilleLaVey <camillelavey99@gmail.com>2025-07-11 19:57:21 +0200
commit3df06da02cf5e86147aa5c8af661313985c4f8ca (patch)
tree93328e3032b94aff76da76b08054c4885ea3e6e2 /src/shader_recompiler
parent7f48f4efb6edc3b16f3fe7800dd055d79fc382b3 (diff)
revert Align and bias memory stronger
revert [ir] Align and bias memory stronger Signed-off-by: Aleksandr Popovich <alekpopo@pm.me> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/229 Co-authored-by: Aleksandr Popovich <alekpopo@pm.me> Co-committed-by: Aleksandr Popovich <alekpopo@pm.me> Reverted as showed up issues with buffers on games that weren't expected, it's going to be refined and implemented again with better params.
Diffstat (limited to 'src/shader_recompiler')
-rw-r--r--src/shader_recompiler/ir_opt/global_memory_to_storage_buffer_pass.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/shader_recompiler/ir_opt/global_memory_to_storage_buffer_pass.cpp b/src/shader_recompiler/ir_opt/global_memory_to_storage_buffer_pass.cpp
index 902cd698ad..2d4feca02c 100644
--- a/src/shader_recompiler/ir_opt/global_memory_to_storage_buffer_pass.cpp
+++ b/src/shader_recompiler/ir_opt/global_memory_to_storage_buffer_pass.cpp
@@ -1,6 +1,3 @@
-// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
-// SPDX-License-Identifier: GPL-3.0-or-later
-
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
@@ -354,7 +351,7 @@ std::optional<StorageBufferAddr> Track(const IR::Value& value, const Bias* bias)
.index = index.U32(),
.offset = offset.U32(),
};
- const u32 alignment{bias ? bias->alignment : 16U};
+ const u32 alignment{bias ? bias->alignment : 8U};
if (!Common::IsAligned(storage_buffer.offset, alignment)) {
// The SSBO pointer has to be aligned
return std::nullopt;
@@ -375,9 +372,9 @@ void CollectStorageBuffers(IR::Block& block, IR::Inst& inst, StorageInfo& info)
// avoid getting false positives
static constexpr Bias nvn_bias{
.index = 0,
- .offset_begin = 0x110,
- .offset_end = 0x800,
- .alignment = 32,
+ .offset_begin = 0x100,
+ .offset_end = 0x700,
+ .alignment = 16,
};
// Track the low address of the instruction
const std::optional<LowAddrInfo> low_addr_info{TrackLowAddress(&inst)};
@@ -429,10 +426,7 @@ IR::U32 StorageOffset(IR::Block& block, IR::Inst& inst, StorageBufferAddr buffer
// Align the offset base to match the host alignment requirements
low_cbuf = ir.BitwiseAnd(low_cbuf, ir.Imm32(~(alignment - 1U)));
-
- // It aligns the memory strongly
- IR::U32 res = ir.ISub(offset, low_cbuf);
- return res;
+ return ir.ISub(offset, low_cbuf);
}
/// Replace a global memory load instruction with its storage buffer equivalent