summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/frontend/maxwell/program.cpp
diff options
context:
space:
mode:
authorGravatar FernandoS272021-05-02 01:50:27 +0200
committerGravatar ameerj2021-07-22 21:51:30 -0400
commitee61ec2c39e6db53c56e7ac761a2223d99f06908 (patch)
tree2ae3e49e64b845de4db6756e6dfea5fd1694d674 /src/shader_recompiler/frontend/maxwell/program.cpp
parentshader: Stub SR_AFFINITY (diff)
downloadyuzu-ee61ec2c39e6db53c56e7ac761a2223d99f06908.tar.gz
yuzu-ee61ec2c39e6db53c56e7ac761a2223d99f06908.tar.xz
yuzu-ee61ec2c39e6db53c56e7ac761a2223d99f06908.zip
shader: Optimize NVN Fallthrough
Diffstat (limited to 'src/shader_recompiler/frontend/maxwell/program.cpp')
-rw-r--r--src/shader_recompiler/frontend/maxwell/program.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/shader_recompiler/frontend/maxwell/program.cpp b/src/shader_recompiler/frontend/maxwell/program.cpp
index a4fa4319d..0d3f00699 100644
--- a/src/shader_recompiler/frontend/maxwell/program.cpp
+++ b/src/shader_recompiler/frontend/maxwell/program.cpp
@@ -88,17 +88,20 @@ void AddNVNStorageBuffers(IR::Program& program) {
88 }()}; 88 }()};
89 auto& descs{program.info.storage_buffers_descriptors}; 89 auto& descs{program.info.storage_buffers_descriptors};
90 for (u32 index = 0; index < num_buffers; ++index) { 90 for (u32 index = 0; index < num_buffers; ++index) {
91 if (!program.info.nvn_buffer_used[index]) {
92 continue;
93 }
91 const u32 offset{base + index * descriptor_size}; 94 const u32 offset{base + index * descriptor_size};
92 const auto it{std::ranges::find(descs, offset, &StorageBufferDescriptor::cbuf_offset)}; 95 const auto it{std::ranges::find(descs, offset, &StorageBufferDescriptor::cbuf_offset)};
93 if (it != descs.end()) { 96 if (it != descs.end()) {
97 it->is_written |= program.info.stores_global_memory;
94 continue; 98 continue;
95 } 99 }
96 // Assume these are written for now
97 descs.push_back({ 100 descs.push_back({
98 .cbuf_index = driver_cbuf, 101 .cbuf_index = driver_cbuf,
99 .cbuf_offset = offset, 102 .cbuf_offset = offset,
100 .count = 1, 103 .count = 1,
101 .is_written = true, 104 .is_written = program.info.stores_global_memory,
102 }); 105 });
103 } 106 }
104} 107}