i965: replace brw_fragment_program with brw_program
authorTimothy Arceri <timothy.arceri@collabora.com>
Tue, 18 Oct 2016 05:17:14 +0000 (16:17 +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_wm.c
src/mesa/drivers/dri/i965/brw_wm.h
src/mesa/drivers/dri/i965/brw_wm_surface_state.c
src/mesa/drivers/dri/i965/gen6_wm_state.c

index 203c9fef533c47c040fc37c46ec0a99cf69f957d..48c2066e8a3df7aaf9dbff7f2d6fa2ef5b2bbc0b 100644 (file)
@@ -334,15 +334,8 @@ struct brw_program {
 };
 
 
-/** Subclass of Mesa fragment program */
-struct brw_fragment_program {
-   struct gl_program program;
-   GLuint id;  /**< serial no. to identify frag progs, never re-used */
-};
-
-
 struct gen4_fragment_program {
-   struct brw_fragment_program base;
+   struct brw_program base;
 
    bool contains_flat_varying;
    bool contains_noperspective_varying;
@@ -1690,18 +1683,6 @@ brw_program_const(const struct gl_program *p)
    return (const struct brw_program *) p;
 }
 
-static inline struct brw_fragment_program *
-brw_fragment_program(struct gl_program *p)
-{
-   return (struct brw_fragment_program *) p;
-}
-
-static inline const struct brw_fragment_program *
-brw_fragment_program_const(const struct gl_program *p)
-{
-   return (const struct brw_fragment_program *) p;
-}
-
 static inline struct brw_compute_program *
 brw_compute_program(struct gl_program *p)
 {
index b7ad962e4ead1213d4f8133e737856a536a5638a..ad728696a38447bddb9c589c17c23082b02725c7 100644 (file)
@@ -145,13 +145,13 @@ static struct gl_program *brwNewProgram( struct gl_context *ctx,
    }
 
    case GL_FRAGMENT_PROGRAM_ARB: {
-      struct brw_fragment_program *prog;
+      struct brw_program *prog;
       if (brw->gen < 6) {
          struct gen4_fragment_program *g4_prog =
             CALLOC_STRUCT(gen4_fragment_program);
          prog = &g4_prog->base;
       } else {
-         prog = CALLOC_STRUCT(brw_fragment_program);
+         prog = CALLOC_STRUCT(brw_program);
       }
 
       if (prog) {
@@ -198,9 +198,9 @@ brwProgramStringNotify(struct gl_context *ctx,
 
    switch (target) {
    case GL_FRAGMENT_PROGRAM_ARB: {
-      struct brw_fragment_program *newFP = brw_fragment_program(prog);
-      const struct brw_fragment_program *curFP =
-         brw_fragment_program_const(brw->fragment_program);
+      struct brw_program *newFP = brw_program(prog);
+      const struct brw_program *curFP =
+         brw_program_const(brw->fragment_program);
 
       if (newFP == curFP)
         brw->ctx.NewDriverState |= BRW_NEW_FRAGMENT_PROGRAM;
index 851ba102ad2d299b3d66077843c7a02333092991..f433ed6f4da3e7324ce273ad1970d7a2cbb4c0eb 100644 (file)
@@ -76,7 +76,7 @@ assign_fs_binding_table_offsets(const struct gen_device_info *devinfo,
 bool
 brw_codegen_wm_prog(struct brw_context *brw,
                     struct gl_shader_program *prog,
-                    struct brw_fragment_program *fp,
+                    struct brw_program *fp,
                     struct brw_wm_prog_key *key,
                     struct brw_vue_map *vue_map)
 {
@@ -438,8 +438,7 @@ brw_wm_populate_key(struct brw_context *brw, struct brw_wm_prog_key *key)
 {
    struct gl_context *ctx = &brw->ctx;
    /* BRW_NEW_FRAGMENT_PROGRAM */
-   const struct brw_fragment_program *fp =
-      (struct brw_fragment_program *) brw->fragment_program;
+   const struct brw_program *fp = brw_program_const(brw->fragment_program);
    const struct gl_program *prog = (struct gl_program *) brw->fragment_program;
    GLuint lookup = 0;
    GLuint line_aa;
@@ -574,8 +573,7 @@ brw_upload_wm_prog(struct brw_context *brw)
    struct gl_context *ctx = &brw->ctx;
    struct gl_shader_program *current = ctx->_Shader->_CurrentFragmentProgram;
    struct brw_wm_prog_key key;
-   struct brw_fragment_program *fp = (struct brw_fragment_program *)
-      brw->fragment_program;
+   struct brw_program *fp = (struct brw_program *) brw->fragment_program;
 
    if (!brw_wm_state_dirty(brw))
       return;
@@ -601,7 +599,7 @@ brw_fs_precompile(struct gl_context *ctx,
    struct brw_context *brw = brw_context(ctx);
    struct brw_wm_prog_key key;
 
-   struct brw_fragment_program *bfp = brw_fragment_program(prog);
+   struct brw_program *bfp = brw_program(prog);
 
    memset(&key, 0, sizeof(key));
 
index f4f513bef0a214256b5f3eb72d6575747680c6b3..135e98f32a02b9af8e5a6275330a224bd0e33247 100644 (file)
@@ -62,7 +62,7 @@ extern "C" {
 bool brw_color_buffer_write_enabled(struct brw_context *brw);
 bool brw_codegen_wm_prog(struct brw_context *brw,
                          struct gl_shader_program *prog,
-                         struct brw_fragment_program *fp,
+                         struct brw_program *fp,
                          struct brw_wm_prog_key *key,
                          struct brw_vue_map *vue_map);
 void brw_wm_debug_recompile(struct brw_context *brw,
index 667d48c044a0f8665bb220d678204a0190fead0d..fcd753c11a63b6e9073b8e63eb84b5aeaac19ba3 100644 (file)
@@ -832,8 +832,7 @@ brw_upload_wm_pull_constants(struct brw_context *brw)
 {
    struct brw_stage_state *stage_state = &brw->wm.base;
    /* BRW_NEW_FRAGMENT_PROGRAM */
-   struct brw_fragment_program *fp =
-      (struct brw_fragment_program *) brw->fragment_program;
+   struct brw_program *fp = (struct brw_program *) brw->fragment_program;
    /* BRW_NEW_FS_PROG_DATA */
    struct brw_stage_prog_data *prog_data = brw->wm.base.prog_data;
 
index bd279ecebf21d20ff9e80960b689d892508fd4ed..a618ea95ca7f39fb87bb1660363bcd494fb1465f 100644 (file)
@@ -42,8 +42,7 @@ gen6_upload_wm_push_constants(struct brw_context *brw)
 {
    struct brw_stage_state *stage_state = &brw->wm.base;
    /* BRW_NEW_FRAGMENT_PROGRAM */
-   const struct brw_fragment_program *fp =
-      brw_fragment_program_const(brw->fragment_program);
+   const struct brw_program *fp = brw_program_const(brw->fragment_program);
    /* BRW_NEW_FS_PROG_DATA */
    const struct brw_stage_prog_data *prog_data = brw->wm.base.prog_data;