summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2023-03-09 15:18:39 +0100
committerGitHub <noreply@github.com>2023-03-09 15:18:39 +0100
commitb5c0c1e16360ad7c3b82d70d46c2193b6e32fe63 (patch)
treeab2ac964d3ed958f42e0dd362f746cc702bd0ebf /src/shader_recompiler
parentMerge pull request #9906 from german77/metroid2 (diff)
parentbuffer_cache: Add logic for non-NVN storage buffer tracking (diff)
downloadyuzu-b5c0c1e16360ad7c3b82d70d46c2193b6e32fe63.tar
yuzu-b5c0c1e16360ad7c3b82d70d46c2193b6e32fe63.tar.gz
yuzu-b5c0c1e16360ad7c3b82d70d46c2193b6e32fe63.tar.bz2
yuzu-b5c0c1e16360ad7c3b82d70d46c2193b6e32fe63.tar.lz
yuzu-b5c0c1e16360ad7c3b82d70d46c2193b6e32fe63.tar.xz
yuzu-b5c0c1e16360ad7c3b82d70d46c2193b6e32fe63.tar.zst
yuzu-b5c0c1e16360ad7c3b82d70d46c2193b6e32fe63.zip
Diffstat (limited to '')
-rw-r--r--src/shader_recompiler/ir_opt/global_memory_to_storage_buffer_pass.cpp8
1 files changed, 7 insertions, 1 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 336338e62..d1e59f22e 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
@@ -35,6 +35,7 @@ struct Bias {
u32 index;
u32 offset_begin;
u32 offset_end;
+ u32 alignment;
};
using boost::container::flat_set;
@@ -349,7 +350,8 @@ std::optional<StorageBufferAddr> Track(const IR::Value& value, const Bias* bias)
.index = index.U32(),
.offset = offset.U32(),
};
- if (!Common::IsAligned(storage_buffer.offset, 16)) {
+ const u32 alignment{bias ? bias->alignment : 8U};
+ if (!Common::IsAligned(storage_buffer.offset, alignment)) {
// The SSBO pointer has to be aligned
return std::nullopt;
}
@@ -371,6 +373,7 @@ void CollectStorageBuffers(IR::Block& block, IR::Inst& inst, StorageInfo& info)
.index = 0,
.offset_begin = 0x110,
.offset_end = 0x610,
+ .alignment = 16,
};
// Track the low address of the instruction
const std::optional<LowAddrInfo> low_addr_info{TrackLowAddress(&inst)};
@@ -386,8 +389,11 @@ void CollectStorageBuffers(IR::Block& block, IR::Inst& inst, StorageInfo& info)
storage_buffer = Track(low_addr, nullptr);
if (!storage_buffer) {
// If that also fails, use NVN fallbacks
+ LOG_WARNING(Shader, "Storage buffer failed to track, using global memory fallbacks");
return;
}
+ LOG_WARNING(Shader, "Storage buffer tracked without bias, index {} offset {}",
+ storage_buffer->index, storage_buffer->offset);
}
// Collect storage buffer and the instruction
if (IsGlobalMemoryWrite(inst)) {