mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-25 15:31:17 +01:00
remove texture sampler from uniform list
This commit is contained in:
parent
2c010f530e
commit
6401a18143
@ -37,8 +37,6 @@ GLuint ProgramShaderCache::PCacheEntry::prog_format = 0;
|
||||
std::pair<u32, u32> ProgramShaderCache::CurrentShaderProgram;
|
||||
const char *UniformNames[NUM_UNIFORMS] =
|
||||
{
|
||||
// SAMPLERS
|
||||
"samp0","samp1","samp2","samp3","samp4","samp5","samp6","samp7",
|
||||
// PIXEL SHADER UNIFORMS
|
||||
I_COLORS,
|
||||
I_KCOLORS,
|
||||
@ -84,16 +82,19 @@ void ProgramShaderCache::SetProgramVariables(PCacheEntry &entry)
|
||||
//glGetUniformIndices(entry.prog_id, NUM_UNIFORMS, UniformNames, entry.UniformLocations);
|
||||
// Got to do it this crappy way.
|
||||
if (!g_ActiveConfig.backend_info.bSupportsGLSLUBO)
|
||||
for (int a = 8; a < NUM_UNIFORMS; ++a)
|
||||
for (int a = 0; a < NUM_UNIFORMS; ++a)
|
||||
entry.UniformLocations[a] = glGetUniformLocation(entry.prog_id, UniformNames[a]);
|
||||
|
||||
// Bind Texture Sampler
|
||||
for (int a = 0; a < 8; ++a)
|
||||
{
|
||||
char name[8];
|
||||
snprintf(name, 8, "samp%d", a);
|
||||
|
||||
// Still need to get sampler locations since we aren't binding them statically in the shaders
|
||||
entry.UniformLocations[a] = glGetUniformLocation(entry.prog_id, UniformNames[a]);
|
||||
if (entry.UniformLocations[a] != -1)
|
||||
glUniform1i(entry.UniformLocations[a], a);
|
||||
int loc = glGetUniformLocation(entry.prog_id, name);
|
||||
if (loc != -1)
|
||||
glUniform1i(loc, a);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -30,7 +30,7 @@
|
||||
namespace OGL
|
||||
{
|
||||
|
||||
const int NUM_UNIFORMS = 27;
|
||||
const int NUM_UNIFORMS = 19;
|
||||
extern const char *UniformNames[NUM_UNIFORMS];
|
||||
|
||||
class ProgramShaderCache
|
||||
|
Loading…
x
Reference in New Issue
Block a user