diff options
author | Dave Airlie <[email protected]> | 2013-10-14 12:18:53 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2013-10-17 08:35:42 +0100 |
commit | 038a9aab33070b9ff48bb082dd1c731d89e2f9b4 (patch) | |
tree | f153a6e7a89eb626179d70ace8c8ba700f4508c3 | |
parent | 20cad7fd6f6cbd8fc330c7bc54e8e1c62ae5f431 (diff) |
st/mesa: add geometry shader ubo support
This just adds the missing bits so the ubo tests don't crash.
Signed-off-by: Dave Airlie <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
-rw-r--r-- | src/mesa/state_tracker/st_atom.c | 1 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_atom.h | 1 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_atom_constbuf.c | 17 |
3 files changed, 19 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_atom.c b/src/mesa/state_tracker/st_atom.c index 1abaf8f3e91..682073ed62b 100644 --- a/src/mesa/state_tracker/st_atom.c +++ b/src/mesa/state_tracker/st_atom.c @@ -66,6 +66,7 @@ static const struct st_tracked_state *atoms[] = &st_update_fs_constants, &st_bind_vs_ubos, &st_bind_fs_ubos, + &st_bind_gs_ubos, &st_update_pixel_transfer, /* this must be done after the vertex program update */ diff --git a/src/mesa/state_tracker/st_atom.h b/src/mesa/state_tracker/st_atom.h index 101a3a6bd9d..ef24face966 100644 --- a/src/mesa/state_tracker/st_atom.h +++ b/src/mesa/state_tracker/st_atom.h @@ -69,6 +69,7 @@ extern const struct st_tracked_state st_update_gs_constants; extern const struct st_tracked_state st_update_vs_constants; extern const struct st_tracked_state st_bind_fs_ubos; extern const struct st_tracked_state st_bind_vs_ubos; +extern const struct st_tracked_state st_bind_gs_ubos; extern const struct st_tracked_state st_update_pixel_transfer; diff --git a/src/mesa/state_tracker/st_atom_constbuf.c b/src/mesa/state_tracker/st_atom_constbuf.c index 723ab561cfd..f3c457625d3 100644 --- a/src/mesa/state_tracker/st_atom_constbuf.c +++ b/src/mesa/state_tracker/st_atom_constbuf.c @@ -254,4 +254,21 @@ const struct st_tracked_state st_bind_fs_ubos = { bind_fs_ubos }; +static void bind_gs_ubos(struct st_context *st) +{ + struct gl_shader_program *prog = st->ctx->Shader.CurrentGeometryProgram; + + if (!prog) + return; + + st_bind_ubos(st, prog->_LinkedShaders[MESA_SHADER_GEOMETRY], PIPE_SHADER_GEOMETRY); +} +const struct st_tracked_state st_bind_gs_ubos = { + "st_bind_gs_ubos", + { + 0, + ST_NEW_GEOMETRY_PROGRAM | ST_NEW_UNIFORM_BUFFER, + }, + bind_gs_ubos +}; |