i965: add MAYBE_UNUSED to assert param
[mesa.git] / src / mesa / state_tracker / st_atom_storagebuf.c
index f165cc3e0a18b80f58e36d611dec292a103de131..1b6ed99e54a7b938625e1d1b460978734130ead8 100644 (file)
@@ -41,8 +41,8 @@
 #include "st_program.h"
 
 static void
-st_bind_ssbos(struct st_context *st, struct gl_shader *shader,
-              unsigned shader_type)
+st_bind_ssbos(struct st_context *st, struct gl_linked_shader *shader,
+              enum pipe_shader_type shader_type)
 {
    unsigned i;
    struct pipe_shader_buffer buffers[MAX_SHADER_STORAGE_BUFFERS];
@@ -103,11 +103,6 @@ static void bind_vs_ssbos(struct st_context *st)
 }
 
 const struct st_tracked_state st_bind_vs_ssbos = {
-   "st_bind_vs_ssbos",
-   {
-      0,
-      ST_NEW_VERTEX_PROGRAM | ST_NEW_STORAGE_BUFFER,
-   },
    bind_vs_ssbos
 };
 
@@ -124,11 +119,6 @@ static void bind_fs_ssbos(struct st_context *st)
 }
 
 const struct st_tracked_state st_bind_fs_ssbos = {
-   "st_bind_fs_ssbos",
-   {
-      0,
-      ST_NEW_FRAGMENT_PROGRAM | ST_NEW_STORAGE_BUFFER,
-   },
    bind_fs_ssbos
 };
 
@@ -145,11 +135,6 @@ static void bind_gs_ssbos(struct st_context *st)
 }
 
 const struct st_tracked_state st_bind_gs_ssbos = {
-   "st_bind_gs_ssbos",
-   {
-      0,
-      ST_NEW_GEOMETRY_PROGRAM | ST_NEW_STORAGE_BUFFER,
-   },
    bind_gs_ssbos
 };
 
@@ -166,11 +151,6 @@ static void bind_tcs_ssbos(struct st_context *st)
 }
 
 const struct st_tracked_state st_bind_tcs_ssbos = {
-   "st_bind_tcs_ssbos",
-   {
-      0,
-      ST_NEW_TESSCTRL_PROGRAM | ST_NEW_STORAGE_BUFFER,
-   },
    bind_tcs_ssbos
 };
 
@@ -187,10 +167,21 @@ static void bind_tes_ssbos(struct st_context *st)
 }
 
 const struct st_tracked_state st_bind_tes_ssbos = {
-   "st_bind_tes_ssbos",
-   {
-      0,
-      ST_NEW_TESSEVAL_PROGRAM | ST_NEW_STORAGE_BUFFER,
-   },
    bind_tes_ssbos
 };
+
+static void bind_cs_ssbos(struct st_context *st)
+{
+   struct gl_shader_program *prog =
+      st->ctx->_Shader->CurrentProgram[MESA_SHADER_COMPUTE];
+
+   if (!prog)
+      return;
+
+   st_bind_ssbos(st, prog->_LinkedShaders[MESA_SHADER_COMPUTE],
+                 PIPE_SHADER_COMPUTE);
+}
+
+const struct st_tracked_state st_bind_cs_ssbos = {
+   bind_cs_ssbos
+};