summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/backend/spirv/emit_context.cpp
diff options
context:
space:
mode:
authorvonchenplus <vonchenplus@gmail.com>2021-10-26 17:14:40 +0200
committervonchenplus <vonchenplus@gmail.com>2021-10-26 17:14:40 +0200
commit36c21ff6cbffd55ba9314314ee8f414181fd4f9b (patch)
tree4eb30de1f55680c83761111d6adcb93659dfd459 /src/shader_recompiler/backend/spirv/emit_context.cpp
parentSupport gl_FrontSecondaryColor attribute (diff)
downloadyuzu-36c21ff6cbffd55ba9314314ee8f414181fd4f9b.tar
yuzu-36c21ff6cbffd55ba9314314ee8f414181fd4f9b.tar.gz
yuzu-36c21ff6cbffd55ba9314314ee8f414181fd4f9b.tar.bz2
yuzu-36c21ff6cbffd55ba9314314ee8f414181fd4f9b.tar.lz
yuzu-36c21ff6cbffd55ba9314314ee8f414181fd4f9b.tar.xz
yuzu-36c21ff6cbffd55ba9314314ee8f414181fd4f9b.tar.zst
yuzu-36c21ff6cbffd55ba9314314ee8f414181fd4f9b.zip
Diffstat (limited to 'src/shader_recompiler/backend/spirv/emit_context.cpp')
-rw-r--r--src/shader_recompiler/backend/spirv/emit_context.cpp16
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 7726bc9c6..d60ad139d 100644
--- a/src/shader_recompiler/backend/spirv/emit_context.cpp
+++ b/src/shader_recompiler/backend/spirv/emit_context.cpp
@@ -1302,6 +1302,14 @@ void EmitContext::DefineInputs(const IR::Program& program) {
Decorate(id, spv::Decoration::Location, location);
input_back_color = id;
}
+ if (loads.AnyComponent(IR::Attribute::ColorBackSpecularR)) {
+ 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_back_secondary_color = id;
+ }
for (size_t index = 0; index < NUM_FIXEDFNCTEXTURE; ++index) {
if (loads.AnyComponent(IR::Attribute::FixedFncTexture0S + index * 4)) {
const size_t location =
@@ -1395,6 +1403,14 @@ void EmitContext::DefineOutputs(const IR::Program& program) {
Decorate(id, spv::Decoration::Location, static_cast<u32>(location));
output_back_color = id;
}
+ if (info.stores.AnyComponent(IR::Attribute::ColorBackSpecularR)) {
+ 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_back_secondary_color = id;
+ }
for (size_t index = 0; index < NUM_FIXEDFNCTEXTURE; ++index) {
if (info.stores.AnyComponent(IR::Attribute::FixedFncTexture0S + index * 4)) {
const size_t location =