This will be used by the on disk shader cache.
v2:
* Set in brw_compile_* rather than brw_codegen_*. (Jason)
Signed-off-by: Timothy Arceri <timothy.arceri@collabora.com>
[jordan.l.justen@intel.com: Only add to brw_stage_prog_data]
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
unsigned total_scratch;
unsigned total_shared;
+ unsigned program_size;
+
/**
* Register where the thread expects to find input data from the URB
* (typically uniforms, followed by vertex or fragment attributes).
prog_data->reg_blocks_0 = brw_register_blocks(simd16_grf_used);
}
- return g.get_assembly(final_assembly_size);
+ const unsigned *assembly = g.get_assembly(final_assembly_size);
+ prog_data->base.program_size = *final_assembly_size;
+ return assembly;
}
fs_reg *
g.generate_code(cfg, prog_data->simd_size);
- return g.get_assembly(final_assembly_size);
+ const unsigned *assembly = g.get_assembly(final_assembly_size);
+ prog_data->base.program_size = *final_assembly_size;
+ return assembly;
}
/**
{
const struct gen_device_info *devinfo = compiler->devinfo;
const bool is_scalar = compiler->scalar_stage[MESA_SHADER_TESS_EVAL];
+ const unsigned *assembly;
nir_shader *nir = nir_shader_clone(mem_ctx, src_shader);
nir->info.inputs_read = key->inputs_read;
g.generate_code(v.cfg, 8);
- return g.get_assembly(final_assembly_size);
+ assembly = g.get_assembly(final_assembly_size);
} else {
brw::vec4_tes_visitor v(compiler, log_data, key, prog_data,
nir, mem_ctx, shader_time_index);
if (unlikely(INTEL_DEBUG & DEBUG_TES))
v.dump_instructions();
- return brw_vec4_generate_assembly(compiler, log_data, mem_ctx, nir,
- &prog_data->base, v.cfg,
- final_assembly_size);
+ 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 = *final_assembly_size;
+ return assembly;
}
final_assembly_size);
}
+ prog_data->base.base.program_size = *final_assembly_size;
return assembly;
}
g.enable_debug(name);
}
g.generate_code(v.cfg, 8);
- return g.get_assembly(final_assembly_size);
+ const unsigned *ret = g.get_assembly(final_assembly_size);
+ prog_data->base.base.program_size = *final_assembly_size;
+ return ret;
}
}
if (v.run()) {
/* Success! Backup is not needed */
ralloc_free(param);
- return brw_vec4_generate_assembly(compiler, log_data, mem_ctx,
- shader, &prog_data->base, v.cfg,
- final_assembly_size);
+ 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;
} else {
/* These variables could be modified by the execution of the GS
* visitor if it packed the uniforms in the push constant buffer.
}
delete gs;
+ prog_data->base.base.program_size = *final_assembly_size;
return ret;
}
const struct gen_device_info *devinfo = compiler->devinfo;
struct brw_vue_prog_data *vue_prog_data = &prog_data->base;
const bool is_scalar = compiler->scalar_stage[MESA_SHADER_TESS_CTRL];
+ const unsigned *assembly;
nir_shader *nir = nir_shader_clone(mem_ctx, src_shader);
nir->info.outputs_written = key->outputs_written;
g.generate_code(v.cfg, 8);
- return g.get_assembly(final_assembly_size);
+ assembly = g.get_assembly(final_assembly_size);
} else {
vec4_tcs_visitor v(compiler, log_data, key, prog_data,
nir, mem_ctx, shader_time_index, &input_vue_map);
v.dump_instructions();
- return brw_vec4_generate_assembly(compiler, log_data, mem_ctx, nir,
- &prog_data->base, v.cfg,
- final_assembly_size);
+ 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 = *final_assembly_size;
+ return assembly;
}