summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Feng Chen2021-09-02 23:34:51 +0800
committerGravatar Feng Chen2021-09-02 23:34:51 +0800
commit1e2a89d3061bbee3c73cd55fb8d580b56aabacec (patch)
tree641e9e88512f3479c19b2e6bd8fe41bb2b80b840 /src
parentAdd colorfront and txtcoord support (diff)
downloadyuzu-1e2a89d3061bbee3c73cd55fb8d580b56aabacec.tar.gz
yuzu-1e2a89d3061bbee3c73cd55fb8d580b56aabacec.tar.xz
yuzu-1e2a89d3061bbee3c73cd55fb8d580b56aabacec.zip
Add input/output location
Diffstat (limited to 'src')
-rw-r--r--src/shader_recompiler/backend/spirv/emit_context.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/shader_recompiler/backend/spirv/emit_context.cpp b/src/shader_recompiler/backend/spirv/emit_context.cpp
index 89c75c52d..ff0501b76 100644
--- a/src/shader_recompiler/backend/spirv/emit_context.cpp
+++ b/src/shader_recompiler/backend/spirv/emit_context.cpp
@@ -1202,10 +1202,14 @@ void EmitContext::DefineInputs(const IR::Program& program) {
1202 } 1202 }
1203 } 1203 }
1204 if (loads.AllComponents(IR::Attribute::ColorFrontDiffuseR)) { 1204 if (loads.AllComponents(IR::Attribute::ColorFrontDiffuseR)) {
1205 input_front_color = DefineInput(*this, F32[4], true); 1205 const Id id{DefineInput(*this, F32[4], true)};
1206 Decorate(id, spv::Decoration::Location, static_cast<u32>(55));
1207 input_front_color = id;
1206 } 1208 }
1207 if (loads.AllComponents(IR::Attribute::FixedFncTexture0S)) { 1209 if (loads.AnyComponent(IR::Attribute::FixedFncTexture0S)) {
1208 input_txt_coord = DefineInput(*this, F32[4], true); 1210 const Id id{DefineInput(*this, F32[4], true)};
1211 Decorate(id, spv::Decoration::Location, static_cast<u32>(56));
1212 input_txt_coord = id;
1209 } 1213 }
1210 if (loads[IR::Attribute::InstanceId]) { 1214 if (loads[IR::Attribute::InstanceId]) {
1211 if (profile.support_vertex_instance_id) { 1215 if (profile.support_vertex_instance_id) {
@@ -1289,7 +1293,9 @@ void EmitContext::DefineOutputs(const IR::Program& program) {
1289 output_position = DefineOutput(*this, F32[4], invocations, spv::BuiltIn::Position); 1293 output_position = DefineOutput(*this, F32[4], invocations, spv::BuiltIn::Position);
1290 } 1294 }
1291 if (info.stores.AnyComponent(IR::Attribute::ColorFrontDiffuseR) || stage == Stage::VertexB) { 1295 if (info.stores.AnyComponent(IR::Attribute::ColorFrontDiffuseR) || stage == Stage::VertexB) {
1292 output_front_color = DefineOutput(*this, F32[4], invocations); 1296 const Id id{DefineOutput(*this, F32[4], invocations)};
1297 Decorate(id, spv::Decoration::Location, static_cast<u32>(55));
1298 output_front_color = id;
1293 } 1299 }
1294 if (info.stores[IR::Attribute::PointSize] || runtime_info.fixed_state_point_size) { 1300 if (info.stores[IR::Attribute::PointSize] || runtime_info.fixed_state_point_size) {
1295 if (stage == Stage::Fragment) { 1301 if (stage == Stage::Fragment) {
@@ -1324,7 +1330,9 @@ void EmitContext::DefineOutputs(const IR::Program& program) {
1324 } 1330 }
1325 1331
1326 if (info.stores.AnyComponent(IR::Attribute::FixedFncTexture0S)) { 1332 if (info.stores.AnyComponent(IR::Attribute::FixedFncTexture0S)) {
1327 output_txt_coord = DefineOutput(*this, F32[4], invocations); 1333 const Id id{DefineOutput(*this, F32[4], invocations)};
1334 Decorate(id, spv::Decoration::Location, static_cast<u32>(56));
1335 output_txt_coord = id;
1328 } 1336 }
1329 1337
1330 for (size_t index = 0; index < IR::NUM_GENERICS; ++index) { 1338 for (size_t index = 0; index < IR::NUM_GENERICS; ++index) {