It's shorter and will also be useful when I adjust cloning soon.
Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com>
struct brw_cs_prog_data prog_data;
bool start_busy = false;
double start_time = 0;
+ nir_shader *nir = cp->program.nir;
memset(&prog_data, 0, sizeof(prog_data));
assign_cs_binding_table_offsets(devinfo, &cp->program, &prog_data);
- brw_nir_setup_glsl_uniforms(mem_ctx, cp->program.nir,
+ brw_nir_setup_glsl_uniforms(mem_ctx, nir,
&cp->program, &prog_data.base, true);
if (unlikely(brw->perf_debug)) {
char *error_str;
program = brw_compile_cs(brw->screen->compiler, brw, mem_ctx, key,
- &prog_data, cp->program.nir, st_index,
- &error_str);
+ &prog_data, nir, st_index, &error_str);
if (program == NULL) {
cp->program.sh.data->LinkStatus = LINKING_FAILURE;
ralloc_strcat(&cp->program.sh.data->InfoLog, error_str);
void *mem_ctx = ralloc_context(NULL);
+ nir_shader *nir = gp->program.nir;
+
assign_gs_binding_table_offsets(devinfo, &gp->program, &prog_data);
- brw_nir_setup_glsl_uniforms(mem_ctx, gp->program.nir, &gp->program,
+ brw_nir_setup_glsl_uniforms(mem_ctx, nir, &gp->program,
&prog_data.base.base,
compiler->scalar_stage[MESA_SHADER_GEOMETRY]);
- brw_nir_analyze_ubo_ranges(compiler, gp->program.nir, NULL,
+ brw_nir_analyze_ubo_ranges(compiler, nir, NULL,
prog_data.base.base.ubo_ranges);
- uint64_t outputs_written = gp->program.nir->info.outputs_written;
+ uint64_t outputs_written = nir->info.outputs_written;
brw_compute_vue_map(devinfo,
&prog_data.base.vue_map, outputs_written,
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, &error_str);
+ &prog_data, nir, &gp->program, 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);
brw_nir_setup_glsl_uniforms(mem_ctx, nir, &tcp->program,
&prog_data.base.base,
compiler->scalar_stage[MESA_SHADER_TESS_CTRL]);
- brw_nir_analyze_ubo_ranges(compiler, tcp->program.nir, NULL,
+ brw_nir_analyze_ubo_ranges(compiler, nir, NULL,
prog_data.base.base.ubo_ranges);
} else {
/* Upload the Patch URB Header as the first two uniforms.
brw_nir_setup_glsl_uniforms(mem_ctx, nir, &tep->program,
&prog_data.base.base,
compiler->scalar_stage[MESA_SHADER_TESS_EVAL]);
- brw_nir_analyze_ubo_ranges(compiler, tep->program.nir, NULL,
+ brw_nir_analyze_ubo_ranges(compiler, nir, NULL,
prog_data.base.base.ubo_ranges);
int st_index = -1;
mem_ctx = ralloc_context(NULL);
+ nir_shader *nir = vp->program.nir;
+
brw_assign_common_binding_table_offsets(devinfo, &vp->program,
&prog_data.base.base, 0);
if (!vp->program.is_arb_asm) {
- brw_nir_setup_glsl_uniforms(mem_ctx, vp->program.nir, &vp->program,
+ brw_nir_setup_glsl_uniforms(mem_ctx, nir, &vp->program,
&prog_data.base.base,
compiler->scalar_stage[MESA_SHADER_VERTEX]);
- brw_nir_analyze_ubo_ranges(compiler, vp->program.nir, key,
+ brw_nir_analyze_ubo_ranges(compiler, nir, key,
prog_data.base.base.ubo_ranges);
} else {
- brw_nir_setup_arb_uniforms(mem_ctx, vp->program.nir, &vp->program,
+ brw_nir_setup_arb_uniforms(mem_ctx, nir, &vp->program,
&prog_data.base.base);
}
uint64_t outputs_written =
- brw_vs_outputs_written(brw, key, vp->program.nir->info.outputs_written);
+ brw_vs_outputs_written(brw, key, nir->info.outputs_written);
brw_compute_vue_map(devinfo,
&prog_data.base.vue_map, outputs_written,
- vp->program.nir->info.separate_shader);
+ nir->info.separate_shader);
if (0) {
_mesa_fprint_program_opt(stderr, &vp->program, PROG_PRINT_DEBUG, true);
*/
char *error_str;
program = brw_compile_vs(compiler, brw, mem_ctx, key, &prog_data,
- vp->program.nir,
- st_index, &error_str);
+ nir, st_index, &error_str);
if (program == NULL) {
if (!vp->program.is_arb_asm) {
vp->program.sh.data->LinkStatus = LINKING_FAILURE;
bool start_busy = false;
double start_time = 0;
+ nir_shader *nir = fp->program.nir;
+
memset(&prog_data, 0, sizeof(prog_data));
/* Use ALT floating point mode for ARB programs so that 0^0 == 1. */
assign_fs_binding_table_offsets(devinfo, &fp->program, key, &prog_data);
if (!fp->program.is_arb_asm) {
- brw_nir_setup_glsl_uniforms(mem_ctx, fp->program.nir, &fp->program,
+ brw_nir_setup_glsl_uniforms(mem_ctx, nir, &fp->program,
&prog_data.base, true);
- brw_nir_analyze_ubo_ranges(brw->screen->compiler, fp->program.nir,
+ brw_nir_analyze_ubo_ranges(brw->screen->compiler, nir,
NULL, prog_data.base.ubo_ranges);
} else {
- brw_nir_setup_arb_uniforms(mem_ctx, fp->program.nir, &fp->program,
- &prog_data.base);
+ brw_nir_setup_arb_uniforms(mem_ctx, nir, &fp->program, &prog_data.base);
if (unlikely(INTEL_DEBUG & DEBUG_WM))
brw_dump_arb_asm("fragment", &fp->program);
char *error_str = NULL;
program = brw_compile_fs(brw->screen->compiler, brw, mem_ctx,
- key, &prog_data, fp->program.nir,
+ key, &prog_data, nir,
&fp->program, st_index8, st_index16, st_index32,
true, false, vue_map,
&error_str);