[PATCH 7/7] wined3d: Don't use the builtin FFP uniform for the modelview matrix.

Matteo Bruni matteo.mystral at gmail.com
Wed Mar 18 07:46:20 CDT 2015

2015-03-17 22:55 GMT+01:00 Stefan Dösinger <stefandoesinger at gmail.com>:
> On a somewhat related subject, I think we should check at some point
> that the state linking still works as intended and doesn't accidentally
> merge everything together into one huge state that's always updated.

It seems to be still working at the moment, I had multiple instances
of forgetting to add some state dirtification and some tests failing
as a consequence. Clearly that doesn't count as a thorough check

> Am 2015-03-17 um 15:52 schrieb Matteo Bruni:
>> @@ -775,6 +777,15 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
>>          checkGLcall("glUniform4fv");
>>      }
>> +    if (update_mask & WINED3D_SHADER_CONST_FFP_MODELVIEW)
>> +    {
>> +        struct wined3d_matrix mat;
>> +
>> +        get_modelview_matrix(context, state, &mat);
>> +        GL_EXTCALL(glUniformMatrix4fv(prog->vs.modelview_matrix_location, 1, FALSE, (GLfloat *)&mat));
>> +        checkGLcall("glUniformMatrix4fv");
>> +    }
>> +
>>      if (update_mask & WINED3D_SHADER_CONST_PS_F)
>>          shader_glsl_load_constantsF(pshader, gl_info, state->ps_consts_f,
>>                  prog->ps.uniform_f_locations, &priv->pconst_heap, priv->stack, constant_version);
> Is it a good idea to put this in shader_glsl_load_constants? It may make
> sense to split fixed function and shader constants into separate
> functions. We'll never need shader constants and the modelview matrix in
> the same program.

There are a few uniforms which are going to be "shared" between fixed
function and programmable pipeline (from a quick look I see clipplanes
emulation, position fixup, fog emulation, alpha test) so at least part
of the function would probably stay in a common helper. At that point
I'm not sure the separation would help a lot.

I'm going to try to split this patch up in more digestible chunks and resend.

More information about the wine-devel mailing list