From fcec7995af948f0c11ab81001fec5b7242a85136 Mon Sep 17 00:00:00 2001 From: EmulationEnjoyer Date: Tue, 12 Nov 2024 21:21:24 +0000 Subject: [PATCH] feat(shader): implement geometry shader invocation info - Update EmitInvocationInfo in SPIRV backend to handle geometry shader stage ref: https://git.citron-emu.org/Citron/Citron/commit/1266fad68128b3779dcd9bbb6c5f77ec1055e2e6#diff-4cbf73a98ed4ad649a4a6f38b569bc31fcf68cf7 --- .../backend/spirv/emit_spirv_context_get_set.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp index 4d5f32b776..be65db7657 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp @@ -547,8 +547,9 @@ Id EmitInvocationInfo(EmitContext& ctx) { switch (ctx.stage) { case Stage::TessellationControl: case Stage::TessellationEval: - return ctx.OpShiftLeftLogical(ctx.U32[1], ctx.OpLoad(ctx.U32[1], ctx.patch_vertices_in), - ctx.Const(16u)); + return ctx.OpShiftLeftLogical(ctx.U32[1], ctx.OpLoad(ctx.U32[1], ctx.patch_vertices_in), ctx.Const(16u)); + case Stage::Geometry: + return ctx.OpShiftLeftLogical(ctx.U32[1], ctx.Const(InputTopologyVertices::vertices(ctx.runtime_info.input_topology)), ctx.Const(16u)); default: LOG_WARNING(Shader, "(STUBBED) called"); return ctx.Const(0x00ff0000u);