video_core, shader_recompiler: Improve Princess Peach: Showtime! support and performance

1. Add geometry shader support for Princess Peach: Showtime!:
   - Implement proper EmitInvocationInfo handling for geometry shaders
   - Support input topology vertex counting in all shader backends (GLASM, GLSL, SPIRV)

2. Performance optimizations:
   - Replace InputTopologyVertices switch statement with a constexpr lookup table
   - Pre-calculate vertex counts and shifts to reduce register pressure
   - Eliminate redundant calculations in shader backends

Signed-off-by: Zephyron <zephyron@citron-emu.org>
This commit is contained in:
Zephyron
2025-05-11 16:28:25 +10:00
parent 9bb2b769a4
commit 2e6bcc9ea6
4 changed files with 34 additions and 0 deletions

View File

@@ -549,6 +549,11 @@ 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::Geometry: {
// Pre-calculate the shifted value for better performance
const u32 shifted_value = InputTopologyVertices::vertices(ctx.runtime_info.input_topology) << 16;
return ctx.Const(shifted_value);
}
default:
LOG_WARNING(Shader, "(STUBBED) called");
return ctx.Const(0x00ff0000u);