diff options
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_atom_constbuf.c | 9 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_cb_bufferobjects.c | 4 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_context.c | 1 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_context.h | 1 |
4 files changed, 9 insertions, 6 deletions
diff --git a/src/mesa/state_tracker/st_atom_constbuf.c b/src/mesa/state_tracker/st_atom_constbuf.c index ed69166f6b5..ef208bc36fa 100644 --- a/src/mesa/state_tracker/st_atom_constbuf.c +++ b/src/mesa/state_tracker/st_atom_constbuf.c @@ -217,8 +217,8 @@ static void bind_vs_ubos(struct st_context *st) const struct st_tracked_state st_bind_vs_ubos = { "st_bind_vs_ubos", { - (_NEW_PROGRAM | _NEW_BUFFER_OBJECT), - ST_NEW_VERTEX_PROGRAM, + _NEW_PROGRAM, + ST_NEW_VERTEX_PROGRAM | ST_NEW_UNIFORM_BUFFER, }, bind_vs_ubos }; @@ -231,14 +231,13 @@ static void bind_fs_ubos(struct st_context *st) return; st_bind_ubos(st, prog->_LinkedShaders[MESA_SHADER_FRAGMENT], PIPE_SHADER_FRAGMENT); - } const struct st_tracked_state st_bind_fs_ubos = { "st_bind_fs_ubos", { - (_NEW_PROGRAM | _NEW_BUFFER_OBJECT), - ST_NEW_FRAGMENT_PROGRAM, + _NEW_PROGRAM, + ST_NEW_FRAGMENT_PROGRAM | ST_NEW_UNIFORM_BUFFER, }, bind_fs_ubos }; diff --git a/src/mesa/state_tracker/st_cb_bufferobjects.c b/src/mesa/state_tracker/st_cb_bufferobjects.c index 8ff32c84291..d166fe64414 100644 --- a/src/mesa/state_tracker/st_cb_bufferobjects.c +++ b/src/mesa/state_tracker/st_cb_bufferobjects.c @@ -247,9 +247,11 @@ st_bufferobj_data(struct gl_context *ctx, if (data) pipe_buffer_write(pipe, st_obj->buffer, 0, size, data); - return GL_TRUE; } + /* BufferData may change a uniform buffer, need to update it */ + st->dirty.st |= ST_NEW_UNIFORM_BUFFER; + return GL_TRUE; } diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index 25e895b4a9d..dccf87bc326 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -209,6 +209,7 @@ static void st_init_driver_flags(struct gl_driver_flags *f) { f->NewArray = ST_NEW_VERTEX_ARRAYS; f->NewRasterizerDiscard = ST_NEW_RASTERIZER; + f->NewUniformBuffer = ST_NEW_UNIFORM_BUFFER; } struct st_context *st_create_context(gl_api api, struct pipe_context *pipe, diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h index 451217ff69e..ab89b49473c 100644 --- a/src/mesa/state_tracker/st_context.h +++ b/src/mesa/state_tracker/st_context.h @@ -51,6 +51,7 @@ struct u_upload_mgr; #define ST_NEW_GEOMETRY_PROGRAM (1 << 5) #define ST_NEW_VERTEX_ARRAYS (1 << 6) #define ST_NEW_RASTERIZER (1 << 7) +#define ST_NEW_UNIFORM_BUFFER (1 << 8) struct st_state_flags { |