summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/backend/spirv/emit_context.cpp
diff options
context:
space:
mode:
authorGravatar vonchenplus2021-10-26 23:01:57 +0800
committerGravatar vonchenplus2021-10-26 23:01:57 +0800
commitb04c7b63435ad51ce747d678be3fe5899f14609e (patch)
treefbebe3acce60013e5ca9e9a7c6155c28ab51fdd9 /src/shader_recompiler/backend/spirv/emit_context.cpp
parentMerge pull request #7218 from bylaws/aswdqdsam (diff)
downloadyuzu-b04c7b63435ad51ce747d678be3fe5899f14609e.tar.gz
yuzu-b04c7b63435ad51ce747d678be3fe5899f14609e.tar.xz
yuzu-b04c7b63435ad51ce747d678be3fe5899f14609e.zip
Support gl_BackColor attribute
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 2885e6799..9d84c4fc6 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) {
1286 Decorate(id, spv::Decoration::Location, location); 1286 Decorate(id, spv::Decoration::Location, location);
1287 input_front_color = id; 1287 input_front_color = id;
1288 } 1288 }
1289 if (loads.AnyComponent(IR::Attribute::ColorBackDiffuseR)) {
1290 const size_t location = FindNextUnusedLocation(used_locations, previous_unused_location);
1291 previous_unused_location = location;
1292 used_locations.set(location);
1293 const Id id{DefineInput(*this, F32[4], true)};
1294 Decorate(id, spv::Decoration::Location, location);
1295 input_back_color = id;
1296 }
1289 for (size_t index = 0; index < NUM_FIXEDFNCTEXTURE; ++index) { 1297 for (size_t index = 0; index < NUM_FIXEDFNCTEXTURE; ++index) {
1290 if (loads.AnyComponent(IR::Attribute::FixedFncTexture0S + index * 4)) { 1298 if (loads.AnyComponent(IR::Attribute::FixedFncTexture0S + index * 4)) {
1291 const size_t location = 1299 const size_t location =
@@ -1363,6 +1371,14 @@ void EmitContext::DefineOutputs(const IR::Program& program) {
1363 Decorate(id, spv::Decoration::Location, static_cast<u32>(location)); 1371 Decorate(id, spv::Decoration::Location, static_cast<u32>(location));
1364 output_front_color = id; 1372 output_front_color = id;
1365 } 1373 }
1374 if (info.stores.AnyComponent(IR::Attribute::ColorBackDiffuseR)) {
1375 const size_t location = FindNextUnusedLocation(used_locations, previous_unused_location);
1376 previous_unused_location = location;
1377 used_locations.set(location);
1378 const Id id{DefineOutput(*this, F32[4], invocations)};
1379 Decorate(id, spv::Decoration::Location, static_cast<u32>(location));
1380 output_back_color = id;
1381 }
1366 for (size_t index = 0; index < NUM_FIXEDFNCTEXTURE; ++index) { 1382 for (size_t index = 0; index < NUM_FIXEDFNCTEXTURE; ++index) {
1367 if (info.stores.AnyComponent(IR::Attribute::FixedFncTexture0S + index * 4)) { 1383 if (info.stores.AnyComponent(IR::Attribute::FixedFncTexture0S + index * 4)) {
1368 const size_t location = 1384 const size_t location =