st/mesa: add geometry shader ubo support
authorDave Airlie <airlied@gmail.com>
Mon, 14 Oct 2013 02:18:53 +0000 (12:18 +1000)
committerDave Airlie <airlied@redhat.com>
Thu, 17 Oct 2013 07:35:42 +0000 (08:35 +0100)
This just adds the missing bits so the ubo tests don't crash.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/state_tracker/st_atom.c
src/mesa/state_tracker/st_atom.h
src/mesa/state_tracker/st_atom_constbuf.c

index 1abaf8f3e9103a2b2091402c4d24637cd36a4148..682073ed62b8122acf45c0dd33a1816dd8c3fd0a 100644 (file)
@@ -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 */
index 101a3a6bd9dc7b91e4d637fd0c0b772bfdde147a..ef24face966071ad066e1a78af2ab591b67f3416 100644 (file)
@@ -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;
 
 
index 723ab561cfd928e9688922bf37dc4ee2cb9af9a9..f3c457625d3f28d0a6811b1607988c8699c1cdc1 100644 (file)
@@ -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
+};