summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/backend/glasm/emit_context.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/shader_recompiler/backend/glasm/emit_context.cpp')
-rw-r--r--src/shader_recompiler/backend/glasm/emit_context.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/shader_recompiler/backend/glasm/emit_context.cpp b/src/shader_recompiler/backend/glasm/emit_context.cpp
index 8f418936e..a9bbb680f 100644
--- a/src/shader_recompiler/backend/glasm/emit_context.cpp
+++ b/src/shader_recompiler/backend/glasm/emit_context.cpp
@@ -47,24 +47,31 @@ EmitContext::EmitContext(IR::Program& program, Bindings& bindings, const Profile
case Stage::VertexA:
case Stage::VertexB:
stage_name = "vertex";
+ attrib_name = "vertex";
break;
case Stage::TessellationControl:
case Stage::TessellationEval:
+ stage_name = "primitive";
+ attrib_name = "primitive";
+ break;
case Stage::Geometry:
stage_name = "primitive";
+ attrib_name = "vertex";
break;
case Stage::Fragment:
stage_name = "fragment";
+ attrib_name = "fragment";
break;
case Stage::Compute:
stage_name = "invocation";
break;
}
+ const std::string_view attr_stage{stage == Stage::Fragment ? "fragment" : "vertex"};
for (size_t index = 0; index < program.info.input_generics.size(); ++index) {
const auto& generic{program.info.input_generics[index]};
if (generic.used) {
Add("{}ATTRIB in_attr{}[]={{{}.attrib[{}..{}]}};",
- InterpDecorator(generic.interpolation), index, stage_name, index, index);
+ InterpDecorator(generic.interpolation), index, attr_stage, index, index);
}
}
for (size_t index = 0; index < program.info.stores_frag_color.size(); ++index) {