summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/backend/spirv
diff options
context:
space:
mode:
authorAmeer J <52414509+ameerj@users.noreply.github.com>2023-11-01 01:02:11 +0100
committerAmeer J <52414509+ameerj@users.noreply.github.com>2023-11-01 01:14:18 +0100
commit75c5be55af3e0db249cb1bb0c0dd1de6e326849d (patch)
tree4b4f8f45569e08287508a681e1d1458a52975493 /src/shader_recompiler/backend/spirv
parentbuffer_cache: Apply storage buffer alignment only to the offset (diff)
downloadyuzu-75c5be55af3e0db249cb1bb0c0dd1de6e326849d.tar
yuzu-75c5be55af3e0db249cb1bb0c0dd1de6e326849d.tar.gz
yuzu-75c5be55af3e0db249cb1bb0c0dd1de6e326849d.tar.bz2
yuzu-75c5be55af3e0db249cb1bb0c0dd1de6e326849d.tar.lz
yuzu-75c5be55af3e0db249cb1bb0c0dd1de6e326849d.tar.xz
yuzu-75c5be55af3e0db249cb1bb0c0dd1de6e326849d.tar.zst
yuzu-75c5be55af3e0db249cb1bb0c0dd1de6e326849d.zip
Diffstat (limited to '')
-rw-r--r--src/shader_recompiler/backend/spirv/spirv_emit_context.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp b/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp
index 57df6fc34..3350f1f85 100644
--- a/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp
+++ b/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp
@@ -891,7 +891,9 @@ void EmitContext::DefineGlobalMemoryFunctions(const Info& info) {
const Id ssbo_size_pointer{OpAccessChain(uniform_types.U32, cbufs[ssbo.cbuf_index].U32,
zero, ssbo_size_cbuf_offset)};
- const Id ssbo_addr{OpBitcast(U64, OpLoad(U32[2], ssbo_addr_pointer))};
+ const u64 ssbo_align_mask{~(profile.min_ssbo_alignment - 1U)};
+ const Id unaligned_addr{OpBitcast(U64, OpLoad(U32[2], ssbo_addr_pointer))};
+ const Id ssbo_addr{OpBitwiseAnd(U64, unaligned_addr, Constant(U64, ssbo_align_mask))};
const Id ssbo_size{OpUConvert(U64, OpLoad(U32[1], ssbo_size_pointer))};
const Id ssbo_end{OpIAdd(U64, ssbo_addr, ssbo_size)};
const Id cond{OpLogicalAnd(U1, OpUGreaterThanEqual(U1, addr, ssbo_addr),