mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
GeometryShaderGen: Add UID enumeration functions
This commit is contained in:
@ -364,3 +364,23 @@ static void EndPrimitive(ShaderCode& out, const ShaderHostConfig& host_config,
|
||||
else
|
||||
out.Write("\toutput.RestartStrip();\n");
|
||||
}
|
||||
|
||||
void EnumerateGeometryShaderUids(const std::function<void(const GeometryShaderUid&)>& callback)
|
||||
{
|
||||
GeometryShaderUid uid;
|
||||
std::memset(&uid, 0, sizeof(uid));
|
||||
|
||||
static constexpr std::array<u32, 3> primitive_lut = {
|
||||
{PRIMITIVE_TRIANGLES, PRIMITIVE_LINES, PRIMITIVE_POINTS}};
|
||||
for (u32 primitive : primitive_lut)
|
||||
{
|
||||
auto* guid = uid.GetUidData<geometry_shader_uid_data>();
|
||||
guid->primitive_type = primitive;
|
||||
|
||||
for (u32 texgens = 0; texgens <= 8; texgens++)
|
||||
{
|
||||
guid->numTexGens = texgens;
|
||||
callback(uid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user