2008/12/8 Stefan Dösinger <stefan(a)codeweavers.com>:
+ /* TODO: If we're called by shader_glsl_select, we know that both we get past both checks. + * is it cheaper to have a wrapper function check those? Inline some common code? Extra + * parameter? + */ if (!prog) { /* No GLSL program set - nothing to do. */ return; + } else if(isStateDirty(context, STATE_PIXELSHADER) || + isStateDirty(context, STATE_VDECL) || + isStateDirty(context, STATE_PIXELSHADERCONSTANT) || + isStateDirty(context, STATE_VERTEXSHADERCONSTANT)) { + /* Will be called again later */ + return; If you're going to introduce a dependency on state management in the shader backends anyway, you don't need to export constant loading functions from the shader backends at all. You might as well just call shader_select(), and let that figure out if it needs to change the shader or load any constants. That would also avoid this not-so-pretty code here.