X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fstate_tracker%2Fst_atom_constbuf.c;h=f1d08a3e1665e5cdb118eec3c6828193a686e971;hb=b830b62a47dec70640062c488cbebd2c8ac487f9;hp=6f9d71e845b2909ba6b36bc9e76e4414812da1ae;hpb=da7bd6a90e1fee5c16327338fd251c0f6be34e36;p=mesa.git diff --git a/src/mesa/state_tracker/st_atom_constbuf.c b/src/mesa/state_tracker/st_atom_constbuf.c index 6f9d71e845b..f1d08a3e166 100644 --- a/src/mesa/state_tracker/st_atom_constbuf.c +++ b/src/mesa/state_tracker/st_atom_constbuf.c @@ -66,6 +66,11 @@ void st_upload_constants( struct st_context *st, if (params && params->NumParameters) { const uint paramBytes = params->NumParameters * sizeof(GLfloat) * 4; + /* Update the constants which come from fixed-function state, such as + * transformation matrices, fog factors, etc. The rest of the values in + * the parameters list are explicitly set by the user with glUniform, + * glProgramParameter(), etc. + */ _mesa_load_state_parameters(st->ctx, params); /* We always need to get a new buffer, to keep the drivers simple and @@ -90,8 +95,11 @@ void st_upload_constants( struct st_context *st, st->pipe->set_constant_buffer(st->pipe, shader_type, 0, *cbuf); } - else { + else if (*cbuf) { st->constants.tracked_state[shader_type].dirty.mesa = 0x0; + + pipe_resource_reference(cbuf, NULL); + st->pipe->set_constant_buffer(st->pipe, shader_type, 0, NULL); } }