summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/backend/spirv
diff options
context:
space:
mode:
authorZephyron <zephyron@citron-emu.org>2025-01-20 17:02:01 +1000
committerZephyron <zephyron@citron-emu.org>2025-01-20 17:02:01 +1000
commit04f9d8b61a8cdc3192c1f4713580caa996f20b04 (patch)
tree3a104a083e76346f402f42cfb74bb4a226098d9f /src/shader_recompiler/backend/spirv
parentb574aba98b6714b9229a3b0fadf5aaf92851dd51 (diff)
shader: Implement EmitInvocationInfo across all backends
- Add proper invocation info handling for tessellation and fragment stages - Return patch vertices info shifted by 16 bits for tessellation stages - Return sample mask shifted by 16 bits for fragment stage - Return standard format (0x00ff0000) for compute and other stages - Implement consistently across SPIRV, GLSL, and GLASM backends - Remove stubbed warning message
Diffstat (limited to 'src/shader_recompiler/backend/spirv')
-rw-r--r--src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp9
1 files changed, 8 insertions, 1 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 feca5105f..64f828107 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
@@ -549,8 +549,15 @@ Id EmitInvocationInfo(EmitContext& ctx) {
case Stage::TessellationEval:
return ctx.OpShiftLeftLogical(ctx.U32[1], ctx.OpLoad(ctx.U32[1], ctx.patch_vertices_in),
ctx.Const(16u));
+ case Stage::Fragment:
+ // Return sample mask in upper 16 bits
+ return ctx.OpShiftLeftLogical(ctx.U32[1], ctx.OpLoad(ctx.U32[1], ctx.sample_mask),
+ ctx.Const(16u));
+ case Stage::Compute:
+ // For compute shaders, return standard format since we can't access workgroup size directly
+ return ctx.Const(0x00ff0000u);
default:
- LOG_WARNING(Shader, "(STUBBED) called");
+ // For other stages, return the standard invocation info format
return ctx.Const(0x00ff0000u);
}
}