diff options
| author | Jules Blok <jules.blok@gmail.com> | 2014-12-14 21:50:46 +0100 |
|---|---|---|
| committer | Jules Blok <jules.blok@gmail.com> | 2014-12-15 22:47:40 +0100 |
| commit | 887c669c288a8aeb432e9b6e9cd0c781bd14faf5 (patch) | |
| tree | 74cd23642579998c001bfed076e361c0c8e5f910 /Source/Core/VideoCommon/GeometryShaderGen.cpp | |
| parent | 332ba4b2100ec4dcda4b2e83eb5b0e2d21e6abc4 (diff) | |
GeometryShaderGen: Redefine gl_InvocationID so we can use the same variable name in both backends.
Diffstat (limited to 'Source/Core/VideoCommon/GeometryShaderGen.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/GeometryShaderGen.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/Source/Core/VideoCommon/GeometryShaderGen.cpp b/Source/Core/VideoCommon/GeometryShaderGen.cpp index 814ad9c075..d0e9eb7144 100644 --- a/Source/Core/VideoCommon/GeometryShaderGen.cpp +++ b/Source/Core/VideoCommon/GeometryShaderGen.cpp @@ -59,6 +59,9 @@ static inline void GenerateGeometryShader(T& out, u32 primitive_type, API_TYPE A if (ApiType == API_OPENGL) { + if (g_ActiveConfig.backend_info.bSupportsGSInstancing) + out.Write("#define InstanceID gl_InvocationID\n"); + out.Write("centroid in VS_OUTPUT o[3];\n"); out.Write("centroid out VS_OUTPUT vs;\n"); out.Write("flat out int layer;\n"); @@ -91,12 +94,7 @@ static inline void GenerateGeometryShader(T& out, u32 primitive_type, API_TYPE A // If the GPU supports invocation we don't need a for loop and can simply use the // invocation identifier to determine which layer we're rendering. if (g_ActiveConfig.backend_info.bSupportsGSInstancing) - { - if (ApiType == API_OPENGL) - out.Write("\tint eye = gl_InvocationID;\n"); - else - out.Write("\tint eye = InstanceID;\n"); - } + out.Write("\tint eye = InstanceID;\n"); else out.Write("\tfor (int eye = 0; eye < %d; ++eye) {\n", g_ActiveConfig.iStereoMode > 0 ? 2 : 1); |
