mirror of
https://git.eden-emu.dev/archive/citron
synced 2026-04-05 19:08:36 -04:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user