summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/backend/spirv/emit_context.cpp
diff options
context:
space:
mode:
authorGravatar Feng Chen2021-09-07 12:34:35 +0800
committerGravatar Feng Chen2021-09-07 12:34:35 +0800
commit9cdf2383e99fac2110d788da070f16b2b5c678e7 (patch)
treea4857abbacebf3659e6b5c647eceb5a64146a26b /src/shader_recompiler/backend/spirv/emit_context.cpp
parentDynamic get unused location (diff)
downloadyuzu-9cdf2383e99fac2110d788da070f16b2b5c678e7.tar.gz
yuzu-9cdf2383e99fac2110d788da070f16b2b5c678e7.tar.xz
yuzu-9cdf2383e99fac2110d788da070f16b2b5c678e7.zip
Move attribute related definitions to spirv anonymous namespace
Diffstat (limited to 'src/shader_recompiler/backend/spirv/emit_context.cpp')
-rw-r--r--src/shader_recompiler/backend/spirv/emit_context.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/shader_recompiler/backend/spirv/emit_context.cpp b/src/shader_recompiler/backend/spirv/emit_context.cpp
index 2809f9281..f048174cb 100644
--- a/src/shader_recompiler/backend/spirv/emit_context.cpp
+++ b/src/shader_recompiler/backend/spirv/emit_context.cpp
@@ -428,6 +428,8 @@ Id DescType(EmitContext& ctx, Id sampled_type, Id pointer_type, u32 count) {
428 return pointer_type; 428 return pointer_type;
429 } 429 }
430} 430}
431
432constexpr size_t NUM_FIXEDFNCTEXTURE = 10;
431} // Anonymous namespace 433} // Anonymous namespace
432 434
433void VectorTypes::Define(Sirit::Module& sirit_ctx, Id base_type, std::string_view name) { 435void VectorTypes::Define(Sirit::Module& sirit_ctx, Id base_type, std::string_view name) {
@@ -1272,7 +1274,7 @@ void EmitContext::DefineInputs(const IR::Program& program) {
1272 Decorate(id, spv::Decoration::Location, location); 1274 Decorate(id, spv::Decoration::Location, location);
1273 input_front_color = id; 1275 input_front_color = id;
1274 } 1276 }
1275 for (size_t index = 0; index < IR::NUM_FIXEDFNCTEXTURE; ++index) { 1277 for (size_t index = 0; index < NUM_FIXEDFNCTEXTURE; ++index) {
1276 if (loads.AnyComponent(IR::Attribute::FixedFncTexture0S + index * 4)) { 1278 if (loads.AnyComponent(IR::Attribute::FixedFncTexture0S + index * 4)) {
1277 if (ununsed_location.empty()) { 1279 if (ununsed_location.empty()) {
1278 throw RuntimeError("Unable to get an unused location"); 1280 throw RuntimeError("Unable to get an unused location");
@@ -1352,7 +1354,7 @@ void EmitContext::DefineOutputs(const IR::Program& program) {
1352 Decorate(id, spv::Decoration::Location, location); 1354 Decorate(id, spv::Decoration::Location, location);
1353 output_front_color = id; 1355 output_front_color = id;
1354 } 1356 }
1355 for (size_t index = 0; index < IR::NUM_FIXEDFNCTEXTURE; ++index) { 1357 for (size_t index = 0; index < NUM_FIXEDFNCTEXTURE; ++index) {
1356 if (info.stores.AnyComponent(IR::Attribute::FixedFncTexture0S + index * 4)) { 1358 if (info.stores.AnyComponent(IR::Attribute::FixedFncTexture0S + index * 4)) {
1357 if (ununsed_location.empty()) { 1359 if (ununsed_location.empty()) {
1358 throw RuntimeError("Unable to get an unused location"); 1360 throw RuntimeError("Unable to get an unused location");