mirror of https://github.com/xemu-project/xemu.git
nv2a: Update VSH constants only if different
This commit is contained in:
parent
93a29154e3
commit
9ab3dcbd6c
|
@ -3575,9 +3575,14 @@ static void pgraph_shader_update_constants(PGRAPHState *pg,
|
|||
if (!pg->vsh_constants_dirty[i] && !binding_changed) continue;
|
||||
|
||||
GLint loc = binding->vsh_constant_loc[i];
|
||||
if (loc != -1) {
|
||||
glUniform4fv(loc, 1, (const GLfloat*)pg->vsh_constants[i]);
|
||||
if ((loc != -1) &&
|
||||
memcmp(binding->vsh_constants[i], pg->vsh_constants[i],
|
||||
sizeof(pg->vsh_constants[1]))) {
|
||||
glUniform4fv(loc, 1, (const GLfloat *)pg->vsh_constants[i]);
|
||||
memcpy(binding->vsh_constants[i], pg->vsh_constants[i],
|
||||
sizeof(pg->vsh_constants[i]));
|
||||
}
|
||||
|
||||
pg->vsh_constants_dirty[i] = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -105,6 +105,7 @@ typedef struct ShaderBinding {
|
|||
GLint clip_range_loc;
|
||||
|
||||
GLint vsh_constant_loc[NV2A_VERTEXSHADER_CONSTANTS];
|
||||
uint32_t vsh_constants[NV2A_VERTEXSHADER_CONSTANTS][4];
|
||||
|
||||
GLint inv_viewport_loc;
|
||||
GLint ltctxa_loc[NV2A_LTCTXA_COUNT];
|
||||
|
|
Loading…
Reference in New Issue