diff options
author | vonchenplus <vonchenplus@gmail.com> | 2021-10-26 17:09:44 +0200 |
---|---|---|
committer | vonchenplus <vonchenplus@gmail.com> | 2021-10-26 17:09:44 +0200 |
commit | 92bebecf4632fb5435d74a77d45bf56535eb85e4 (patch) | |
tree | 8a58ba7d65ebc9d5c3a38d4c3568d8bc021b204e /src/shader_recompiler/backend/spirv/emit_context.cpp | |
parent | Support gl_BackColor attribute (diff) | |
download | yuzu-92bebecf4632fb5435d74a77d45bf56535eb85e4.tar yuzu-92bebecf4632fb5435d74a77d45bf56535eb85e4.tar.gz yuzu-92bebecf4632fb5435d74a77d45bf56535eb85e4.tar.bz2 yuzu-92bebecf4632fb5435d74a77d45bf56535eb85e4.tar.lz yuzu-92bebecf4632fb5435d74a77d45bf56535eb85e4.tar.xz yuzu-92bebecf4632fb5435d74a77d45bf56535eb85e4.tar.zst yuzu-92bebecf4632fb5435d74a77d45bf56535eb85e4.zip |
Diffstat (limited to 'src/shader_recompiler/backend/spirv/emit_context.cpp')
-rw-r--r-- | src/shader_recompiler/backend/spirv/emit_context.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/shader_recompiler/backend/spirv/emit_context.cpp b/src/shader_recompiler/backend/spirv/emit_context.cpp index 9d84c4fc6..7726bc9c6 100644 --- a/src/shader_recompiler/backend/spirv/emit_context.cpp +++ b/src/shader_recompiler/backend/spirv/emit_context.cpp @@ -1286,6 +1286,14 @@ void EmitContext::DefineInputs(const IR::Program& program) { Decorate(id, spv::Decoration::Location, location); input_front_color = id; } + if (loads.AnyComponent(IR::Attribute::ColorFrontSpecularR)) { + const size_t location = FindNextUnusedLocation(used_locations, previous_unused_location); + previous_unused_location = location; + used_locations.set(location); + const Id id{DefineInput(*this, F32[4], true)}; + Decorate(id, spv::Decoration::Location, location); + input_front_secondary_color = id; + } if (loads.AnyComponent(IR::Attribute::ColorBackDiffuseR)) { const size_t location = FindNextUnusedLocation(used_locations, previous_unused_location); previous_unused_location = location; @@ -1371,6 +1379,14 @@ void EmitContext::DefineOutputs(const IR::Program& program) { Decorate(id, spv::Decoration::Location, static_cast<u32>(location)); output_front_color = id; } + if (info.stores.AnyComponent(IR::Attribute::ColorFrontSpecularR)) { + const size_t location = FindNextUnusedLocation(used_locations, previous_unused_location); + previous_unused_location = location; + used_locations.set(location); + const Id id{DefineOutput(*this, F32[4], invocations)}; + Decorate(id, spv::Decoration::Location, static_cast<u32>(location)); + output_front_secondary_color = id; + } if (info.stores.AnyComponent(IR::Attribute::ColorBackDiffuseR)) { const size_t location = FindNextUnusedLocation(used_locations, previous_unused_location); previous_unused_location = location; |