diff options
| author | 2021-10-26 23:09:44 +0800 | |
|---|---|---|
| committer | 2021-10-26 23:09:44 +0800 | |
| commit | 92bebecf4632fb5435d74a77d45bf56535eb85e4 (patch) | |
| tree | 8a58ba7d65ebc9d5c3a38d4c3568d8bc021b204e /src/shader_recompiler/backend/spirv/emit_context.cpp | |
| parent | Support gl_BackColor attribute (diff) | |
| download | yuzu-92bebecf4632fb5435d74a77d45bf56535eb85e4.tar.gz yuzu-92bebecf4632fb5435d74a77d45bf56535eb85e4.tar.xz yuzu-92bebecf4632fb5435d74a77d45bf56535eb85e4.zip | |
Support gl_FrontSecondaryColor 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 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) { | |||
| 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::ColorFrontSpecularR)) { | ||
| 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_front_secondary_color = id; | ||
| 1296 | } | ||
| 1289 | if (loads.AnyComponent(IR::Attribute::ColorBackDiffuseR)) { | 1297 | if (loads.AnyComponent(IR::Attribute::ColorBackDiffuseR)) { |
| 1290 | const size_t location = FindNextUnusedLocation(used_locations, previous_unused_location); | 1298 | const size_t location = FindNextUnusedLocation(used_locations, previous_unused_location); |
| 1291 | previous_unused_location = location; | 1299 | previous_unused_location = location; |
| @@ -1371,6 +1379,14 @@ void EmitContext::DefineOutputs(const IR::Program& program) { | |||
| 1371 | Decorate(id, spv::Decoration::Location, static_cast<u32>(location)); | 1379 | Decorate(id, spv::Decoration::Location, static_cast<u32>(location)); |
| 1372 | output_front_color = id; | 1380 | output_front_color = id; |
| 1373 | } | 1381 | } |
| 1382 | if (info.stores.AnyComponent(IR::Attribute::ColorFrontSpecularR)) { | ||
| 1383 | const size_t location = FindNextUnusedLocation(used_locations, previous_unused_location); | ||
| 1384 | previous_unused_location = location; | ||
| 1385 | used_locations.set(location); | ||
| 1386 | const Id id{DefineOutput(*this, F32[4], invocations)}; | ||
| 1387 | Decorate(id, spv::Decoration::Location, static_cast<u32>(location)); | ||
| 1388 | output_front_secondary_color = id; | ||
| 1389 | } | ||
| 1374 | if (info.stores.AnyComponent(IR::Attribute::ColorBackDiffuseR)) { | 1390 | if (info.stores.AnyComponent(IR::Attribute::ColorBackDiffuseR)) { |
| 1375 | const size_t location = FindNextUnusedLocation(used_locations, previous_unused_location); | 1391 | const size_t location = FindNextUnusedLocation(used_locations, previous_unused_location); |
| 1376 | previous_unused_location = location; | 1392 | previous_unused_location = location; |