-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi
I've given this only a very quick look. My first impression is that a few things can be split out into separate patches, e.g. get_modelview_matrix. That's a fairly minor thing though.
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.
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.
2015-03-17 22:55 GMT+01:00 Stefan Dösinger stefandoesinger@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 though.
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.