diff options
| author | 2021-10-26 23:14:40 +0800 | |
|---|---|---|
| committer | 2021-10-26 23:14:40 +0800 | |
| commit | 36c21ff6cbffd55ba9314314ee8f414181fd4f9b (patch) | |
| tree | 4eb30de1f55680c83761111d6adcb93659dfd459 /src/shader_recompiler/backend/spirv/emit_context.cpp | |
| parent | Support gl_FrontSecondaryColor attribute (diff) | |
| download | yuzu-36c21ff6cbffd55ba9314314ee8f414181fd4f9b.tar.gz yuzu-36c21ff6cbffd55ba9314314ee8f414181fd4f9b.tar.xz yuzu-36c21ff6cbffd55ba9314314ee8f414181fd4f9b.zip | |
Support gl_BackSecondaryColor attribute
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 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) { | |||
| 1302 | Decorate(id, spv::Decoration::Location, location); | 1302 | Decorate(id, spv::Decoration::Location, location); |
| 1303 | input_back_color = id; | 1303 | input_back_color = id; |
| 1304 | } | 1304 | } |
| 1305 | if (loads.AnyComponent(IR::Attribute::ColorBackSpecularR)) { | ||
| 1306 | const size_t location = FindNextUnusedLocation(used_locations, previous_unused_location); | ||
| 1307 | previous_unused_location = location; | ||
| 1308 | used_locations.set(location); | ||
| 1309 | const Id id{DefineInput(*this, F32[4], true)}; | ||
| 1310 | Decorate(id, spv::Decoration::Location, location); | ||
| 1311 | input_back_secondary_color = id; | ||
| 1312 | } | ||
| 1305 | for (size_t index = 0; index < NUM_FIXEDFNCTEXTURE; ++index) { | 1313 | for (size_t index = 0; index < NUM_FIXEDFNCTEXTURE; ++index) { |
| 1306 | if (loads.AnyComponent(IR::Attribute::FixedFncTexture0S + index * 4)) { | 1314 | if (loads.AnyComponent(IR::Attribute::FixedFncTexture0S + index * 4)) { |
| 1307 | const size_t location = | 1315 | const size_t location = |
| @@ -1395,6 +1403,14 @@ void EmitContext::DefineOutputs(const IR::Program& program) { | |||
| 1395 | Decorate(id, spv::Decoration::Location, static_cast<u32>(location)); | 1403 | Decorate(id, spv::Decoration::Location, static_cast<u32>(location)); |
| 1396 | output_back_color = id; | 1404 | output_back_color = id; |
| 1397 | } | 1405 | } |
| 1406 | if (info.stores.AnyComponent(IR::Attribute::ColorBackSpecularR)) { | ||
| 1407 | const size_t location = FindNextUnusedLocation(used_locations, previous_unused_location); | ||
| 1408 | previous_unused_location = location; | ||
| 1409 | used_locations.set(location); | ||
| 1410 | const Id id{DefineOutput(*this, F32[4], invocations)}; | ||
| 1411 | Decorate(id, spv::Decoration::Location, static_cast<u32>(location)); | ||
| 1412 | output_back_secondary_color = id; | ||
| 1413 | } | ||
| 1398 | for (size_t index = 0; index < NUM_FIXEDFNCTEXTURE; ++index) { | 1414 | for (size_t index = 0; index < NUM_FIXEDFNCTEXTURE; ++index) { |
| 1399 | if (info.stores.AnyComponent(IR::Attribute::FixedFncTexture0S + index * 4)) { | 1415 | if (info.stores.AnyComponent(IR::Attribute::FixedFncTexture0S + index * 4)) { |
| 1400 | const size_t location = | 1416 | const size_t location = |