freedreno/a4xx: remove fd4_shader_stateobj
authorRob Clark <robdclark@gmail.com>
Fri, 11 May 2018 12:16:37 +0000 (08:16 -0400)
committerRob Clark <robdclark@gmail.com>
Tue, 15 May 2018 12:46:46 +0000 (08:46 -0400)
Extra level of indirection that serves no purpose.

Signed-off-by: Rob Clark <robdclark@gmail.com>
src/gallium/drivers/freedreno/a4xx/fd4_emit.h
src/gallium/drivers/freedreno/a4xx/fd4_program.c
src/gallium/drivers/freedreno/a4xx/fd4_program.h

index a724caedc2980bed56bb099bcabb30c0ea09d704..73bf199300f2d4d33e1f4796c13d6f722c8e96fb 100644 (file)
@@ -71,8 +71,8 @@ static inline const struct ir3_shader_variant *
 fd4_emit_get_vp(struct fd4_emit *emit)
 {
        if (!emit->vp) {
-               struct fd4_shader_stateobj *so = emit->prog->vp;
-               emit->vp = ir3_shader_variant(so->shader, emit->key, emit->debug);
+               struct ir3_shader *shader = emit->prog->vp;
+               emit->vp = ir3_shader_variant(shader, emit->key, emit->debug);
        }
        return emit->vp;
 }
@@ -86,8 +86,8 @@ fd4_emit_get_fp(struct fd4_emit *emit)
                        static const struct ir3_shader_variant binning_fp = {};
                        emit->fp = &binning_fp;
                } else {
-                       struct fd4_shader_stateobj *so = emit->prog->fp;
-                       emit->fp = ir3_shader_variant(so->shader, emit->key, emit->debug);
+                       struct ir3_shader *shader = emit->prog->fp;
+                       emit->fp = ir3_shader_variant(shader, emit->key, emit->debug);
                }
        }
        return emit->fp;
index 05b0c4f9ae0e38ae9a4779ee9a48f63e20a9d02e..7c399d99a1f5eaac140cfec2974ef50ffd64b6b6 100644 (file)
 #include "fd4_texture.h"
 #include "fd4_format.h"
 
-static void
-delete_shader_stateobj(struct fd4_shader_stateobj *so)
-{
-       ir3_shader_destroy(so->shader);
-       free(so);
-}
-
-static struct fd4_shader_stateobj *
+static struct ir3_shader *
 create_shader_stateobj(struct pipe_context *pctx, const struct pipe_shader_state *cso,
                enum shader_t type)
 {
        struct fd_context *ctx = fd_context(pctx);
        struct ir3_compiler *compiler = ctx->screen->compiler;
-       struct fd4_shader_stateobj *so = CALLOC_STRUCT(fd4_shader_stateobj);
-       so->shader = ir3_shader_create(compiler, cso, type, &ctx->debug);
-       return so;
+       return ir3_shader_create(compiler, cso, type, &ctx->debug);
 }
 
 static void *
@@ -67,8 +58,8 @@ fd4_fp_state_create(struct pipe_context *pctx,
 static void
 fd4_fp_state_delete(struct pipe_context *pctx, void *hwcso)
 {
-       struct fd4_shader_stateobj *so = hwcso;
-       delete_shader_stateobj(so);
+       struct ir3_shader *so = hwcso;
+       ir3_shader_destroy(so);
 }
 
 static void *
@@ -81,8 +72,8 @@ fd4_vp_state_create(struct pipe_context *pctx,
 static void
 fd4_vp_state_delete(struct pipe_context *pctx, void *hwcso)
 {
-       struct fd4_shader_stateobj *so = hwcso;
-       delete_shader_stateobj(so);
+       struct ir3_shader *so = hwcso;
+       ir3_shader_destroy(so);
 }
 
 static void
index 8dfccaf9d740a9885cfab66b7ec76f256ad23a9c..5d8eb55247522982a25d9adc1e4adba4196edbd1 100644 (file)
 #include "freedreno_context.h"
 #include "ir3_shader.h"
 
-struct fd4_shader_stateobj {
-       struct ir3_shader *shader;
-};
-
 struct fd4_emit;
 
 void fd4_program_emit(struct fd_ringbuffer *ring, struct fd4_emit *emit,