diff options
author | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-06-15 23:23:57 +0200 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-07-23 03:51:38 +0200 |
commit | d36f667bc0adaa9f50d53efb4c908aadc38921a6 (patch) | |
tree | 13a6a6106ca576214db66d50a618b404cc5c7cac /src/shader_recompiler/ir_opt/texture_pass.cpp | |
parent | glsl: Move gl_Position/generic attribute initialization to EmitProlgue (diff) | |
download | yuzu-d36f667bc0adaa9f50d53efb4c908aadc38921a6.tar yuzu-d36f667bc0adaa9f50d53efb4c908aadc38921a6.tar.gz yuzu-d36f667bc0adaa9f50d53efb4c908aadc38921a6.tar.bz2 yuzu-d36f667bc0adaa9f50d53efb4c908aadc38921a6.tar.lz yuzu-d36f667bc0adaa9f50d53efb4c908aadc38921a6.tar.xz yuzu-d36f667bc0adaa9f50d53efb4c908aadc38921a6.tar.zst yuzu-d36f667bc0adaa9f50d53efb4c908aadc38921a6.zip |
Diffstat (limited to 'src/shader_recompiler/ir_opt/texture_pass.cpp')
-rw-r--r-- | src/shader_recompiler/ir_opt/texture_pass.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/shader_recompiler/ir_opt/texture_pass.cpp b/src/shader_recompiler/ir_opt/texture_pass.cpp index e9098239d..737f186ab 100644 --- a/src/shader_recompiler/ir_opt/texture_pass.cpp +++ b/src/shader_recompiler/ir_opt/texture_pass.cpp @@ -312,11 +312,14 @@ public: } u32 Add(const ImageBufferDescriptor& desc) { - return Add(image_buffer_descriptors, desc, [&desc](const auto& existing) { + const u32 index{Add(image_buffer_descriptors, desc, [&desc](const auto& existing) { return desc.format == existing.format && desc.cbuf_index == existing.cbuf_index && desc.cbuf_offset == existing.cbuf_offset && desc.count == existing.count && desc.size_shift == existing.size_shift; - }); + })}; + image_buffer_descriptors[index].is_written |= desc.is_written; + image_buffer_descriptors[index].is_read |= desc.is_read; + return index; } u32 Add(const TextureDescriptor& desc) { @@ -339,6 +342,7 @@ public: desc.size_shift == existing.size_shift; })}; image_descriptors[index].is_written |= desc.is_written; + image_descriptors[index].is_read |= desc.is_read; return index; } @@ -430,10 +434,12 @@ void TexturePass(Environment& env, IR::Program& program) { throw NotImplementedException("Unexpected separate sampler"); } const bool is_written{inst->GetOpcode() != IR::Opcode::ImageRead}; + const bool is_read{inst->GetOpcode() == IR::Opcode::ImageRead}; if (flags.type == TextureType::Buffer) { index = descriptors.Add(ImageBufferDescriptor{ .format = flags.image_format, .is_written = is_written, + .is_read = is_read, .cbuf_index = cbuf.index, .cbuf_offset = cbuf.offset, .count = cbuf.count, @@ -444,6 +450,7 @@ void TexturePass(Environment& env, IR::Program& program) { .type = flags.type, .format = flags.image_format, .is_written = is_written, + .is_read = is_read, .cbuf_index = cbuf.index, .cbuf_offset = cbuf.offset, .count = cbuf.count, |