summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/backend/glsl
diff options
context:
space:
mode:
authorGravatar ameerj2021-06-07 18:28:42 -0400
committerGravatar ameerj2021-07-22 21:51:37 -0400
commitfb839061fbe23593455ac0c9e83c0a08831fd5db (patch)
tree27620ad1b0633b40b909aa9fc2ba4d7f423166d5 /src/shader_recompiler/backend/glsl
parentglsl: Allow dynamic tracking of variable allocation (diff)
downloadyuzu-fb839061fbe23593455ac0c9e83c0a08831fd5db.tar.gz
yuzu-fb839061fbe23593455ac0c9e83c0a08831fd5db.tar.xz
yuzu-fb839061fbe23593455ac0c9e83c0a08831fd5db.zip
glsl: Remove output generic indexing for geometry stage
Diffstat (limited to 'src/shader_recompiler/backend/glsl')
-rw-r--r--src/shader_recompiler/backend/glsl/emit_glsl_context_get_set.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl_context_get_set.cpp b/src/shader_recompiler/backend/glsl/emit_glsl_context_get_set.cpp
index 4d35be152..cfcdd45a2 100644
--- a/src/shader_recompiler/backend/glsl/emit_glsl_context_get_set.cpp
+++ b/src/shader_recompiler/backend/glsl/emit_glsl_context_get_set.cpp
@@ -30,10 +30,8 @@ std::string InputVertexIndex(EmitContext& ctx, std::string_view vertex) {
30 return IsInputArray(ctx.stage) ? fmt::format("[{}]", vertex) : ""; 30 return IsInputArray(ctx.stage) ? fmt::format("[{}]", vertex) : "";
31} 31}
32 32
33std::string OutputVertexIndex(EmitContext& ctx, std::string_view vertex) { 33std::string OutputVertexIndex(EmitContext& ctx) {
34 switch (ctx.stage) { 34 switch (ctx.stage) {
35 case Stage::Geometry:
36 return fmt::format("[{}]", vertex);
37 case Stage::TessellationControl: 35 case Stage::TessellationControl:
38 return "[gl_InvocationID]"; 36 return "[gl_InvocationID]";
39 default: 37 default:
@@ -252,12 +250,12 @@ void EmitGetAttribute(EmitContext& ctx, IR::Inst& inst, IR::Attribute attr,
252} 250}
253 251
254void EmitSetAttribute(EmitContext& ctx, IR::Attribute attr, std::string_view value, 252void EmitSetAttribute(EmitContext& ctx, IR::Attribute attr, std::string_view value,
255 std::string_view vertex) { 253 [[maybe_unused]] std::string_view vertex) {
256 if (IR::IsGeneric(attr)) { 254 if (IR::IsGeneric(attr)) {
257 const u32 index{IR::GenericAttributeIndex(attr)}; 255 const u32 index{IR::GenericAttributeIndex(attr)};
258 const u32 element{IR::GenericAttributeElement(attr)}; 256 const u32 element{IR::GenericAttributeElement(attr)};
259 const GenericElementInfo& info{ctx.output_generics.at(index).at(element)}; 257 const GenericElementInfo& info{ctx.output_generics.at(index).at(element)};
260 const auto output_decorator{OutputVertexIndex(ctx, vertex)}; 258 const auto output_decorator{OutputVertexIndex(ctx)};
261 if (info.num_components == 1) { 259 if (info.num_components == 1) {
262 ctx.Add("{}{}={};", info.name, output_decorator, value); 260 ctx.Add("{}{}={};", info.name, output_decorator, value);
263 } else { 261 } else {