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

@@ -30,6 +30,22 @@ enum class InputTopology {
TrianglesAdjacency,
};
namespace InputTopologyVertices {
// Lookup table for vertex counts - faster than switch statement
inline constexpr std::array<u32, 5> vertex_counts = {
1, // Points
2, // Lines
4, // LinesAdjacency
3, // Triangles
6, // TrianglesAdjacency
};
// Force compile-time evaluation when possible
inline constexpr u32 vertices(InputTopology input_topology) {
return vertex_counts[static_cast<std::size_t>(input_topology)];
}
}
enum class CompareFunction {
Never,
Less,