From c783cd2aaf102a006782be64f6a6da3476382eeb Mon Sep 17 00:00:00 2001 From: Stenzek Date: Thu, 20 Jul 2017 13:52:23 +1000 Subject: GeometryShaderGen: Add UID enumeration functions --- Source/Core/VideoCommon/GeometryShaderGen.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'Source/Core/VideoCommon/GeometryShaderGen.cpp') diff --git a/Source/Core/VideoCommon/GeometryShaderGen.cpp b/Source/Core/VideoCommon/GeometryShaderGen.cpp index bb201ddb0f..4b06c0f7f3 100644 --- a/Source/Core/VideoCommon/GeometryShaderGen.cpp +++ b/Source/Core/VideoCommon/GeometryShaderGen.cpp @@ -364,3 +364,23 @@ static void EndPrimitive(ShaderCode& out, const ShaderHostConfig& host_config, else out.Write("\toutput.RestartStrip();\n"); } + +void EnumerateGeometryShaderUids(const std::function& callback) +{ + GeometryShaderUid uid; + std::memset(&uid, 0, sizeof(uid)); + + static constexpr std::array primitive_lut = { + {PRIMITIVE_TRIANGLES, PRIMITIVE_LINES, PRIMITIVE_POINTS}}; + for (u32 primitive : primitive_lut) + { + auto* guid = uid.GetUidData(); + guid->primitive_type = primitive; + + for (u32 texgens = 0; texgens <= 8; texgens++) + { + guid->numTexGens = texgens; + callback(uid); + } + } +} -- cgit v1.2.3