i965: replace brw_vertex_program with new generic brw_program
authorTimothy Arceri <timothy.arceri@collabora.com>
Tue, 18 Oct 2016 04:26:57 +0000 (15:26 +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_program.c
src/mesa/drivers/dri/i965/brw_vs.c
src/mesa/drivers/dri/i965/brw_vs.h
src/mesa/drivers/dri/i965/brw_vs_surface_state.c
src/mesa/drivers/dri/i965/gen6_vs_state.c

index fa66e238ed4181d08f98532283d454d333848388..4feb3f7ec170845920f9653b0e52c026db55c558 100644 (file)
@@ -326,8 +326,9 @@ struct brw_state_flags {
    uint64_t brw;
 };
 
-/** Subclass of Mesa vertex program */
-struct brw_vertex_program {
+
+/** Subclass of Mesa program */
+struct brw_program {
    struct gl_program program;
    GLuint id;
 };
@@ -1698,16 +1699,16 @@ brw_context( struct gl_context *ctx )
    return (struct brw_context *)ctx;
 }
 
-static inline struct brw_vertex_program *
-brw_vertex_program(struct gl_program *p)
+static inline struct brw_program *
+brw_program(struct gl_program *p)
 {
-   return (struct brw_vertex_program *) p;
+   return (struct brw_program *) p;
 }
 
-static inline const struct brw_vertex_program *
-brw_vertex_program_const(const struct gl_program *p)
+static inline const struct brw_program *
+brw_program_const(const struct gl_program *p)
 {
-   return (const struct brw_vertex_program *) p;
+   return (const struct brw_program *) p;
 }
 
 static inline struct brw_tess_ctrl_program *
index 08520a394a02f726557ecfd9a3113985d08bf2ff..69c467d9a3d0d71e5a311d84c5b814320e330d16 100644 (file)
@@ -131,7 +131,7 @@ static struct gl_program *brwNewProgram( struct gl_context *ctx,
 
    switch (target) {
    case GL_VERTEX_PROGRAM_ARB: {
-      struct brw_vertex_program *prog = CALLOC_STRUCT(brw_vertex_program);
+      struct brw_program *prog = CALLOC_STRUCT(brw_program);
       if (prog) {
         prog->id = get_new_program_id(brw->screen);
 
@@ -244,9 +244,9 @@ brwProgramStringNotify(struct gl_context *ctx,
       break;
    }
    case GL_VERTEX_PROGRAM_ARB: {
-      struct brw_vertex_program *newVP = brw_vertex_program(prog);
-      const struct brw_vertex_program *curVP =
-         brw_vertex_program_const(brw->vertex_program);
+      struct brw_program *newVP = brw_program(prog);
+      const struct brw_program *curVP =
+         brw_program_const(brw->vertex_program);
 
       if (newVP == curVP)
         brw->ctx.NewDriverState |= BRW_NEW_VERTEX_PROGRAM;
index 5d1c8e0c7078fcd302e85def7f281077726093b2..842c5165c8eccd32309e246c0b1427b7d27d0e2e 100644 (file)
@@ -87,7 +87,7 @@ brw_vs_outputs_written(struct brw_context *brw, struct brw_vs_prog_key *key,
 bool
 brw_codegen_vs_prog(struct brw_context *brw,
                     struct gl_shader_program *prog,
-                    struct brw_vertex_program *vp,
+                    struct brw_program *vp,
                     struct brw_vs_prog_key *key)
 {
    const struct brw_compiler *compiler = brw->screen->compiler;
@@ -307,8 +307,7 @@ brw_vs_populate_key(struct brw_context *brw,
 {
    struct gl_context *ctx = &brw->ctx;
    /* BRW_NEW_VERTEX_PROGRAM */
-   struct brw_vertex_program *vp =
-      (struct brw_vertex_program *)brw->vertex_program;
+   struct brw_program *vp = (struct brw_program *)brw->vertex_program;
    struct gl_program *prog = (struct gl_program *) brw->vertex_program;
 
    memset(key, 0, sizeof(*key));
@@ -360,8 +359,7 @@ brw_upload_vs_prog(struct brw_context *brw)
    struct gl_shader_program **current = ctx->_Shader->CurrentProgram;
    struct brw_vs_prog_key key;
    /* BRW_NEW_VERTEX_PROGRAM */
-   struct brw_vertex_program *vp =
-      (struct brw_vertex_program *)brw->vertex_program;
+   struct brw_program *vp = (struct brw_program *)brw->vertex_program;
 
    if (!brw_vs_state_dirty(brw))
       return;
@@ -389,7 +387,7 @@ brw_vs_precompile(struct gl_context *ctx,
    struct brw_stage_prog_data *old_prog_data = brw->vs.base.prog_data;
    bool success;
 
-   struct brw_vertex_program *bvp = brw_vertex_program(prog);
+   struct brw_program *bvp = brw_program(prog);
 
    memset(&key, 0, sizeof(key));
 
index 25241a92a4342e436bf6e02ce42576d6939af59f..016f2bd732ce465d48d253e0a186e2ef0601d62d 100644 (file)
@@ -65,7 +65,7 @@ brw_upload_vs_prog(struct brw_context *brw);
 bool
 brw_codegen_vs_prog(struct brw_context *brw,
                     struct gl_shader_program *prog,
-                    struct brw_vertex_program *vp,
+                    struct brw_program *vp,
                     struct brw_vs_prog_key *key);
 
 void
index a5a5a756226932c814b0441f9318ec2b9e6ef648..6a97cd4a13f7d240a21f49eced80d225fce5ab92 100644 (file)
@@ -113,8 +113,7 @@ brw_upload_vs_pull_constants(struct brw_context *brw)
    struct brw_stage_state *stage_state = &brw->vs.base;
 
    /* BRW_NEW_VERTEX_PROGRAM */
-   struct brw_vertex_program *vp =
-      (struct brw_vertex_program *) brw->vertex_program;
+   struct brw_program *vp = (struct brw_program *) brw->vertex_program;
 
    /* BRW_NEW_VS_PROG_DATA */
    const struct brw_stage_prog_data *prog_data = brw->vs.base.prog_data;
index 17ccd327ed505e533af5e1c0e86521aff3553919..837762d3910a3fe64885bc0a1de9fa49cb472601 100644 (file)
@@ -40,8 +40,7 @@ gen6_upload_vs_push_constants(struct brw_context *brw)
    struct brw_stage_state *stage_state = &brw->vs.base;
 
    /* _BRW_NEW_VERTEX_PROGRAM */
-   const struct brw_vertex_program *vp =
-      brw_vertex_program_const(brw->vertex_program);
+   const struct brw_program *vp = brw_program_const(brw->vertex_program);
    /* BRW_NEW_VS_PROG_DATA */
    const struct brw_stage_prog_data *prog_data = brw->vs.base.prog_data;