diff options
author | Ameer J <52414509+ameerj@users.noreply.github.com> | 2023-11-01 01:02:11 +0100 |
---|---|---|
committer | Ameer J <52414509+ameerj@users.noreply.github.com> | 2023-11-01 01:14:18 +0100 |
commit | 75c5be55af3e0db249cb1bb0c0dd1de6e326849d (patch) | |
tree | 4b4f8f45569e08287508a681e1d1458a52975493 /src/shader_recompiler/backend/glsl | |
parent | buffer_cache: Apply storage buffer alignment only to the offset (diff) | |
download | yuzu-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 'src/shader_recompiler/backend/glsl')
-rw-r--r-- | src/shader_recompiler/backend/glsl/glsl_emit_context.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/shader_recompiler/backend/glsl/glsl_emit_context.cpp b/src/shader_recompiler/backend/glsl/glsl_emit_context.cpp index 9ff4028c2..fd9a99449 100644 --- a/src/shader_recompiler/backend/glsl/glsl_emit_context.cpp +++ b/src/shader_recompiler/backend/glsl/glsl_emit_context.cpp @@ -601,7 +601,10 @@ std::string EmitContext::DefineGlobalMemoryFunctions() { addr_xy[i] = fmt::format("ftou({}[{}].{})", cbuf, addr_loc / 16, Swizzle(addr_loc)); size_xy[i] = fmt::format("ftou({}[{}].{})", cbuf, size_loc / 16, Swizzle(size_loc)); } - const auto addr_pack{fmt::format("packUint2x32(uvec2({},{}))", addr_xy[0], addr_xy[1])}; + const u32 ssbo_align_mask{~(static_cast<u32>(profile.min_ssbo_alignment) - 1U)}; + const auto aligned_low_addr{fmt::format("{}&{}", addr_xy[0], ssbo_align_mask)}; + const auto aligned_addr{fmt::format("uvec2({},{})", aligned_low_addr, addr_xy[1])}; + const auto addr_pack{fmt::format("packUint2x32({})", aligned_addr)}; const auto addr_statment{fmt::format("uint64_t {}={};", ssbo_addr, addr_pack)}; func += addr_statment; |