mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
OpenGL: drop UBO-workaround usage for efb2ram shaders
It's just brainfuck to use this workaroung there. Just fetch the uniform location like all other util shaders.
This commit is contained in:
@ -108,15 +108,14 @@ void SHADER::SetProgramVariables()
|
||||
}
|
||||
|
||||
// UBO workaround
|
||||
for (int a = 0; a < NUM_UNIFORMS; ++a)
|
||||
{
|
||||
UniformLocations[a] = glGetUniformLocation(glprogid, UniformNames[a]);
|
||||
UniformSize[a] = 0;
|
||||
if(g_ActiveConfig.backend_info.bSupportsGLSLUBO)
|
||||
break;
|
||||
}
|
||||
if(!g_ActiveConfig.backend_info.bSupportsGLSLUBO)
|
||||
{
|
||||
for (int a = 0; a < NUM_UNIFORMS; ++a)
|
||||
{
|
||||
UniformLocations[a] = glGetUniformLocation(glprogid, UniformNames[a]);
|
||||
UniformSize[a] = 0;
|
||||
}
|
||||
|
||||
int max_uniforms = 0;
|
||||
char name[50];
|
||||
int size;
|
||||
|
@ -40,6 +40,7 @@ static SHADER s_yuyvToRgbProgram;
|
||||
// Not all slots are taken - but who cares.
|
||||
const u32 NUM_ENCODING_PROGRAMS = 64;
|
||||
static SHADER s_encodingPrograms[NUM_ENCODING_PROGRAMS];
|
||||
static int s_encodingUniforms[NUM_ENCODING_PROGRAMS];
|
||||
|
||||
static GLuint s_PBO = 0; // for readback with different strides
|
||||
|
||||
@ -156,6 +157,8 @@ SHADER &GetOrCreateEncodingShader(u32 format)
|
||||
"}\n";
|
||||
|
||||
ProgramShaderCache::CompileShader(s_encodingPrograms[format], VProgram, shader);
|
||||
|
||||
s_encodingUniforms[format] = glGetUniformLocation(s_encodingPrograms[format].glprogid, "position");
|
||||
}
|
||||
return s_encodingPrograms[format];
|
||||
}
|
||||
@ -312,7 +315,7 @@ int EncodeToRamFromTexture(u32 address,GLuint source_texture, bool bFromZBuffer,
|
||||
s32 expandedHeight = (height + blkH) & (~blkH);
|
||||
|
||||
texconv_shader.Bind();
|
||||
glUniform4i(texconv_shader.UniformLocations[0],
|
||||
glUniform4i(s_encodingUniforms[format],
|
||||
source.left, source.top,
|
||||
expandedWidth, bScaleByHalf ? 2 : 1);
|
||||
|
||||
|
Reference in New Issue
Block a user