};
-/** 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;
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)
{
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) {
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) {
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;
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;
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,
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];
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;
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;
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;
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,
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));
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;
{
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 */
{
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) {