summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/backend/spirv/emit_context.cpp
diff options
context:
space:
mode:
authorGravatar Feng Chen2021-09-01 00:07:25 +0800
committerGravatar Feng Chen2021-09-01 00:07:25 +0800
commit73b11f390e3dabf42d22af78670c8aa6d8f52cee (patch)
tree3af775771173d1e827d2e1a05ada642a43fba9a9 /src/shader_recompiler/backend/spirv/emit_context.cpp
parentMerge pull request #6905 from Morph1984/nifm-misc (diff)
downloadyuzu-73b11f390e3dabf42d22af78670c8aa6d8f52cee.tar.gz
yuzu-73b11f390e3dabf42d22af78670c8aa6d8f52cee.tar.xz
yuzu-73b11f390e3dabf42d22af78670c8aa6d8f52cee.zip
Add colorfront and txtcoord support
Diffstat (limited to 'src/shader_recompiler/backend/spirv/emit_context.cpp')
-rw-r--r--src/shader_recompiler/backend/spirv/emit_context.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/shader_recompiler/backend/spirv/emit_context.cpp b/src/shader_recompiler/backend/spirv/emit_context.cpp
index 2d29d8c14..89c75c52d 100644
--- a/src/shader_recompiler/backend/spirv/emit_context.cpp
+++ b/src/shader_recompiler/backend/spirv/emit_context.cpp
@@ -1201,6 +1201,12 @@ void EmitContext::DefineInputs(const IR::Program& program) {
1201 } 1201 }
1202 } 1202 }
1203 } 1203 }
1204 if (loads.AllComponents(IR::Attribute::ColorFrontDiffuseR)) {
1205 input_front_color = DefineInput(*this, F32[4], true);
1206 }
1207 if (loads.AllComponents(IR::Attribute::FixedFncTexture0S)) {
1208 input_txt_coord = DefineInput(*this, F32[4], true);
1209 }
1204 if (loads[IR::Attribute::InstanceId]) { 1210 if (loads[IR::Attribute::InstanceId]) {
1205 if (profile.support_vertex_instance_id) { 1211 if (profile.support_vertex_instance_id) {
1206 instance_id = DefineInput(*this, U32[1], true, spv::BuiltIn::InstanceId); 1212 instance_id = DefineInput(*this, U32[1], true, spv::BuiltIn::InstanceId);
@@ -1282,6 +1288,9 @@ void EmitContext::DefineOutputs(const IR::Program& program) {
1282 if (info.stores.AnyComponent(IR::Attribute::PositionX) || stage == Stage::VertexB) { 1288 if (info.stores.AnyComponent(IR::Attribute::PositionX) || stage == Stage::VertexB) {
1283 output_position = DefineOutput(*this, F32[4], invocations, spv::BuiltIn::Position); 1289 output_position = DefineOutput(*this, F32[4], invocations, spv::BuiltIn::Position);
1284 } 1290 }
1291 if (info.stores.AnyComponent(IR::Attribute::ColorFrontDiffuseR) || stage == Stage::VertexB) {
1292 output_front_color = DefineOutput(*this, F32[4], invocations);
1293 }
1285 if (info.stores[IR::Attribute::PointSize] || runtime_info.fixed_state_point_size) { 1294 if (info.stores[IR::Attribute::PointSize] || runtime_info.fixed_state_point_size) {
1286 if (stage == Stage::Fragment) { 1295 if (stage == Stage::Fragment) {
1287 throw NotImplementedException("Storing PointSize in fragment stage"); 1296 throw NotImplementedException("Storing PointSize in fragment stage");
@@ -1313,6 +1322,11 @@ void EmitContext::DefineOutputs(const IR::Program& program) {
1313 viewport_mask = DefineOutput(*this, TypeArray(U32[1], Const(1u)), std::nullopt, 1322 viewport_mask = DefineOutput(*this, TypeArray(U32[1], Const(1u)), std::nullopt,
1314 spv::BuiltIn::ViewportMaskNV); 1323 spv::BuiltIn::ViewportMaskNV);
1315 } 1324 }
1325
1326 if (info.stores.AnyComponent(IR::Attribute::FixedFncTexture0S)) {
1327 output_txt_coord = DefineOutput(*this, F32[4], invocations);
1328 }
1329
1316 for (size_t index = 0; index < IR::NUM_GENERICS; ++index) { 1330 for (size_t index = 0; index < IR::NUM_GENERICS; ++index) {
1317 if (info.stores.Generic(index)) { 1331 if (info.stores.Generic(index)) {
1318 DefineGenericOutput(*this, index, invocations); 1332 DefineGenericOutput(*this, index, invocations);