Commit aeb0e43e authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

wined3d: Hardcode local constants in ARB shaders if possible.

parent 107e80a7
......@@ -780,17 +780,6 @@ static void shader_glsl_gen_modifier (
}
}
static BOOL constant_is_local(IWineD3DBaseShaderImpl* This, DWORD reg) {
local_constant* lconst;
if(This->baseShader.load_local_constsF) return FALSE;
LIST_FOR_EACH_ENTRY(lconst, &This->baseShader.constantsF, local_constant, entry) {
if(lconst->idx == reg) return TRUE;
}
return FALSE;
}
/** Writes the GLSL variable name that corresponds to the register that the
* DX opcode parameter is trying to access */
static void shader_glsl_get_register_name(
......@@ -877,7 +866,7 @@ static void shader_glsl_get_register_name(
}
} else {
if(constant_is_local(This, reg)) {
if(shader_constant_is_local(This, reg)) {
sprintf(tmpStr, "LC%u", reg);
} else {
sprintf(tmpStr, "%s[%u]", prefix, reg);
......
......@@ -2178,6 +2178,17 @@ static inline BOOL shader_is_scalar(DWORD param) {
}
}
static inline BOOL shader_constant_is_local(IWineD3DBaseShaderImpl* This, DWORD reg) {
local_constant* lconst;
if(This->baseShader.load_local_constsF) return FALSE;
LIST_FOR_EACH_ENTRY(lconst, &This->baseShader.constantsF, local_constant, entry) {
if(lconst->idx == reg) return TRUE;
}
return FALSE;
}
/* Internally used shader constants. Applications can use constants 0 to GL_LIMITS(vshader_constantsF) - 1,
* so upload them above that
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment