summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/Src/VertexShaderGen.cpp
diff options
context:
space:
mode:
authorRyan Houdek <Sonicadvance1@gmail.com>2011-12-09 19:14:02 -0600
committerSonicadvance1 <sonicadvance1@RH-Live.(none)>2012-10-09 23:41:05 -0500
commit2fbca145cb9c559fed0be8e57c954e91e803ff8a (patch)
tree0234be5016a8606a7a255b11b381c51f440ea3a6 /Source/Core/VideoCommon/Src/VertexShaderGen.cpp
parent4a84c6f742efb7a450d85791cd39d31ee0968812 (diff)
Remove bSupportsGLSLLocation since it won't work how I expect it.
Diffstat (limited to 'Source/Core/VideoCommon/Src/VertexShaderGen.cpp')
-rw-r--r--Source/Core/VideoCommon/Src/VertexShaderGen.cpp25
1 files changed, 12 insertions, 13 deletions
diff --git a/Source/Core/VideoCommon/Src/VertexShaderGen.cpp b/Source/Core/VideoCommon/Src/VertexShaderGen.cpp
index 13d526ba07..6d3eb239a1 100644
--- a/Source/Core/VideoCommon/Src/VertexShaderGen.cpp
+++ b/Source/Core/VideoCommon/Src/VertexShaderGen.cpp
@@ -165,7 +165,6 @@ char* GenerateVSOutputStruct(char* p, u32 components, API_TYPE ApiType)
extern const char* WriteRegister(API_TYPE ApiType, const char *prefix, const u32 num);
extern const char* WriteBinding(API_TYPE ApiType, const u32 num);
-extern const char* WriteLocation(API_TYPE ApiType, const u32 num);
const char *GenerateVertexShaderCode(u32 components, API_TYPE ApiType)
{
@@ -188,13 +187,13 @@ const char *GenerateVertexShaderCode(u32 components, API_TYPE ApiType)
if(ApiType == API_GLSL)
{
// A few required defines and ones that will make our lives a lot easier
- if (g_ActiveConfig.backend_info.bSupportsGLSLBinding || g_ActiveConfig.backend_info.bSupportsGLSLLocation)
+ if (g_ActiveConfig.backend_info.bSupportsGLSLBinding || g_ActiveConfig.backend_info.bSupportsGLSLUBO)
{
WRITE(p, "#version 330 compatibility\n");
if (g_ActiveConfig.backend_info.bSupportsGLSLBinding)
WRITE(p, "#extension GL_ARB_shading_language_420pack : enable\n");
- if (g_ActiveConfig.backend_info.bSupportsGLSLLocation)
- WRITE(p, "#extension GL_ARB_separate_shader_objects : enable\n");
+ if (g_ActiveConfig.backend_info.bSupportsGLSLUBO)
+ WRITE(p, "#extension GL_ARB_uniform_buffer_object : enable\n");
WRITE(p, "#define ATTRIN in\n");
WRITE(p, "#define ATTROUT out\n");
}
@@ -219,15 +218,15 @@ const char *GenerateVertexShaderCode(u32 components, API_TYPE ApiType)
if(ApiType == API_GLSL && g_ActiveConfig.backend_info.bSupportsGLSLUBO)
WRITE(p, "layout(std140, binding = 1) uniform VSBlock {\n");
- WRITE(p, "%suniform float4 "I_POSNORMALMATRIX"[6] %s;\n", WriteLocation(ApiType, C_POSNORMALMATRIX), WriteRegister(ApiType, "c", C_POSNORMALMATRIX));
- WRITE(p, "%suniform float4 "I_PROJECTION"[4] %s;\n", WriteLocation(ApiType, C_PROJECTION), WriteRegister(ApiType, "c", C_PROJECTION));
- WRITE(p, "%suniform float4 "I_MATERIALS"[4] %s;\n", WriteLocation(ApiType, C_MATERIALS), WriteRegister(ApiType, "c", C_MATERIALS));
- WRITE(p, "%suniform float4 "I_LIGHTS"[40] %s;\n", WriteLocation(ApiType, C_LIGHTS), WriteRegister(ApiType, "c", C_LIGHTS));
- WRITE(p, "%suniform float4 "I_TEXMATRICES"[24] %s;\n", WriteLocation(ApiType, C_TEXMATRICES), WriteRegister(ApiType, "c", C_TEXMATRICES)); // also using tex matrices
- WRITE(p, "%suniform float4 "I_TRANSFORMMATRICES"[64] %s;\n", WriteLocation(ApiType, C_TRANSFORMMATRICES), WriteRegister(ApiType, "c", C_TRANSFORMMATRICES));
- WRITE(p, "%suniform float4 "I_NORMALMATRICES"[32] %s;\n", WriteLocation(ApiType, C_NORMALMATRICES), WriteRegister(ApiType, "c", C_NORMALMATRICES));
- WRITE(p, "%suniform float4 "I_POSTTRANSFORMMATRICES"[64] %s;\n", WriteLocation(ApiType, C_POSTTRANSFORMMATRICES), WriteRegister(ApiType, "c", C_POSTTRANSFORMMATRICES));
- WRITE(p, "%suniform float4 "I_DEPTHPARAMS" %s;\n", WriteLocation(ApiType, C_DEPTHPARAMS), WriteRegister(ApiType, "c", C_DEPTHPARAMS));
+ WRITE(p, "uniform float4 "I_POSNORMALMATRIX"[6] %s;\n", WriteRegister(ApiType, "c", C_POSNORMALMATRIX));
+ WRITE(p, "uniform float4 "I_PROJECTION"[4] %s;\n", WriteRegister(ApiType, "c", C_PROJECTION));
+ WRITE(p, "uniform float4 "I_MATERIALS"[4] %s;\n", WriteRegister(ApiType, "c", C_MATERIALS));
+ WRITE(p, "uniform float4 "I_LIGHTS"[40] %s;\n", WriteRegister(ApiType, "c", C_LIGHTS));
+ WRITE(p, "uniform float4 "I_TEXMATRICES"[24] %s;\n", WriteRegister(ApiType, "c", C_TEXMATRICES)); // also using tex matrices
+ WRITE(p, "uniform float4 "I_TRANSFORMMATRICES"[64] %s;\n", WriteRegister(ApiType, "c", C_TRANSFORMMATRICES));
+ WRITE(p, "uniform float4 "I_NORMALMATRICES"[32] %s;\n", WriteRegister(ApiType, "c", C_NORMALMATRICES));
+ WRITE(p, "uniform float4 "I_POSTTRANSFORMMATRICES"[64] %s;\n", WriteRegister(ApiType, "c", C_POSTTRANSFORMMATRICES));
+ WRITE(p, "uniform float4 "I_DEPTHPARAMS" %s;\n", WriteRegister(ApiType, "c", C_DEPTHPARAMS));
if(ApiType == API_GLSL && g_ActiveConfig.backend_info.bSupportsGLSLUBO)
WRITE(p, "};\n");