i965: replace brw_compute_program with brw_program
authorTimothy Arceri <timothy.arceri@collabora.com>
Tue, 18 Oct 2016 05:25:08 +0000 (16:25 +1100)
committerTimothy Arceri <timothy.arceri@collabora.com>
Wed, 26 Oct 2016 03:29:36 +0000 (14:29 +1100)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/mesa/drivers/dri/i965/brw_context.h
src/mesa/drivers/dri/i965/brw_cs.c
src/mesa/drivers/dri/i965/brw_program.c
src/mesa/drivers/dri/i965/gen7_cs_state.c

index 48c2066e8a3df7aaf9dbff7f2d6fa2ef5b2bbc0b..5c64c2f271022211b4ef93772676e9261f67ea4d 100644 (file)
@@ -348,13 +348,6 @@ struct gen4_fragment_program {
 };
 
 
-/** Subclass of Mesa compute program */
-struct brw_compute_program {
-   struct gl_program program;
-   unsigned id;  /**< serial no. to identify compute progs, never re-used */
-};
-
-
 struct brw_shader {
    struct gl_linked_shader base;
 
@@ -1683,12 +1676,6 @@ brw_program_const(const struct gl_program *p)
    return (const struct brw_program *) p;
 }
 
-static inline struct brw_compute_program *
-brw_compute_program(struct gl_program *p)
-{
-   return (struct brw_compute_program *) p;
-}
-
 /**
  * Pre-gen6, the register file of the EUs was shared between threads,
  * and each thread used some subset allocated on a 16-register block
index 799a9b433aedb908527ee6920002cb5b9da56f98..d16fff8ffc3dd29e67c117e05af880792c1635dc 100644 (file)
@@ -54,7 +54,7 @@ assign_cs_binding_table_offsets(const struct gen_device_info *devinfo,
 static bool
 brw_codegen_cs_prog(struct brw_context *brw,
                     struct gl_shader_program *prog,
-                    struct brw_compute_program *cp,
+                    struct brw_program *cp,
                     struct brw_cs_prog_key *key)
 {
    const struct gen_device_info *devinfo = &brw->screen->devinfo;
@@ -191,8 +191,7 @@ brw_cs_populate_key(struct brw_context *brw, struct brw_cs_prog_key *key)
 {
    struct gl_context *ctx = &brw->ctx;
    /* BRW_NEW_COMPUTE_PROGRAM */
-   const struct brw_compute_program *cp =
-      (struct brw_compute_program *) brw->compute_program;
+   const struct brw_program *cp = (struct brw_program *) brw->compute_program;
    const struct gl_program *prog = (struct gl_program *) cp;
 
    memset(key, 0, sizeof(*key));
@@ -210,8 +209,7 @@ brw_upload_cs_prog(struct brw_context *brw)
 {
    struct gl_context *ctx = &brw->ctx;
    struct brw_cs_prog_key key;
-   struct brw_compute_program *cp = (struct brw_compute_program *)
-      brw->compute_program;
+   struct brw_program *cp = (struct brw_program *) brw->compute_program;
 
    if (!cp)
       return;
@@ -246,7 +244,7 @@ brw_cs_precompile(struct gl_context *ctx,
    struct brw_context *brw = brw_context(ctx);
    struct brw_cs_prog_key key;
 
-   struct brw_compute_program *bcp = brw_compute_program(prog);
+   struct brw_program *bcp = brw_program(prog);
 
    memset(&key, 0, sizeof(key));
    key.program_string_id = bcp->id;
index ad728696a38447bddb9c589c17c23082b02725c7..e0a1287f4036a6e389cd2e9943eb2f523d5458fd 100644 (file)
@@ -133,7 +133,8 @@ static struct gl_program *brwNewProgram( struct gl_context *ctx,
    case GL_VERTEX_PROGRAM_ARB:
    case GL_TESS_CONTROL_PROGRAM_NV:
    case GL_TESS_EVALUATION_PROGRAM_NV:
-   case GL_GEOMETRY_PROGRAM_NV: {
+   case GL_GEOMETRY_PROGRAM_NV:
+   case GL_COMPUTE_PROGRAM_NV: {
       struct brw_program *prog = CALLOC_STRUCT(brw_program);
       if (prog) {
         prog->id = get_new_program_id(brw->screen);
@@ -163,17 +164,6 @@ static struct gl_program *brwNewProgram( struct gl_context *ctx,
         return NULL;
    }
 
-   case GL_COMPUTE_PROGRAM_NV: {
-      struct brw_compute_program *prog = CALLOC_STRUCT(brw_compute_program);
-      if (prog) {
-         prog->id = get_new_program_id(brw->screen);
-
-         return _mesa_init_gl_program(&prog->program, target, id);
-      } else {
-         return NULL;
-      }
-   }
-
    default:
       unreachable("Unsupported target in brwNewProgram()");
    }
index 3533ac9cb3b9ac379046985f5e036b7e81a440dc..bae4fd2fa6407c53c783c2d6fbe33f7c651dd1f7 100644 (file)
@@ -280,8 +280,7 @@ gen7_upload_cs_push_constants(struct brw_context *brw)
    struct brw_stage_state *stage_state = &brw->cs.base;
 
    /* BRW_NEW_COMPUTE_PROGRAM */
-   const struct brw_compute_program *cp =
-      (struct brw_compute_program *) brw->compute_program;
+   const struct brw_program *cp = (struct brw_program *) brw->compute_program;
 
    if (cp) {
       /* BRW_NEW_CS_PROG_DATA */
@@ -316,8 +315,7 @@ brw_upload_cs_pull_constants(struct brw_context *brw)
    struct brw_stage_state *stage_state = &brw->cs.base;
 
    /* BRW_NEW_COMPUTE_PROGRAM */
-   struct brw_compute_program *cp =
-      (struct brw_compute_program *) brw->compute_program;
+   struct brw_program *cp = (struct brw_program *) brw->compute_program;
 
    /* BRW_NEW_CS_PROG_DATA */
    const struct brw_stage_prog_data *prog_data = brw->cs.base.prog_data;