diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2020-01-06 16:43:13 +0100 |
---|---|---|
committer | FernandoS27 <fsahmkow27@gmail.com> | 2020-01-24 21:43:31 +0100 |
commit | 2b02f29a2ddfe40639ea0f855bdf257beca59e65 (patch) | |
tree | c0efeb4b23ecaf03b6f4fdd6b82f923dd7a01b20 /src/video_core/renderer_opengl/gl_shader_decompiler.cpp | |
parent | Shader_IR: deduce size of indexed samplers (diff) | |
download | yuzu-2b02f29a2ddfe40639ea0f855bdf257beca59e65.tar yuzu-2b02f29a2ddfe40639ea0f855bdf257beca59e65.tar.gz yuzu-2b02f29a2ddfe40639ea0f855bdf257beca59e65.tar.bz2 yuzu-2b02f29a2ddfe40639ea0f855bdf257beca59e65.tar.lz yuzu-2b02f29a2ddfe40639ea0f855bdf257beca59e65.tar.xz yuzu-2b02f29a2ddfe40639ea0f855bdf257beca59e65.tar.zst yuzu-2b02f29a2ddfe40639ea0f855bdf257beca59e65.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_opengl/gl_shader_decompiler.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index 2996aaf08..4b35396f9 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp @@ -655,7 +655,8 @@ private: u32 binding = device.GetBaseBindings(stage).sampler; for (const auto& sampler : ir.GetSamplers()) { const std::string name = GetSampler(sampler); - const std::string description = fmt::format("layout (binding = {}) uniform", binding++); + const std::string description = fmt::format("layout (binding = {}) uniform", binding); + binding += sampler.IsIndexed() ? sampler.Size() : 1; std::string sampler_type = [&]() { if (sampler.IsBuffer()) { @@ -682,7 +683,11 @@ private: sampler_type += "Shadow"; } - code.AddLine("{} {} {};", description, sampler_type, name); + if (!sampler.IsIndexed()) { + code.AddLine("{} {} {};", description, sampler_type, name); + } else { + code.AddLine("{} {} {}[{}];", description, sampler_type, name, sampler.Size()); + } } if (!ir.GetSamplers().empty()) { code.AddNewLine(); @@ -1099,7 +1104,11 @@ private: } else if (!meta->ptp.empty()) { expr += "Offsets"; } - expr += '(' + GetSampler(meta->sampler) + ", "; + if (!meta->sampler.IsIndexed()) { + expr += '(' + GetSampler(meta->sampler) + ", "; + } else { + expr += '(' + GetSampler(meta->sampler) + "[0], "; + } expr += coord_constructors.at(count + (has_array ? 1 : 0) + (has_shadow && !separate_dc ? 1 : 0) - 1); expr += '('; |