summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2016-10-18 16:03:32 +1100
committerTimothy Arceri <[email protected]>2016-10-26 14:29:36 +1100
commit46a4e4257e42dadc425592719863048d9012f9a7 (patch)
tree977d18e9286646efc9811084de967690e0c37ec6 /src
parent649bdb1f03838bdef337aeaec505fa9eca991d52 (diff)
i965: replace brw_tess_{eval,ctrl}_program with brw_program
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/brw_context.h26
-rw-r--r--src/mesa/drivers/dri/i965/brw_program.c24
-rw-r--r--src/mesa/drivers/dri/i965/brw_tcs.c17
-rw-r--r--src/mesa/drivers/dri/i965/brw_tcs_surface_state.c3
-rw-r--r--src/mesa/drivers/dri/i965/brw_tes.c13
-rw-r--r--src/mesa/drivers/dri/i965/brw_tes_surface_state.c3
-rw-r--r--src/mesa/drivers/dri/i965/gen7_ds_state.c3
-rw-r--r--src/mesa/drivers/dri/i965/gen7_hs_state.c3
8 files changed, 18 insertions, 74 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
index 0c887510acd..203c9fef533 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -334,20 +334,6 @@ struct brw_program {
};
-/** Subclass of Mesa tessellation control program */
-struct brw_tess_ctrl_program {
- struct gl_program program;
- unsigned id; /**< serial no. to identify tess ctrl progs, never re-used */
-};
-
-
-/** Subclass of Mesa tessellation evaluation program */
-struct brw_tess_eval_program {
- struct gl_program program;
- unsigned id; /**< serial no. to identify tess eval progs, never re-used */
-};
-
-
/** Subclass of Mesa fragment program */
struct brw_fragment_program {
struct gl_program program;
@@ -1704,18 +1690,6 @@ brw_program_const(const struct gl_program *p)
return (const struct brw_program *) p;
}
-static inline struct brw_tess_ctrl_program *
-brw_tess_ctrl_program(struct gl_program *p)
-{
- return (struct brw_tess_ctrl_program *) p;
-}
-
-static inline struct brw_tess_eval_program *
-brw_tess_eval_program(struct gl_program *p)
-{
- return (struct brw_tess_eval_program *) p;
-}
-
static inline struct brw_fragment_program *
brw_fragment_program(struct gl_program *p)
{
diff --git a/src/mesa/drivers/dri/i965/brw_program.c b/src/mesa/drivers/dri/i965/brw_program.c
index cb73f424f33..b7ad962e4ea 100644
--- a/src/mesa/drivers/dri/i965/brw_program.c
+++ b/src/mesa/drivers/dri/i965/brw_program.c
@@ -131,6 +131,8 @@ static struct gl_program *brwNewProgram( struct gl_context *ctx,
switch (target) {
case GL_VERTEX_PROGRAM_ARB:
+ case GL_TESS_CONTROL_PROGRAM_NV:
+ case GL_TESS_EVALUATION_PROGRAM_NV:
case GL_GEOMETRY_PROGRAM_NV: {
struct brw_program *prog = CALLOC_STRUCT(brw_program);
if (prog) {
@@ -161,28 +163,6 @@ static struct gl_program *brwNewProgram( struct gl_context *ctx,
return NULL;
}
- case GL_TESS_CONTROL_PROGRAM_NV: {
- struct brw_tess_ctrl_program *prog = CALLOC_STRUCT(brw_tess_ctrl_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_EVALUATION_PROGRAM_NV: {
- struct brw_tess_eval_program *prog = CALLOC_STRUCT(brw_tess_eval_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_COMPUTE_PROGRAM_NV: {
struct brw_compute_program *prog = CALLOC_STRUCT(brw_compute_program);
if (prog) {
diff --git a/src/mesa/drivers/dri/i965/brw_tcs.c b/src/mesa/drivers/dri/i965/brw_tcs.c
index 75115074c0c..58d080d2876 100644
--- a/src/mesa/drivers/dri/i965/brw_tcs.c
+++ b/src/mesa/drivers/dri/i965/brw_tcs.c
@@ -165,7 +165,7 @@ brw_tcs_debug_recompile(struct brw_context *brw,
static bool
brw_codegen_tcs_prog(struct brw_context *brw,
struct gl_shader_program *shader_prog,
- struct brw_tess_ctrl_program *tcp,
+ struct brw_program *tcp,
struct brw_tcs_prog_key *key)
{
struct gl_context *ctx = &brw->ctx;
@@ -316,10 +316,8 @@ void
brw_tcs_populate_key(struct brw_context *brw,
struct brw_tcs_prog_key *key)
{
- struct brw_tess_ctrl_program *tcp =
- (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 brw_program *tcp = (struct brw_program *) brw->tess_ctrl_program;
+ struct brw_program *tep = (struct brw_program *) brw->tess_eval_program;
struct gl_program *tes_prog = &tep->program;
uint64_t per_vertex_slots = tes_prog->info.inputs_read;
@@ -363,10 +361,9 @@ brw_upload_tcs_prog(struct brw_context *brw)
struct brw_stage_state *stage_state = &brw->tcs.base;
struct brw_tcs_prog_key key;
/* BRW_NEW_TESS_PROGRAMS */
- struct brw_tess_ctrl_program *tcp =
- (struct brw_tess_ctrl_program *) brw->tess_ctrl_program;
- MAYBE_UNUSED struct brw_tess_eval_program *tep =
- (struct brw_tess_eval_program *) brw->tess_eval_program;
+ struct brw_program *tcp = (struct brw_program *) brw->tess_ctrl_program;
+ MAYBE_UNUSED struct brw_program *tep =
+ (struct brw_program *) brw->tess_eval_program;
assert(tep);
if (!brw_state_dirty(brw,
@@ -400,7 +397,7 @@ brw_tcs_precompile(struct gl_context *ctx,
struct brw_stage_prog_data *old_prog_data = brw->tcs.base.prog_data;
bool success;
- struct brw_tess_ctrl_program *btcp = brw_tess_ctrl_program(prog);
+ struct brw_program *btcp = brw_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 e91488fb492..83b561190bb 100644
--- a/src/mesa/drivers/dri/i965/brw_tcs_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_tcs_surface_state.c
@@ -41,8 +41,7 @@ brw_upload_tcs_pull_constants(struct brw_context *brw)
struct brw_stage_state *stage_state = &brw->tcs.base;
/* BRW_NEW_TESS_PROGRAMS */
- struct brw_tess_ctrl_program *tcp =
- (struct brw_tess_ctrl_program *) brw->tess_ctrl_program;
+ struct brw_program *tcp = (struct brw_program *) brw->tess_ctrl_program;
if (!tcp)
return;
diff --git a/src/mesa/drivers/dri/i965/brw_tes.c b/src/mesa/drivers/dri/i965/brw_tes.c
index 3992bb312a8..6060c765a8f 100644
--- a/src/mesa/drivers/dri/i965/brw_tes.c
+++ b/src/mesa/drivers/dri/i965/brw_tes.c
@@ -79,7 +79,7 @@ brw_tes_debug_recompile(struct brw_context *brw,
static bool
brw_codegen_tes_prog(struct brw_context *brw,
struct gl_shader_program *shader_prog,
- struct brw_tess_eval_program *tep,
+ struct brw_program *tep,
struct brw_tes_prog_key *key)
{
const struct brw_compiler *compiler = brw->screen->compiler;
@@ -233,10 +233,8 @@ void
brw_tes_populate_key(struct brw_context *brw,
struct brw_tes_prog_key *key)
{
- struct brw_tess_ctrl_program *tcp =
- (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 brw_program *tcp = (struct brw_program *) brw->tess_ctrl_program;
+ struct brw_program *tep = (struct brw_program *) brw->tess_eval_program;
struct gl_program *prog = &tep->program;
uint64_t per_vertex_slots = prog->info.inputs_read;
@@ -275,8 +273,7 @@ brw_upload_tes_prog(struct brw_context *brw)
struct brw_stage_state *stage_state = &brw->tes.base;
struct brw_tes_prog_key key;
/* BRW_NEW_TESS_PROGRAMS */
- struct brw_tess_eval_program *tep =
- (struct brw_tess_eval_program *) brw->tess_eval_program;
+ struct brw_program *tep = (struct brw_program *) brw->tess_eval_program;
if (!brw_state_dirty(brw,
_NEW_TEXTURE,
@@ -308,7 +305,7 @@ brw_tes_precompile(struct gl_context *ctx,
struct brw_stage_prog_data *old_prog_data = brw->tes.base.prog_data;
bool success;
- struct brw_tess_eval_program *btep = brw_tess_eval_program(prog);
+ struct brw_program *btep = brw_program(prog);
memset(&key, 0, sizeof(key));
diff --git a/src/mesa/drivers/dri/i965/brw_tes_surface_state.c b/src/mesa/drivers/dri/i965/brw_tes_surface_state.c
index 2a7d48a591d..53b39cd29e7 100644
--- a/src/mesa/drivers/dri/i965/brw_tes_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_tes_surface_state.c
@@ -41,8 +41,7 @@ brw_upload_tes_pull_constants(struct brw_context *brw)
struct brw_stage_state *stage_state = &brw->tes.base;
/* BRW_NEW_TESS_PROGRAMS */
- struct brw_tess_eval_program *dp =
- (struct brw_tess_eval_program *) brw->tess_eval_program;
+ struct brw_program *dp = (struct brw_program *) brw->tess_eval_program;
if (!dp)
return;
diff --git a/src/mesa/drivers/dri/i965/gen7_ds_state.c b/src/mesa/drivers/dri/i965/gen7_ds_state.c
index 23e03d7e2af..9d7f5315de4 100644
--- a/src/mesa/drivers/dri/i965/gen7_ds_state.c
+++ b/src/mesa/drivers/dri/i965/gen7_ds_state.c
@@ -32,8 +32,7 @@ gen7_upload_tes_push_constants(struct brw_context *brw)
{
struct brw_stage_state *stage_state = &brw->tes.base;
/* BRW_NEW_TESS_PROGRAMS */
- const struct brw_tess_eval_program *tep =
- (struct brw_tess_eval_program *) brw->tess_eval_program;
+ const struct brw_program *tep = brw_program_const(brw->tess_eval_program);
if (tep) {
/* BRW_NEW_TES_PROG_DATA */
diff --git a/src/mesa/drivers/dri/i965/gen7_hs_state.c b/src/mesa/drivers/dri/i965/gen7_hs_state.c
index 290aea23924..fadea2351da 100644
--- a/src/mesa/drivers/dri/i965/gen7_hs_state.c
+++ b/src/mesa/drivers/dri/i965/gen7_hs_state.c
@@ -32,8 +32,7 @@ gen7_upload_tcs_push_constants(struct brw_context *brw)
{
struct brw_stage_state *stage_state = &brw->tcs.base;
/* BRW_NEW_TESS_PROGRAMS */
- const struct brw_tess_ctrl_program *tcp =
- (struct brw_tess_ctrl_program *) brw->tess_ctrl_program;
+ const struct brw_program *tcp = brw_program_const(brw->tess_ctrl_program);
bool active = brw->tess_eval_program;
if (active) {