summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2016-10-19 11:59:12 +1100
committerTimothy Arceri <[email protected]>2016-10-26 14:29:36 +1100
commit92f77e9c01085c6babe6ce80dfe4e0e7abab61a1 (patch)
treeecea28bd6506ea75c1e980ea688f684a97822226 /src/mesa/drivers/dri/i965
parent9045ddcfe4ed2ecc6220db69dc33d6049956b99b (diff)
i965/mesa/st: eliminate gl_geometry_program
We now get all the gs metadata from shader_info. Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965')
-rw-r--r--src/mesa/drivers/dri/i965/brw_context.h6
-rw-r--r--src/mesa/drivers/dri/i965/brw_draw.c2
-rw-r--r--src/mesa/drivers/dri/i965/brw_gs.c19
-rw-r--r--src/mesa/drivers/dri/i965/brw_gs_surface_state.c2
-rw-r--r--src/mesa/drivers/dri/i965/brw_program.c2
-rw-r--r--src/mesa/drivers/dri/i965/gen6_gs_state.c4
6 files changed, 16 insertions, 19 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
index db48aa1fd7e..5e68c501aaa 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -351,7 +351,7 @@ struct brw_tess_eval_program {
/** Subclass of Mesa geometry program */
struct brw_geometry_program {
- struct gl_geometry_program program;
+ struct gl_program program;
unsigned id; /**< serial no. to identify geom progs, never re-used */
};
@@ -1007,7 +1007,7 @@ struct brw_context
/* Active vertex program:
*/
const struct gl_vertex_program *vertex_program;
- const struct gl_geometry_program *geometry_program;
+ const struct gl_program *geometry_program;
const struct gl_program *tess_ctrl_program;
const struct gl_program *tess_eval_program;
const struct gl_fragment_program *fragment_program;
@@ -1742,7 +1742,7 @@ brw_tess_eval_program(struct gl_program *p)
}
static inline struct brw_geometry_program *
-brw_geometry_program(struct gl_geometry_program *p)
+brw_geometry_program(struct gl_program *p)
{
return (struct brw_geometry_program *) p;
}
diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c
index 2dbaddd8005..a2e044275af 100644
--- a/src/mesa/drivers/dri/i965/brw_draw.c
+++ b/src/mesa/drivers/dri/i965/brw_draw.c
@@ -454,7 +454,7 @@ brw_try_draw_prims(struct gl_context *ctx,
brw->wm.base.sampler_count =
util_last_bit(ctx->FragmentProgram._Current->Base.SamplersUsed);
brw->gs.base.sampler_count = ctx->GeometryProgram._Current ?
- util_last_bit(ctx->GeometryProgram._Current->Base.SamplersUsed) : 0;
+ util_last_bit(ctx->GeometryProgram._Current->SamplersUsed) : 0;
brw->tes.base.sampler_count = ctx->TessEvalProgram._Current ?
util_last_bit(ctx->TessEvalProgram._Current->SamplersUsed) : 0;
brw->tcs.base.sampler_count = ctx->TessCtrlProgram._Current ?
diff --git a/src/mesa/drivers/dri/i965/brw_gs.c b/src/mesa/drivers/dri/i965/brw_gs.c
index b493e6c3a2f..8fba6fadd9b 100644
--- a/src/mesa/drivers/dri/i965/brw_gs.c
+++ b/src/mesa/drivers/dri/i965/brw_gs.c
@@ -106,8 +106,7 @@ brw_codegen_gs_prog(struct brw_context *brw,
memset(&prog_data, 0, sizeof(prog_data));
- assign_gs_binding_table_offsets(devinfo, prog,
- &gp->program.Base, &prog_data);
+ assign_gs_binding_table_offsets(devinfo, prog, &gp->program, &prog_data);
/* Allocate the references to the uniforms that will end up in the
* prog_data associated with the compiled program, and which will be freed
@@ -119,7 +118,7 @@ brw_codegen_gs_prog(struct brw_context *brw,
*/
struct gl_linked_shader *gs = prog->_LinkedShaders[MESA_SHADER_GEOMETRY];
struct brw_shader *bgs = (struct brw_shader *) gs;
- int param_count = gp->program.Base.nir->num_uniforms / 4;
+ int param_count = gp->program.nir->num_uniforms / 4;
prog_data.base.base.param =
rzalloc_array(NULL, const gl_constant_value *, param_count);
@@ -130,15 +129,15 @@ brw_codegen_gs_prog(struct brw_context *brw,
prog_data.base.base.nr_params = param_count;
prog_data.base.base.nr_image_params = gs->NumImages;
- brw_nir_setup_glsl_uniforms(gp->program.Base.nir, prog, &gp->program.Base,
+ brw_nir_setup_glsl_uniforms(gp->program.nir, prog, &gp->program,
&prog_data.base.base,
compiler->scalar_stage[MESA_SHADER_GEOMETRY]);
- uint64_t outputs_written = gp->program.Base.info.outputs_written;
+ uint64_t outputs_written = gp->program.info.outputs_written;
prog_data.base.cull_distance_mask =
- ((1 << gp->program.Base.CullDistanceArraySize) - 1) <<
- gp->program.Base.ClipDistanceArraySize;
+ ((1 << gp->program.CullDistanceArraySize) - 1) <<
+ gp->program.ClipDistanceArraySize;
brw_compute_vue_map(devinfo,
&prog_data.base.vue_map, outputs_written,
@@ -213,14 +212,13 @@ brw_gs_populate_key(struct brw_context *brw,
struct gl_context *ctx = &brw->ctx;
struct brw_geometry_program *gp =
(struct brw_geometry_program *) brw->geometry_program;
- struct gl_program *prog = &gp->program.Base;
memset(key, 0, sizeof(*key));
key->program_string_id = gp->id;
/* _NEW_TEXTURE */
- brw_populate_sampler_prog_key_data(ctx, prog, &key->tex);
+ brw_populate_sampler_prog_key_data(ctx, &gp->program, &key->tex);
}
void
@@ -277,8 +275,7 @@ brw_gs_precompile(struct gl_context *ctx,
struct brw_stage_prog_data *old_prog_data = brw->gs.base.prog_data;
bool success;
- struct gl_geometry_program *gp = (struct gl_geometry_program *) prog;
- struct brw_geometry_program *bgp = brw_geometry_program(gp);
+ struct brw_geometry_program *bgp = brw_geometry_program(prog);
memset(&key, 0, sizeof(key));
diff --git a/src/mesa/drivers/dri/i965/brw_gs_surface_state.c b/src/mesa/drivers/dri/i965/brw_gs_surface_state.c
index 371255cfa60..686ddb4b940 100644
--- a/src/mesa/drivers/dri/i965/brw_gs_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_gs_surface_state.c
@@ -52,7 +52,7 @@ brw_upload_gs_pull_constants(struct brw_context *brw)
_mesa_shader_write_subroutine_indices(&brw->ctx, MESA_SHADER_GEOMETRY);
/* _NEW_PROGRAM_CONSTANTS */
- brw_upload_pull_constants(brw, BRW_NEW_GS_CONSTBUF, &gp->program.Base,
+ brw_upload_pull_constants(brw, BRW_NEW_GS_CONSTBUF, &gp->program,
stage_state, prog_data);
}
diff --git a/src/mesa/drivers/dri/i965/brw_program.c b/src/mesa/drivers/dri/i965/brw_program.c
index 7c553c831e1..7151558a01b 100644
--- a/src/mesa/drivers/dri/i965/brw_program.c
+++ b/src/mesa/drivers/dri/i965/brw_program.c
@@ -157,7 +157,7 @@ static struct gl_program *brwNewProgram( struct gl_context *ctx,
if (prog) {
prog->id = get_new_program_id(brw->screen);
- return _mesa_init_gl_program(&prog->program.Base, target, id);
+ return _mesa_init_gl_program(&prog->program, target, id);
} else {
return NULL;
}
diff --git a/src/mesa/drivers/dri/i965/gen6_gs_state.c b/src/mesa/drivers/dri/i965/gen6_gs_state.c
index ca212c857fb..492376426c6 100644
--- a/src/mesa/drivers/dri/i965/gen6_gs_state.c
+++ b/src/mesa/drivers/dri/i965/gen6_gs_state.c
@@ -45,8 +45,8 @@ gen6_upload_gs_push_constants(struct brw_context *brw)
struct brw_stage_prog_data *prog_data = brw->gs.base.prog_data;
_mesa_shader_write_subroutine_indices(&brw->ctx, MESA_SHADER_GEOMETRY);
- gen6_upload_push_constants(brw, &gp->program.Base, prog_data,
- stage_state, AUB_TRACE_VS_CONSTANTS);
+ gen6_upload_push_constants(brw, &gp->program, prog_data, stage_state,
+ AUB_TRACE_VS_CONSTANTS);
}
if (brw->gen >= 7)