struct nir_shader *nir,
struct brw_wm_prog_key *wm_key,
bool use_repclear,
- struct brw_wm_prog_data *wm_prog_data,
- unsigned *program_size)
+ struct brw_wm_prog_data *wm_prog_data)
{
const struct brw_compiler *compiler = blorp->compiler;
const unsigned *program =
brw_compile_fs(compiler, blorp->driver_ctx, mem_ctx, wm_key,
wm_prog_data, nir, NULL, -1, -1, false, use_repclear,
- NULL, program_size, NULL);
+ NULL, NULL);
return program;
}
const unsigned *
blorp_compile_vs(struct blorp_context *blorp, void *mem_ctx,
struct nir_shader *nir,
- struct brw_vs_prog_data *vs_prog_data,
- unsigned *program_size)
+ struct brw_vs_prog_data *vs_prog_data)
{
const struct brw_compiler *compiler = blorp->compiler;
const unsigned *program =
brw_compile_vs(compiler, blorp->driver_ctx, mem_ctx,
&vs_key, vs_prog_data, nir,
- false, -1, program_size, NULL);
+ false, -1, NULL);
return program;
}
void *mem_ctx = ralloc_context(NULL);
const unsigned *program;
- unsigned program_size;
struct brw_wm_prog_data prog_data;
nir_shader *nir = brw_blorp_build_nir_shader(blorp, mem_ctx, prog_key);
wm_key.multisample_fbo = prog_key->rt_samples > 1;
program = blorp_compile_fs(blorp, mem_ctx, nir, &wm_key, false,
- &prog_data, &program_size);
+ &prog_data);
bool result =
blorp->upload_shader(blorp, prog_key, sizeof(*prog_key),
- program, program_size,
+ program, prog_data.base.program_size,
&prog_data.base, sizeof(prog_data),
¶ms->wm_prog_kernel, ¶ms->wm_prog_data);
brw_blorp_init_wm_prog_key(&wm_key);
struct brw_wm_prog_data prog_data;
- unsigned program_size;
const unsigned *program =
blorp_compile_fs(blorp, mem_ctx, b.shader, &wm_key, use_replicated_data,
- &prog_data, &program_size);
+ &prog_data);
bool result =
blorp->upload_shader(blorp, &blorp_key, sizeof(blorp_key),
- program, program_size,
+ program, prog_data.base.program_size,
&prog_data.base, sizeof(prog_data),
¶ms->wm_prog_kernel, ¶ms->wm_prog_data);
struct brw_vs_prog_data vs_prog_data;
memset(&vs_prog_data, 0, sizeof(vs_prog_data));
- unsigned program_size;
const unsigned *program =
- blorp_compile_vs(blorp, mem_ctx, b.shader, &vs_prog_data, &program_size);
+ blorp_compile_vs(blorp, mem_ctx, b.shader, &vs_prog_data);
bool result =
blorp->upload_shader(blorp, &blorp_key, sizeof(blorp_key),
- program, program_size,
+ program, vs_prog_data.base.base.program_size,
&vs_prog_data.base.base, sizeof(vs_prog_data),
¶ms->vs_prog_kernel, ¶ms->vs_prog_data);
wm_key.multisample_fbo = true;
struct brw_wm_prog_data prog_data;
- unsigned program_size;
const unsigned *program =
blorp_compile_fs(blorp, mem_ctx, b.shader, &wm_key, false,
- &prog_data, &program_size);
+ &prog_data);
bool result =
blorp->upload_shader(blorp, &blorp_key, sizeof(blorp_key),
- program, program_size,
+ program, prog_data.base.program_size,
&prog_data.base, sizeof(prog_data),
¶ms->wm_prog_kernel, ¶ms->wm_prog_data);
struct nir_shader *nir,
struct brw_wm_prog_key *wm_key,
bool use_repclear,
- struct brw_wm_prog_data *wm_prog_data,
- unsigned *program_size);
+ struct brw_wm_prog_data *wm_prog_data);
const unsigned *
blorp_compile_vs(struct blorp_context *blorp, void *mem_ctx,
struct nir_shader *nir,
- struct brw_vs_prog_data *vs_prog_data,
- unsigned *program_size);
+ struct brw_vs_prog_data *vs_prog_data);
bool
blorp_ensure_sf_program(struct blorp_context *blorp,
const struct nir_shader *shader,
bool use_legacy_snorm_formula,
int shader_time_index,
- unsigned *final_assembly_size,
char **error_str);
/**
struct brw_tcs_prog_data *prog_data,
const struct nir_shader *nir,
int shader_time_index,
- unsigned *final_assembly_size,
char **error_str);
/**
const struct nir_shader *shader,
struct gl_program *prog,
int shader_time_index,
- unsigned *final_assembly_size,
char **error_str);
/**
const struct nir_shader *shader,
struct gl_program *prog,
int shader_time_index,
- unsigned *final_assembly_size,
char **error_str);
/**
int shader_time_index16,
bool allow_spilling,
bool use_rep_send, struct brw_vue_map *vue_map,
- unsigned *final_assembly_size,
char **error_str);
/**
struct brw_cs_prog_data *prog_data,
const struct nir_shader *shader,
int shader_time_index,
- unsigned *final_assembly_size,
char **error_str);
static inline uint32_t
int shader_time_index8, int shader_time_index16,
bool allow_spilling,
bool use_rep_send, struct brw_vue_map *vue_map,
- unsigned *final_assembly_size,
char **error_str)
{
const struct gen_device_info *devinfo = compiler->devinfo;
prog_data->reg_blocks_0 = brw_register_blocks(simd16_grf_used);
}
- const unsigned *assembly = g.get_assembly(final_assembly_size);
- prog_data->base.program_size = *final_assembly_size;
- return assembly;
+ return g.get_assembly(&prog_data->base.program_size);
}
fs_reg *
struct brw_cs_prog_data *prog_data,
const nir_shader *src_shader,
int shader_time_index,
- unsigned *final_assembly_size,
char **error_str)
{
nir_shader *shader = nir_shader_clone(mem_ctx, src_shader);
g.generate_code(cfg, prog_data->simd_size);
- const unsigned *assembly = g.get_assembly(final_assembly_size);
- prog_data->base.program_size = *final_assembly_size;
- return assembly;
+ return g.get_assembly(&prog_data->base.program_size);
}
/**
const nir_shader *src_shader,
struct gl_program *prog,
int shader_time_index,
- unsigned *final_assembly_size,
char **error_str)
{
const struct gen_device_info *devinfo = compiler->devinfo;
g.generate_code(v.cfg, 8);
- assembly = g.get_assembly(final_assembly_size);
+ assembly = g.get_assembly(&prog_data->base.base.program_size);
} else {
brw::vec4_tes_visitor v(compiler, log_data, key, prog_data,
nir, mem_ctx, shader_time_index);
assembly = brw_vec4_generate_assembly(compiler, log_data, mem_ctx, nir,
&prog_data->base, v.cfg,
- final_assembly_size);
+ &prog_data->base.base.program_size);
}
- prog_data->base.base.program_size = *final_assembly_size;
return assembly;
}
const nir_shader *src_shader,
bool use_legacy_snorm_formula,
int shader_time_index,
- unsigned *final_assembly_size,
char **error_str)
{
const bool is_scalar = compiler->scalar_stage[MESA_SHADER_VERTEX];
g.enable_debug(debug_name);
}
g.generate_code(v.cfg, 8);
- assembly = g.get_assembly(final_assembly_size);
+ assembly = g.get_assembly(&prog_data->base.base.program_size);
}
if (!assembly) {
assembly = brw_vec4_generate_assembly(compiler, log_data, mem_ctx,
shader, &prog_data->base, v.cfg,
- final_assembly_size);
+ &prog_data->base.base.program_size);
}
- prog_data->base.base.program_size = *final_assembly_size;
return assembly;
}
const nir_shader *src_shader,
struct gl_program *prog,
int shader_time_index,
- unsigned *final_assembly_size,
char **error_str)
{
struct brw_gs_compile c;
g.enable_debug(name);
}
g.generate_code(v.cfg, 8);
- const unsigned *ret = g.get_assembly(final_assembly_size);
- prog_data->base.base.program_size = *final_assembly_size;
- return ret;
+ return g.get_assembly(&prog_data->base.base.program_size);
}
}
if (v.run()) {
/* Success! Backup is not needed */
ralloc_free(param);
- const unsigned *ret =
- brw_vec4_generate_assembly(compiler, log_data, mem_ctx, shader,
- &prog_data->base, v.cfg,
- final_assembly_size);
- prog_data->base.base.program_size = *final_assembly_size;
- return ret;
+ return brw_vec4_generate_assembly(compiler, log_data, mem_ctx,
+ shader, &prog_data->base, v.cfg,
+ &prog_data->base.base.
+ program_size);
} else {
/* These variables could be modified by the execution of the GS
* visitor if it packed the uniforms in the push constant buffer.
} else {
ret = brw_vec4_generate_assembly(compiler, log_data, mem_ctx, shader,
&prog_data->base, gs->cfg,
- final_assembly_size);
+ &prog_data->base.base.program_size);
}
delete gs;
- prog_data->base.base.program_size = *final_assembly_size;
return ret;
}
struct brw_tcs_prog_data *prog_data,
const nir_shader *src_shader,
int shader_time_index,
- unsigned *final_assembly_size,
char **error_str)
{
const struct gen_device_info *devinfo = compiler->devinfo;
g.generate_code(v.cfg, 8);
- assembly = g.get_assembly(final_assembly_size);
+ assembly = g.get_assembly(&prog_data->base.base.program_size);
} else {
vec4_tcs_visitor v(compiler, log_data, key, prog_data,
nir, mem_ctx, shader_time_index, &input_vue_map);
assembly = brw_vec4_generate_assembly(compiler, log_data, mem_ctx, nir,
&prog_data->base, v.cfg,
- final_assembly_size);
+ &prog_data->base.base.program_size);
}
- prog_data->base.base.program_size = *final_assembly_size;
return assembly;
}
nir->info.outputs_written,
nir->info.separate_shader);
- unsigned code_size;
const unsigned *shader_code =
brw_compile_vs(compiler, NULL, mem_ctx, &key, &prog_data, nir,
- false, -1, &code_size, NULL);
+ false, -1, NULL);
if (shader_code == NULL) {
ralloc_free(mem_ctx);
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
}
+ unsigned code_size = prog_data.base.base.program_size;
bin = anv_pipeline_upload_kernel(pipeline, cache, sha1, 20,
shader_code, code_size,
&prog_data.base.base, sizeof(prog_data),
tes_key.inputs_read = tcs_key.outputs_written;
tes_key.patch_inputs_read = tcs_key.patch_outputs_written;
- unsigned code_size;
const int shader_time_index = -1;
const unsigned *shader_code;
shader_code =
brw_compile_tcs(compiler, NULL, mem_ctx, &tcs_key, &tcs_prog_data,
- tcs_nir, shader_time_index, &code_size, NULL);
+ tcs_nir, shader_time_index, NULL);
if (shader_code == NULL) {
ralloc_free(mem_ctx);
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
}
+ unsigned code_size = tcs_prog_data.base.base.program_size;
tcs_bin = anv_pipeline_upload_kernel(pipeline, cache,
tcs_sha1, sizeof(tcs_sha1),
shader_code, code_size,
shader_code =
brw_compile_tes(compiler, NULL, mem_ctx, &tes_key,
&tcs_prog_data.base.vue_map, &tes_prog_data, tes_nir,
- NULL, shader_time_index, &code_size, NULL);
+ NULL, shader_time_index, NULL);
if (shader_code == NULL) {
ralloc_free(mem_ctx);
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
}
+ code_size = tes_prog_data.base.base.program_size;
tes_bin = anv_pipeline_upload_kernel(pipeline, cache,
tes_sha1, sizeof(tes_sha1),
shader_code, code_size,
nir->info.outputs_written,
nir->info.separate_shader);
- unsigned code_size;
const unsigned *shader_code =
brw_compile_gs(compiler, NULL, mem_ctx, &key, &prog_data, nir,
- NULL, -1, &code_size, NULL);
+ NULL, -1, NULL);
if (shader_code == NULL) {
ralloc_free(mem_ctx);
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
}
/* TODO: SIMD8 GS */
+ const unsigned code_size = prog_data.base.base.program_size;
bin = anv_pipeline_upload_kernel(pipeline, cache, sha1, 20,
shader_code, code_size,
&prog_data.base.base, sizeof(prog_data),
anv_fill_binding_table(&prog_data.base, num_rts);
- unsigned code_size;
const unsigned *shader_code =
brw_compile_fs(compiler, NULL, mem_ctx, &key, &prog_data, nir,
- NULL, -1, -1, true, false, NULL, &code_size, NULL);
+ NULL, -1, -1, true, false, NULL, NULL);
if (shader_code == NULL) {
ralloc_free(mem_ctx);
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
}
+ unsigned code_size = prog_data.base.program_size;
bin = anv_pipeline_upload_kernel(pipeline, cache, sha1, 20,
shader_code, code_size,
&prog_data.base, sizeof(prog_data),
anv_fill_binding_table(&prog_data.base, 1);
- unsigned code_size;
const unsigned *shader_code =
brw_compile_cs(compiler, NULL, mem_ctx, &key, &prog_data, nir,
- -1, &code_size, NULL);
+ -1, NULL);
if (shader_code == NULL) {
ralloc_free(mem_ctx);
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
}
+ const unsigned code_size = prog_data.base.program_size;
bin = anv_pipeline_upload_kernel(pipeline, cache, sha1, 20,
shader_code, code_size,
&prog_data.base, sizeof(prog_data),
const struct gen_device_info *devinfo = &brw->screen->devinfo;
const GLuint *program;
void *mem_ctx = ralloc_context(NULL);
- GLuint program_size;
struct brw_cs_prog_data prog_data;
bool start_busy = false;
double start_time = 0;
char *error_str;
program = brw_compile_cs(brw->screen->compiler, brw, mem_ctx, key,
&prog_data, cp->program.nir, st_index,
- &program_size, &error_str);
+ &error_str);
if (program == NULL) {
cp->program.sh.data->LinkStatus = linking_failure;
ralloc_strcat(&cp->program.sh.data->InfoLog, error_str);
ralloc_steal(NULL, prog_data.base.pull_param);
brw_upload_cache(&brw->cache, BRW_CACHE_CS_PROG,
key, sizeof(*key),
- program, program_size,
+ program, prog_data.base.program_size,
&prog_data, sizeof(prog_data),
&brw->cs.base.prog_offset, &brw->cs.base.prog_data);
ralloc_free(mem_ctx);
start_time = get_time();
}
- unsigned program_size;
char *error_str;
const unsigned *program =
brw_compile_gs(brw->screen->compiler, brw, mem_ctx, key,
&prog_data, gp->program.nir, &gp->program,
- st_index, &program_size, &error_str);
+ st_index, &error_str);
if (program == NULL) {
ralloc_strcat(&gp->program.sh.data->InfoLog, error_str);
_mesa_problem(NULL, "Failed to compile geometry shader: %s\n", error_str);
ralloc_steal(NULL, prog_data.base.base.pull_param);
brw_upload_cache(&brw->cache, BRW_CACHE_GS_PROG,
key, sizeof(*key),
- program, program_size,
+ program, prog_data.base.base.program_size,
&prog_data, sizeof(prog_data),
&stage_state->prog_offset, &brw->gs.base.prog_data);
ralloc_free(mem_ctx);
start_time = get_time();
}
- unsigned program_size;
char *error_str;
const unsigned *program =
brw_compile_tcs(compiler, brw, mem_ctx, key, &prog_data, nir, st_index,
- &program_size, &error_str);
+ &error_str);
if (program == NULL) {
if (tep) {
tep->program.sh.data->LinkStatus = linking_failure;
ralloc_steal(NULL, prog_data.base.base.pull_param);
brw_upload_cache(&brw->cache, BRW_CACHE_TCS_PROG,
key, sizeof(*key),
- program, program_size,
+ program, prog_data.base.base.program_size,
&prog_data, sizeof(prog_data),
&stage_state->prog_offset, &brw->tcs.base.prog_data);
ralloc_free(mem_ctx);
brw_compute_tess_vue_map(&input_vue_map, key->inputs_read,
key->patch_inputs_read);
- unsigned program_size;
char *error_str;
const unsigned *program =
brw_compile_tes(compiler, brw, mem_ctx, key, &input_vue_map, &prog_data,
- nir, &tep->program, st_index, &program_size, &error_str);
+ nir, &tep->program, st_index, &error_str);
if (program == NULL) {
tep->program.sh.data->LinkStatus = linking_failure;
ralloc_strcat(&tep->program.sh.data->InfoLog, error_str);
ralloc_steal(NULL, prog_data.base.base.pull_param);
brw_upload_cache(&brw->cache, BRW_CACHE_TES_PROG,
key, sizeof(*key),
- program, program_size,
+ program, prog_data.base.base.program_size,
&prog_data, sizeof(prog_data),
&stage_state->prog_offset, &brw->tes.base.prog_data);
ralloc_free(mem_ctx);
{
const struct brw_compiler *compiler = brw->screen->compiler;
const struct gen_device_info *devinfo = &brw->screen->devinfo;
- GLuint program_size;
const GLuint *program;
struct brw_vs_prog_data prog_data;
struct brw_stage_prog_data *stage_prog_data = &prog_data.base.base;
program = brw_compile_vs(compiler, brw, mem_ctx, key, &prog_data,
vp->program.nir,
!_mesa_is_gles3(&brw->ctx),
- st_index, &program_size, &error_str);
+ st_index, &error_str);
if (program == NULL) {
if (!vp->program.is_arb_asm) {
vp->program.sh.data->LinkStatus = linking_failure;
ralloc_steal(NULL, prog_data.base.base.param);
ralloc_steal(NULL, prog_data.base.base.pull_param);
brw_upload_cache(&brw->cache, BRW_CACHE_VS_PROG,
- key, sizeof(struct brw_vs_prog_key),
- program, program_size,
- &prog_data, sizeof(prog_data),
- &brw->vs.base.prog_offset, &brw->vs.base.prog_data);
+ key, sizeof(struct brw_vs_prog_key),
+ program, prog_data.base.base.program_size,
+ &prog_data, sizeof(prog_data),
+ &brw->vs.base.prog_offset, &brw->vs.base.prog_data);
ralloc_free(mem_ctx);
return true;
void *mem_ctx = ralloc_context(NULL);
struct brw_wm_prog_data prog_data;
const GLuint *program;
- GLuint program_size;
bool start_busy = false;
double start_time = 0;
key, &prog_data, fp->program.nir,
&fp->program, st_index8, st_index16,
true, false, vue_map,
- &program_size, &error_str);
+ &error_str);
if (program == NULL) {
if (!fp->program.is_arb_asm) {
ralloc_steal(NULL, prog_data.base.pull_param);
brw_upload_cache(&brw->cache, BRW_CACHE_FS_PROG,
key, sizeof(struct brw_wm_prog_key),
- program, program_size,
+ program, prog_data.base.program_size,
&prog_data, sizeof(prog_data),
&brw->wm.base.prog_offset, &brw->wm.base.prog_data);