mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-11 16:49:12 +01:00
If user doesn't compile with glew 1.6, cut out program binaries so everything still compiles.
This commit is contained in:
parent
9bc6b83fd0
commit
b90fa37c60
@ -137,9 +137,10 @@ namespace OGL
|
|||||||
glAttachShader(entry.program.glprogid, entry.program.vsid);
|
glAttachShader(entry.program.glprogid, entry.program.vsid);
|
||||||
|
|
||||||
glAttachShader(entry.program.glprogid, entry.program.psid);
|
glAttachShader(entry.program.glprogid, entry.program.psid);
|
||||||
|
#ifdef GLEW_VERSION_4_0
|
||||||
if (g_ActiveConfig.backend_info.bSupportsGLSLCache)
|
if (g_ActiveConfig.backend_info.bSupportsGLSLCache)
|
||||||
glProgramParameteri(entry.program.glprogid, GL_PROGRAM_BINARY_RETRIEVABLE_HINT, GL_TRUE);
|
glProgramParameteri(entry.program.glprogid, GL_PROGRAM_BINARY_RETRIEVABLE_HINT, GL_TRUE);
|
||||||
|
#endif
|
||||||
|
|
||||||
glLinkProgram(entry.program.glprogid);
|
glLinkProgram(entry.program.glprogid);
|
||||||
|
|
||||||
@ -201,7 +202,7 @@ namespace OGL
|
|||||||
glBindBufferRange(GL_UNIFORM_BUFFER, 1, s_ps_vs_ubo, 0, ps_data_size);
|
glBindBufferRange(GL_UNIFORM_BUFFER, 1, s_ps_vs_ubo, 0, ps_data_size);
|
||||||
glBindBufferRange(GL_UNIFORM_BUFFER, 2, s_ps_vs_ubo, s_vs_data_offset, vs_data_size);
|
glBindBufferRange(GL_UNIFORM_BUFFER, 2, s_ps_vs_ubo, s_vs_data_offset, vs_data_size);
|
||||||
}
|
}
|
||||||
|
#ifdef GLEW_VERSION_4_0
|
||||||
// Read our shader cache, only if supported
|
// Read our shader cache, only if supported
|
||||||
if (g_ActiveConfig.backend_info.bSupportsGLSLCache)
|
if (g_ActiveConfig.backend_info.bSupportsGLSLCache)
|
||||||
{
|
{
|
||||||
@ -218,6 +219,7 @@ namespace OGL
|
|||||||
glGetIntegerv(GL_PROGRAM_BINARY_FORMATS, Formats);
|
glGetIntegerv(GL_PROGRAM_BINARY_FORMATS, Formats);
|
||||||
ProgramFormat = (GLenum)Formats[0]; // We don't really care about format
|
ProgramFormat = (GLenum)Formats[0]; // We don't really care about format
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProgramShaderCache::Shutdown(void)
|
void ProgramShaderCache::Shutdown(void)
|
||||||
|
@ -79,16 +79,24 @@ struct PROGRAMSHADER
|
|||||||
GLint binaryLength;
|
GLint binaryLength;
|
||||||
u8 *Data()
|
u8 *Data()
|
||||||
{
|
{
|
||||||
|
#ifdef GLEW_VERSION_4_0
|
||||||
glGetProgramiv(glprogid, GL_PROGRAM_BINARY_LENGTH, &binaryLength);
|
glGetProgramiv(glprogid, GL_PROGRAM_BINARY_LENGTH, &binaryLength);
|
||||||
u8* binary = (u8*)malloc(binaryLength);
|
u8* binary = (u8*)malloc(binaryLength);
|
||||||
glGetProgramBinary(glprogid, binaryLength, NULL, &ProgramFormat, binary);
|
glGetProgramBinary(glprogid, binaryLength, NULL, &ProgramFormat, binary);
|
||||||
return binary;
|
return binary;
|
||||||
|
#else
|
||||||
|
return NULL;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
GLint Size()
|
GLint Size()
|
||||||
{
|
{
|
||||||
|
#ifdef GLEW_VERSION_4_0
|
||||||
if(!binaryLength)
|
if(!binaryLength)
|
||||||
glGetProgramiv(glprogid, GL_PROGRAM_BINARY_LENGTH, &binaryLength);
|
glGetProgramiv(glprogid, GL_PROGRAM_BINARY_LENGTH, &binaryLength);
|
||||||
return binaryLength;
|
return binaryLength;
|
||||||
|
#else
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -119,6 +127,7 @@ class ProgramShaderCache
|
|||||||
public:
|
public:
|
||||||
void Read(const PROGRAMUID &key, const u8 *value, u32 value_size)
|
void Read(const PROGRAMUID &key, const u8 *value, u32 value_size)
|
||||||
{
|
{
|
||||||
|
#ifdef GLEW_VERSION_4_0
|
||||||
PCacheEntry entry;
|
PCacheEntry entry;
|
||||||
|
|
||||||
// The two shaders might not even exist anymore
|
// The two shaders might not even exist anymore
|
||||||
@ -139,6 +148,7 @@ class ProgramShaderCache
|
|||||||
glUseProgram(entry.program.glprogid);
|
glUseProgram(entry.program.glprogid);
|
||||||
SetProgramVariables(entry, key);
|
SetProgramVariables(entry, key);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user