From: Brian Date: Fri, 21 Mar 2008 21:54:27 +0000 (-0600) Subject: gallium: fix const buffer update bug X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fb1f4e207d9becca4a83d4934ff6aebf8270e51a;p=mesa.git gallium: fix const buffer update bug If only glUniform is called between two renderings, the const buffers weren't getting updated. Need to set the _NEW_PROGRAM flag in st_upload_constants() as that's the dirty flag set by glUniform. Fixes glean tapi2 test. --- diff --git a/src/mesa/state_tracker/st_atom_constbuf.c b/src/mesa/state_tracker/st_atom_constbuf.c index 21416da2e01..cd7372902b8 100644 --- a/src/mesa/state_tracker/st_atom_constbuf.c +++ b/src/mesa/state_tracker/st_atom_constbuf.c @@ -66,7 +66,8 @@ void st_upload_constants( struct st_context *st, /* Update our own dependency flags. This works because this * function will also be called whenever the program changes. */ - st->constants.tracked_state[id].dirty.mesa = params->StateFlags; + st->constants.tracked_state[id].dirty.mesa = + (params->StateFlags | _NEW_PROGRAM); _mesa_load_state_parameters(st->ctx, params); @@ -115,7 +116,7 @@ static void update_vs_constants(struct st_context *st ) const struct st_tracked_state st_update_vs_constants = { .name = "st_update_vs_constants", .dirty = { - .mesa = 0, + .mesa = 0, /* set dynamically above */ .st = ST_NEW_VERTEX_PROGRAM, }, .update = update_vs_constants @@ -134,7 +135,7 @@ static void update_fs_constants(struct st_context *st ) const struct st_tracked_state st_update_fs_constants = { .name = "st_update_fs_constants", .dirty = { - .mesa = 0, + .mesa = 0, /* set dynamically above */ .st = ST_NEW_FRAGMENT_PROGRAM, }, .update = update_fs_constants