aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2016-10-19 11:13:52 +1100
committerTimothy Arceri <[email protected]>2016-10-26 14:29:36 +1100
commit64d9773cfebded42691a70e3b233cadf896e53ba (patch)
tree5723116394eb77c64c8bb52459540131ec1ab38f /src/mesa/drivers
parent750b14ed8e6ff539f17069dec63004159575ccd8 (diff)
i965/mesa/st: eliminate gl_tess_ctrl_program
We now get all the tcs metadata from shader_info. Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-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_program.c2
-rw-r--r--src/mesa/drivers/dri/i965/brw_tcs.c13
-rw-r--r--src/mesa/drivers/dri/i965/brw_tcs_surface_state.c2
-rw-r--r--src/mesa/drivers/dri/i965/brw_tes.c2
-rw-r--r--src/mesa/drivers/dri/i965/gen7_hs_state.c4
7 files changed, 15 insertions, 16 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
index c92bb9f8431..9b7e1846680 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -337,7 +337,7 @@ struct brw_vertex_program {
/** Subclass of Mesa tessellation control program */
struct brw_tess_ctrl_program {
- struct gl_tess_ctrl_program program;
+ struct gl_program program;
unsigned id; /**< serial no. to identify tess ctrl progs, never re-used */
};
@@ -1008,7 +1008,7 @@ struct brw_context
*/
const struct gl_vertex_program *vertex_program;
const struct gl_geometry_program *geometry_program;
- const struct gl_tess_ctrl_program *tess_ctrl_program;
+ const struct gl_program *tess_ctrl_program;
const struct gl_tess_eval_program *tess_eval_program;
const struct gl_fragment_program *fragment_program;
const struct gl_compute_program *compute_program;
@@ -1730,7 +1730,7 @@ brw_vertex_program_const(const struct gl_vertex_program *p)
}
static inline struct brw_tess_ctrl_program *
-brw_tess_ctrl_program(struct gl_tess_ctrl_program *p)
+brw_tess_ctrl_program(struct gl_program *p)
{
return (struct brw_tess_ctrl_program *) p;
}
diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c
index 5d176efb53c..5485de3692a 100644
--- a/src/mesa/drivers/dri/i965/brw_draw.c
+++ b/src/mesa/drivers/dri/i965/brw_draw.c
@@ -458,7 +458,7 @@ brw_try_draw_prims(struct gl_context *ctx,
brw->tes.base.sampler_count = ctx->TessEvalProgram._Current ?
util_last_bit(ctx->TessEvalProgram._Current->Base.SamplersUsed) : 0;
brw->tcs.base.sampler_count = ctx->TessCtrlProgram._Current ?
- util_last_bit(ctx->TessCtrlProgram._Current->Base.SamplersUsed) : 0;
+ util_last_bit(ctx->TessCtrlProgram._Current->SamplersUsed) : 0;
brw->vs.base.sampler_count =
util_last_bit(ctx->VertexProgram._Current->Base.SamplersUsed);
diff --git a/src/mesa/drivers/dri/i965/brw_program.c b/src/mesa/drivers/dri/i965/brw_program.c
index a41f36e766b..4e0df5a77ff 100644
--- a/src/mesa/drivers/dri/i965/brw_program.c
+++ b/src/mesa/drivers/dri/i965/brw_program.c
@@ -168,7 +168,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/brw_tcs.c b/src/mesa/drivers/dri/i965/brw_tcs.c
index 20ea4f1d57c..8a78a40f690 100644
--- a/src/mesa/drivers/dri/i965/brw_tcs.c
+++ b/src/mesa/drivers/dri/i965/brw_tcs.c
@@ -178,7 +178,7 @@ brw_codegen_tcs_prog(struct brw_context *brw,
double start_time = 0;
if (tcp) {
- nir = tcp->program.Base.nir;
+ nir = tcp->program.nir;
} else {
/* Create a dummy nir_shader. We won't actually use NIR code to
* generate assembly (it's easier to generate assembly directly),
@@ -211,14 +211,14 @@ brw_codegen_tcs_prog(struct brw_context *brw,
if (tcs) {
brw_assign_common_binding_table_offsets(MESA_SHADER_TESS_CTRL, devinfo,
- shader_prog, &tcp->program.Base,
+ shader_prog, &tcp->program,
&prog_data.base.base, 0);
prog_data.base.base.image_param =
rzalloc_array(NULL, struct brw_image_param, tcs->NumImages);
prog_data.base.base.nr_image_params = tcs->NumImages;
- brw_nir_setup_glsl_uniforms(nir, shader_prog, &tcp->program.Base,
+ brw_nir_setup_glsl_uniforms(nir, shader_prog, &tcp->program,
&prog_data.base.base,
compiler->scalar_stage[MESA_SHADER_TESS_CTRL]);
} else {
@@ -320,7 +320,6 @@ brw_tcs_populate_key(struct brw_context *brw,
(struct brw_tess_ctrl_program *) brw->tess_ctrl_program;
struct brw_tess_eval_program *tep =
(struct brw_tess_eval_program *) brw->tess_eval_program;
- struct gl_program *prog = &tcp->program.Base;
struct gl_program *tes_prog = &tep->program.Base;
uint64_t per_vertex_slots = tes_prog->info.inputs_read;
@@ -329,6 +328,7 @@ brw_tcs_populate_key(struct brw_context *brw,
memset(key, 0, sizeof(*key));
if (tcp) {
+ struct gl_program *prog = &tcp->program;
per_vertex_slots |= prog->info.outputs_written;
per_patch_slots |= prog->info.patch_outputs_written;
}
@@ -350,7 +350,7 @@ brw_tcs_populate_key(struct brw_context *brw,
key->program_string_id = tcp->id;
/* _NEW_TEXTURE */
- brw_populate_sampler_prog_key_data(&brw->ctx, prog, &key->tex);
+ brw_populate_sampler_prog_key_data(&brw->ctx, &tcp->program, &key->tex);
} else {
key->outputs_written = tes_prog->info.inputs_read;
}
@@ -400,8 +400,7 @@ brw_tcs_precompile(struct gl_context *ctx,
struct brw_stage_prog_data *old_prog_data = brw->tcs.base.prog_data;
bool success;
- struct gl_tess_ctrl_program *tcp = (struct gl_tess_ctrl_program *)prog;
- struct brw_tess_ctrl_program *btcp = brw_tess_ctrl_program(tcp);
+ struct brw_tess_ctrl_program *btcp = brw_tess_ctrl_program(prog);
const struct gl_linked_shader *tes =
shader_prog->_LinkedShaders[MESA_SHADER_TESS_EVAL];
diff --git a/src/mesa/drivers/dri/i965/brw_tcs_surface_state.c b/src/mesa/drivers/dri/i965/brw_tcs_surface_state.c
index 5021e10e134..e91488fb492 100644
--- a/src/mesa/drivers/dri/i965/brw_tcs_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_tcs_surface_state.c
@@ -52,7 +52,7 @@ brw_upload_tcs_pull_constants(struct brw_context *brw)
_mesa_shader_write_subroutine_indices(&brw->ctx, MESA_SHADER_TESS_CTRL);
/* _NEW_PROGRAM_CONSTANTS */
- brw_upload_pull_constants(brw, BRW_NEW_TCS_CONSTBUF, &tcp->program.Base,
+ brw_upload_pull_constants(brw, BRW_NEW_TCS_CONSTBUF, &tcp->program,
stage_state, prog_data);
}
diff --git a/src/mesa/drivers/dri/i965/brw_tes.c b/src/mesa/drivers/dri/i965/brw_tes.c
index 3f01c07dffb..fe03816b548 100644
--- a/src/mesa/drivers/dri/i965/brw_tes.c
+++ b/src/mesa/drivers/dri/i965/brw_tes.c
@@ -251,7 +251,7 @@ brw_tes_populate_key(struct brw_context *brw,
* be stored in the Patch URB Entry as well.
*/
if (tcp) {
- struct gl_program *tcp_prog = &tcp->program.Base;
+ struct gl_program *tcp_prog = &tcp->program;
per_vertex_slots |= tcp_prog->info.outputs_written;
per_patch_slots |= tcp_prog->info.patch_outputs_written;
}
diff --git a/src/mesa/drivers/dri/i965/gen7_hs_state.c b/src/mesa/drivers/dri/i965/gen7_hs_state.c
index f16af287dce..290aea23924 100644
--- a/src/mesa/drivers/dri/i965/gen7_hs_state.c
+++ b/src/mesa/drivers/dri/i965/gen7_hs_state.c
@@ -41,8 +41,8 @@ gen7_upload_tcs_push_constants(struct brw_context *brw)
const struct brw_stage_prog_data *prog_data = brw->tcs.base.prog_data;
_mesa_shader_write_subroutine_indices(&brw->ctx, MESA_SHADER_TESS_CTRL);
- gen6_upload_push_constants(brw, &tcp->program.Base, prog_data,
- stage_state, AUB_TRACE_VS_CONSTANTS);
+ gen6_upload_push_constants(brw, &tcp->program, prog_data, stage_state,
+ AUB_TRACE_VS_CONSTANTS);
}
gen7_upload_constant_state(brw, stage_state, active, _3DSTATE_CONSTANT_HS);