i965: replace brw_geomerty_program with brw_program
authorTimothy Arceri <timothy.arceri@collabora.com>
Tue, 18 Oct 2016 04:43:21 +0000 (15:43 +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_compiler.h
src/mesa/drivers/dri/i965/brw_context.h
src/mesa/drivers/dri/i965/brw_gs.c
src/mesa/drivers/dri/i965/brw_gs.h
src/mesa/drivers/dri/i965/brw_gs_surface_state.c
src/mesa/drivers/dri/i965/brw_program.c
src/mesa/drivers/dri/i965/gen6_gs_state.c

index 772c11ee170a0dbca2a3f98bf4b7dfe79c5fa143..819c7d604e12c7864fd5c33ce682f3fb510d9de5 100644 (file)
@@ -34,7 +34,7 @@ extern "C" {
 
 struct ra_regs;
 struct nir_shader;
-struct brw_geometry_program;
+struct brw_program;
 union gl_constant_value;
 
 struct brw_compiler {
index 4feb3f7ec170845920f9653b0e52c026db55c558..0c887510acd3c7ab23f9af0956a1fb8f8a3d57d3 100644 (file)
@@ -348,13 +348,6 @@ struct brw_tess_eval_program {
 };
 
 
-/** Subclass of Mesa geometry program */
-struct brw_geometry_program {
-   struct gl_program program;
-   unsigned id;  /**< serial no. to identify geom progs, never re-used */
-};
-
-
 /** Subclass of Mesa fragment program */
 struct brw_fragment_program {
    struct gl_program program;
@@ -1723,12 +1716,6 @@ brw_tess_eval_program(struct gl_program *p)
    return (struct brw_tess_eval_program *) p;
 }
 
-static inline struct brw_geometry_program *
-brw_geometry_program(struct gl_program *p)
-{
-   return (struct brw_geometry_program *) p;
-}
-
 static inline struct brw_fragment_program *
 brw_fragment_program(struct gl_program *p)
 {
index 8fba6fadd9b1e323f8a53ffb3e4d69e3fe6d6de7..0f052d21b0a6cee5096a2b864d774315876e8fe5 100644 (file)
@@ -94,7 +94,7 @@ assign_gs_binding_table_offsets(const struct gen_device_info *devinfo,
 bool
 brw_codegen_gs_prog(struct brw_context *brw,
                     struct gl_shader_program *prog,
-                    struct brw_geometry_program *gp,
+                    struct brw_program *gp,
                     struct brw_gs_prog_key *key)
 {
    struct brw_compiler *compiler = brw->screen->compiler;
@@ -210,8 +210,7 @@ brw_gs_populate_key(struct brw_context *brw,
                     struct brw_gs_prog_key *key)
 {
    struct gl_context *ctx = &brw->ctx;
-   struct brw_geometry_program *gp =
-      (struct brw_geometry_program *) brw->geometry_program;
+   struct brw_program *gp = (struct brw_program *) brw->geometry_program;
 
    memset(key, 0, sizeof(*key));
 
@@ -229,8 +228,7 @@ brw_upload_gs_prog(struct brw_context *brw)
    struct brw_stage_state *stage_state = &brw->gs.base;
    struct brw_gs_prog_key key;
    /* BRW_NEW_GEOMETRY_PROGRAM */
-   struct brw_geometry_program *gp =
-      (struct brw_geometry_program *) brw->geometry_program;
+   struct brw_program *gp = (struct brw_program *) brw->geometry_program;
 
    if (!brw_gs_state_dirty(brw))
       return;
@@ -275,7 +273,7 @@ brw_gs_precompile(struct gl_context *ctx,
    struct brw_stage_prog_data *old_prog_data = brw->gs.base.prog_data;
    bool success;
 
-   struct brw_geometry_program *bgp = brw_geometry_program(prog);
+   struct brw_program *bgp = brw_program(prog);
 
    memset(&key, 0, sizeof(key));
 
index 7ccd22e5112109e000363213d44735e999a2be7e..e1f8c4db0d34b6bcb874a78b28777181258865f2 100644 (file)
@@ -44,7 +44,7 @@ brw_gs_populate_key(struct brw_context *brw,
 bool
 brw_codegen_gs_prog(struct brw_context *brw,
                     struct gl_shader_program *prog,
-                    struct brw_geometry_program *gp,
+                    struct brw_program *gp,
                     struct brw_gs_prog_key *key);
 
 #ifdef __cplusplus
index 686ddb4b940994356d1bea00d22e23a865c382fb..4d0f50c9c11d73c0a6a7755882c77ef26ec55ae8 100644 (file)
@@ -41,8 +41,7 @@ brw_upload_gs_pull_constants(struct brw_context *brw)
    struct brw_stage_state *stage_state = &brw->gs.base;
 
    /* BRW_NEW_GEOMETRY_PROGRAM */
-   struct brw_geometry_program *gp =
-      (struct brw_geometry_program *) brw->geometry_program;
+   struct brw_program *gp = (struct brw_program *) brw->geometry_program;
 
    if (!gp)
       return;
index 69c467d9a3d0d71e5a311d84c5b814320e330d16..cb73f424f33479b20f1331ae1f71c879c10860e8 100644 (file)
@@ -130,7 +130,8 @@ static struct gl_program *brwNewProgram( struct gl_context *ctx,
    struct brw_context *brw = brw_context(ctx);
 
    switch (target) {
-   case GL_VERTEX_PROGRAM_ARB: {
+   case GL_VERTEX_PROGRAM_ARB:
+   case GL_GEOMETRY_PROGRAM_NV: {
       struct brw_program *prog = CALLOC_STRUCT(brw_program);
       if (prog) {
         prog->id = get_new_program_id(brw->screen);
@@ -160,17 +161,6 @@ static struct gl_program *brwNewProgram( struct gl_context *ctx,
         return NULL;
    }
 
-   case GL_GEOMETRY_PROGRAM_NV: {
-      struct brw_geometry_program *prog = CALLOC_STRUCT(brw_geometry_program);
-      if (prog) {
-         prog->id = get_new_program_id(brw->screen);
-
-         return _mesa_init_gl_program(&prog->program, target, id);
-      } else {
-         return NULL;
-      }
-   }
-
    case GL_TESS_CONTROL_PROGRAM_NV: {
       struct brw_tess_ctrl_program *prog = CALLOC_STRUCT(brw_tess_ctrl_program);
       if (prog) {
index 492376426c61f11848f56ea46c64815b8050e084..a2520d86314f704b26e75f051fa6c755227d6140 100644 (file)
@@ -37,8 +37,7 @@ gen6_upload_gs_push_constants(struct brw_context *brw)
    struct brw_stage_state *stage_state = &brw->gs.base;
 
    /* BRW_NEW_GEOMETRY_PROGRAM */
-   const struct brw_geometry_program *gp =
-      (struct brw_geometry_program *) brw->geometry_program;
+   const struct brw_program *gp = brw_program_const(brw->geometry_program);
 
    if (gp) {
       /* BRW_NEW_GS_PROG_DATA */