vc4: Drop pointless shader state struct
authorEric Anholt <eric@anholt.net>
Fri, 18 Jul 2014 20:28:34 +0000 (13:28 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 11 Aug 2014 21:40:45 +0000 (14:40 -0700)
src/gallium/drivers/vc4/vc4_context.h
src/gallium/drivers/vc4/vc4_program.c

index 18e6264b0b6884be78b9703c06f5f3392e96586d..c125d1b0c5dffe9330ce8e5d0215dfc7cc44d524 100644 (file)
@@ -70,10 +70,6 @@ struct vc4_shader_uniform_info {
         uint32_t count;
 };
 
-struct vc4_shader_state {
-        struct pipe_shader_state base;
-};
-
 struct vc4_compiled_shader {
         struct vc4_bo *bo;
 
@@ -84,7 +80,7 @@ struct vc4_compiled_shader {
 };
 
 struct vc4_program_stateobj {
-        struct vc4_shader_state *bind_vs, *bind_fs;
+        struct pipe_shader_state *bind_vs, *bind_fs;
         struct vc4_compiled_shader *vs, *fs;
         uint32_t dirty;
         uint8_t num_exports;
index a85a0b4d293cabffd18ad01a15623e71343fa3c8..15e1ff25b04d7842a2bfca3fa4f38c3217737bbb 100644 (file)
@@ -49,7 +49,7 @@ struct tgsi_to_qir {
         struct qreg *consts;
         uint32_t num_consts;
 
-        struct vc4_shader_state *shader_state;
+        struct pipe_shader_state *shader_state;
         struct vc4_fs_key *fs_key;
         struct vc4_vs_key *vs_key;
 
@@ -60,7 +60,7 @@ struct tgsi_to_qir {
 };
 
 struct vc4_key {
-        struct vc4_shader_state *shader_state;
+        struct pipe_shader_state *shader_state;
 };
 
 struct vc4_fs_key {
@@ -836,12 +836,12 @@ vc4_shader_tgsi_to_qir(struct vc4_compiled_shader *shader, enum qstage stage,
 
         trans->shader_state = key->shader_state;
         trans->c = c;
-        ret = tgsi_parse_init(&trans->parser, trans->shader_state->base.tokens);
+        ret = tgsi_parse_init(&trans->parser, trans->shader_state->tokens);
         assert(ret == TGSI_PARSE_OK);
 
         if (vc4_debug & VC4_DEBUG_TGSI) {
                 fprintf(stderr, "TGSI:\n");
-                tgsi_dump(trans->shader_state->base.tokens, 0);
+                tgsi_dump(trans->shader_state->tokens, 0);
         }
 
         switch (stage) {
@@ -914,11 +914,11 @@ static void *
 vc4_shader_state_create(struct pipe_context *pctx,
                         const struct pipe_shader_state *cso)
 {
-        struct vc4_shader_state *so = CALLOC_STRUCT(vc4_shader_state);
+        struct pipe_shader_state *so = CALLOC_STRUCT(pipe_shader_state);
         if (!so)
                 return NULL;
 
-        so->base.tokens = tgsi_dup_tokens(cso->tokens);
+        so->tokens = tgsi_dup_tokens(cso->tokens);
 
         return so;
 }
@@ -1071,7 +1071,7 @@ vs_cache_compare(void *key1, void *key2)
 
 struct delete_state {
         struct vc4_context *vc4;
-        struct vc4_shader_state *shader_state;
+        struct pipe_shader_state *shader_state;
 };
 
 static enum pipe_error
@@ -1110,7 +1110,7 @@ static void
 vc4_shader_state_delete(struct pipe_context *pctx, void *hwcso)
 {
         struct vc4_context *vc4 = vc4_context(pctx);
-        struct vc4_shader_state *so = hwcso;
+        struct pipe_shader_state *so = hwcso;
         struct delete_state del;
 
         del.vc4 = vc4;
@@ -1118,7 +1118,7 @@ vc4_shader_state_delete(struct pipe_context *pctx, void *hwcso)
         util_hash_table_foreach(vc4->fs_cache, fs_delete_from_cache, &del);
         util_hash_table_foreach(vc4->vs_cache, vs_delete_from_cache, &del);
 
-        free((void *)so->base.tokens);
+        free((void *)so->tokens);
         free(so);
 }