static void
brw_emit_gpgpu_walker(struct brw_context *brw)
{
- const struct brw_cs_prog_data *prog_data = brw->cs.prog_data;
+ const struct brw_cs_prog_data *prog_data =
+ brw_cs_prog_data(brw->cs.base.prog_data);
const GLuint *num_groups = brw->compute.num_work_groups;
uint32_t indirect_flag;
struct {
struct brw_stage_state base;
- struct brw_cs_prog_data *prog_data;
} cs;
/* RS hardware binding table */
key, sizeof(*key),
program, program_size,
&prog_data, sizeof(prog_data),
- &brw->cs.base.prog_offset, &brw->cs.prog_data);
+ &brw->cs.base.prog_offset, &brw->cs.base.prog_data);
ralloc_free(mem_ctx);
return true;
if (!brw_search_cache(&brw->cache, BRW_CACHE_CS_PROG,
&key, sizeof(key),
- &brw->cs.base.prog_offset, &brw->cs.prog_data)) {
+ &brw->cs.base.prog_offset,
+ &brw->cs.base.prog_data)) {
bool success =
brw_codegen_cs_prog(brw,
ctx->Shader.CurrentProgram[MESA_SHADER_COMPUTE],
(void) success;
assert(success);
}
- brw->cs.base.prog_data = &brw->cs.prog_data->base;
}
brw_setup_tex_for_precompile(brw, &key.tex, prog);
uint32_t old_prog_offset = brw->cs.base.prog_offset;
- struct brw_cs_prog_data *old_prog_data = brw->cs.prog_data;
+ struct brw_stage_prog_data *old_prog_data = brw->cs.base.prog_data;
bool success = brw_codegen_cs_prog(brw, shader_prog, bcp, &key);
brw->cs.base.prog_offset = old_prog_offset;
- brw->cs.prog_data = old_prog_data;
+ brw->cs.base.prog_data = old_prog_data;
return success;
}
brw->tes.base.prog_data = NULL;
brw->gs.base.prog_data = NULL;
brw->wm.base.prog_data = NULL;
- brw->cs.prog_data = NULL;
brw->cs.base.prog_data = NULL;
intel_batchbuffer_flush(brw);
/* BRW_NEW_CS_PROG_DATA */
brw_upload_ubo_surfaces(brw, prog->_LinkedShaders[MESA_SHADER_COMPUTE],
- &brw->cs.base, &brw->cs.prog_data->base);
+ &brw->cs.base, brw->cs.base.prog_data);
}
const struct brw_tracked_state brw_cs_ubo_surfaces = {
if (prog) {
/* BRW_NEW_CS_PROG_DATA */
brw_upload_abo_surfaces(brw, prog->_LinkedShaders[MESA_SHADER_COMPUTE],
- &brw->cs.base, &brw->cs.prog_data->base);
+ &brw->cs.base, brw->cs.base.prog_data);
}
}
if (prog) {
/* BRW_NEW_CS_PROG_DATA, BRW_NEW_IMAGE_UNITS, _NEW_TEXTURE */
brw_upload_image_surfaces(brw, prog->_LinkedShaders[MESA_SHADER_COMPUTE],
- &brw->cs.base, &brw->cs.prog_data->base);
+ &brw->cs.base, brw->cs.base.prog_data);
}
}
struct gl_shader_program *prog =
ctx->_Shader->CurrentProgram[MESA_SHADER_COMPUTE];
/* BRW_NEW_CS_PROG_DATA */
- const struct brw_cs_prog_data *cs_prog_data = brw->cs.prog_data;
+ const struct brw_cs_prog_data *cs_prog_data =
+ brw_cs_prog_data(brw->cs.base.prog_data);
if (prog && cs_prog_data->uses_num_work_groups) {
const unsigned surf_idx =
static void
brw_upload_cs_state(struct brw_context *brw)
{
- if (!brw->cs.prog_data)
+ if (!brw->cs.base.prog_data)
return;
uint32_t offset;
uint32_t *desc = (uint32_t*) brw_state_batch(brw, AUB_TRACE_SURFACE_STATE,
8 * 4, 64, &offset);
struct brw_stage_state *stage_state = &brw->cs.base;
- struct brw_cs_prog_data *cs_prog_data = brw->cs.prog_data;
- struct brw_stage_prog_data *prog_data = &cs_prog_data->base;
+ struct brw_stage_prog_data *prog_data = stage_state->prog_data;
+ struct brw_cs_prog_data *cs_prog_data = brw_cs_prog_data(prog_data);
const struct gen_device_info *devinfo = &brw->screen->devinfo;
if (INTEL_DEBUG & DEBUG_SHADER_TIME) {
if (cp) {
/* BRW_NEW_CS_PROG_DATA */
- struct brw_cs_prog_data *cs_prog_data = brw->cs.prog_data;
+ struct brw_cs_prog_data *cs_prog_data =
+ brw_cs_prog_data(brw->cs.base.prog_data);
_mesa_shader_write_subroutine_indices(&brw->ctx, MESA_SHADER_COMPUTE);
brw_upload_cs_push_constants(brw, &cp->program.Base, cs_prog_data,
(struct brw_compute_program *) brw->compute_program;
/* BRW_NEW_CS_PROG_DATA */
- const struct brw_stage_prog_data *prog_data = &brw->cs.prog_data->base;
+ const struct brw_stage_prog_data *prog_data = brw->cs.base.prog_data;
_mesa_shader_write_subroutine_indices(&brw->ctx, MESA_SHADER_COMPUTE);
/* _NEW_PROGRAM_CONSTANTS */