struct {
struct brw_stage_state base;
- struct brw_tes_prog_data *prog_data;
/**
* True if the 3DSTATE_DS command most recently emitted to the 3D
/* Also, NULL out any stale program pointers. */
brw->vs.base.prog_data = NULL;
brw->tcs.base.prog_data = NULL;
- brw->tes.prog_data = NULL;
brw->tes.base.prog_data = NULL;
brw->gs.prog_data = NULL;
brw->gs.base.prog_data = NULL;
brw_upload_tes_prog(brw);
} else {
brw->tcs.base.prog_data = NULL;
- brw->tes.prog_data = NULL;
brw->tes.base.prog_data = NULL;
}
}
key, sizeof(*key),
program, program_size,
&prog_data, sizeof(prog_data),
- &stage_state->prog_offset, &brw->tes.prog_data);
+ &stage_state->prog_offset, &brw->tes.base.prog_data);
ralloc_free(mem_ctx);
return true;
if (!brw_search_cache(&brw->cache, BRW_CACHE_TES_PROG,
&key, sizeof(key),
- &stage_state->prog_offset, &brw->tes.prog_data)) {
+ &stage_state->prog_offset,
+ &brw->tes.base.prog_data)) {
bool success = brw_codegen_tes_prog(brw, current[MESA_SHADER_TESS_EVAL],
tep, &key);
assert(success);
(void)success;
}
- brw->tes.base.prog_data = &brw->tes.prog_data->base.base;
}
struct brw_context *brw = brw_context(ctx);
struct brw_tes_prog_key key;
uint32_t old_prog_offset = brw->tes.base.prog_offset;
- struct brw_tes_prog_data *old_prog_data = brw->tes.prog_data;
+ struct brw_stage_prog_data *old_prog_data = brw->tes.base.prog_data;
bool success;
struct gl_tess_eval_program *tep = (struct gl_tess_eval_program *)prog;
success = brw_codegen_tes_prog(brw, shader_prog, btep, &key);
brw->tes.base.prog_offset = old_prog_offset;
- brw->tes.prog_data = old_prog_data;
+ brw->tes.base.prog_data = old_prog_data;
return success;
}
return;
/* BRW_NEW_TES_PROG_DATA */
- const struct brw_stage_prog_data *prog_data = &brw->tes.prog_data->base.base;
+ const struct brw_stage_prog_data *prog_data = brw->tes.base.prog_data;
_mesa_shader_write_subroutine_indices(&brw->ctx, MESA_SHADER_TESS_EVAL);
/* _NEW_PROGRAM_CONSTANTS */
return;
/* BRW_NEW_TES_PROG_DATA */
- struct brw_stage_prog_data *prog_data = &brw->tes.prog_data->base.base;
+ struct brw_stage_prog_data *prog_data = brw->tes.base.prog_data;
brw_upload_ubo_surfaces(brw, prog->_LinkedShaders[MESA_SHADER_TESS_EVAL],
&brw->tes.base, prog_data);
if (prog) {
/* BRW_NEW_TES_PROG_DATA */
brw_upload_abo_surfaces(brw, prog->_LinkedShaders[MESA_SHADER_TESS_EVAL],
- &brw->tes.base, &brw->tes.prog_data->base.base);
+ &brw->tes.base, brw->tes.base.prog_data);
}
}
if (prog) {
/* BRW_NEW_TES_PROG_DATA, BRW_NEW_IMAGE_UNITS */
brw_upload_image_surfaces(brw, prog->_LinkedShaders[MESA_SHADER_TESS_EVAL],
- &brw->tes.base, &brw->tes.prog_data->base.base);
+ &brw->tes.base, brw->tes.base.prog_data);
}
}
if (brw->gs.prog_data) {
/* BRW_NEW_GS_PROG_DATA */
return brw->gs.prog_data->output_topology == _3DPRIM_POINTLIST;
- } else if (brw->tes.prog_data) {
+ } else if (brw->tes.base.prog_data) {
/* BRW_NEW_TES_PROG_DATA */
- return brw->tes.prog_data->output_topology ==
+ return brw_tes_prog_data(brw->tes.base.prog_data)->output_topology ==
BRW_TESS_OUTPUT_TOPOLOGY_POINT;
} else {
/* BRW_NEW_PRIMITIVE */
if (brw->gs.prog_data) {
/* BRW_NEW_GS_PROG_DATA */
return brw->gs.prog_data->output_topology == _3DPRIM_LINESTRIP;
- } else if (brw->tes.prog_data) {
+ } else if (brw->tes.base.prog_data) {
/* BRW_NEW_TES_PROG_DATA */
- return brw->tes.prog_data->output_topology ==
+ return brw_tes_prog_data(brw->tes.base.prog_data)->output_topology ==
BRW_TESS_OUTPUT_TOPOLOGY_LINE;
} else {
/* BRW_NEW_PRIMITIVE */
if (tep) {
/* BRW_NEW_TES_PROG_DATA */
- const struct brw_stage_prog_data *prog_data = &brw->tes.prog_data->base.base;
+ const struct brw_stage_prog_data *prog_data = brw->tes.base.prog_data;
_mesa_shader_write_subroutine_indices(&brw->ctx, MESA_SHADER_TESS_EVAL);
gen6_upload_push_constants(brw, &tep->program.Base, prog_data,
stage_state, AUB_TRACE_VS_CONSTANTS);
bool active = brw->tess_eval_program;
/* BRW_NEW_TES_PROG_DATA */
- const struct brw_tes_prog_data *tes_prog_data = brw->tes.prog_data;
- const struct brw_vue_prog_data *vue_prog_data = &tes_prog_data->base;
- const struct brw_stage_prog_data *prog_data = &vue_prog_data->base;
+ const struct brw_stage_prog_data *prog_data = stage_state->prog_data;
+ const struct brw_vue_prog_data *vue_prog_data =
+ brw_vue_prog_data(stage_state->prog_data);
+ const struct brw_tes_prog_data *tes_prog_data =
+ brw_tes_prog_data(stage_state->prog_data);
const unsigned thread_count = (devinfo->max_tes_threads - 1) <<
(brw->is_haswell ? HSW_DS_MAX_THREADS_SHIFT : GEN7_DS_MAX_THREADS_SHIFT);
/* BRW_NEW_TESS_PROGRAMS */
bool active = brw->tess_eval_program;
- const struct brw_tes_prog_data *tes_prog_data = brw->tes.prog_data;
+ const struct brw_tes_prog_data *tes_prog_data =
+ brw_tes_prog_data(brw->tes.base.prog_data);
if (active) {
BEGIN_BATCH(4);
unsigned hs_size = tess_present ? tcs_vue_prog_data->urb_entry_size : 1;
unsigned hs_entry_size_bytes = hs_size * 64;
/* BRW_NEW_TES_PROG_DATA */
- unsigned ds_size = tess_present ? brw->tes.prog_data->base.urb_entry_size : 1;
+ const struct brw_vue_prog_data *tes_vue_prog_data =
+ brw_vue_prog_data(brw->tes.base.prog_data);
+ unsigned ds_size = tess_present ? tes_vue_prog_data->urb_entry_size : 1;
unsigned ds_entry_size_bytes = ds_size * 64;
/* If we're just switching between programs with the same URB requirements,
bool active = brw->tess_eval_program;
/* BRW_NEW_TES_PROG_DATA */
- const struct brw_tes_prog_data *tes_prog_data = brw->tes.prog_data;
- const struct brw_vue_prog_data *vue_prog_data = &tes_prog_data->base;
- const struct brw_stage_prog_data *prog_data = &vue_prog_data->base;
+ const struct brw_stage_prog_data *prog_data = stage_state->prog_data;
+ const struct brw_vue_prog_data *vue_prog_data =
+ brw_vue_prog_data(stage_state->prog_data);
+ const struct brw_tes_prog_data *tes_prog_data =
+ brw_tes_prog_data(stage_state->prog_data);
const int ds_pkt_len = brw->gen >= 9 ? 11 : 9;
if (active) {