diff options
| author | Anthony <Helios747@users.noreply.github.com> | 2017-07-30 01:00:16 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-07-30 01:00:16 -0700 |
| commit | ba57605266b9ab178963bf56e146f355d1b93cd4 (patch) | |
| tree | 0ddc89cfca6db3d343d317c18b7c07c9ab83e9c4 /Source/Core/VideoCommon/GeometryShaderGen.cpp | |
| parent | 5bad2ee4a4129e734ff4f4d861cedc4cd573df55 (diff) | |
| parent | b154edb4fbdb327920a33b44f35f34cdf2636d6f (diff) | |
Merge pull request #5702 from stenzek/ubershaders
Ubershaders 2.0
Diffstat (limited to 'Source/Core/VideoCommon/GeometryShaderGen.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/GeometryShaderGen.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
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<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); + } + } +} |
