mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 22:38:05 +02:00
radeonsi: Only dump shaders with environment variable RADEON_DUMP_SHADERS=1.
This commit is contained in:
parent
7b11051a28
commit
4c4ef9c29a
2 changed files with 20 additions and 9 deletions
|
|
@ -156,8 +156,12 @@ void SICodeEmitter::emitState(MachineFunction & MF)
|
|||
|
||||
bool SICodeEmitter::runOnMachineFunction(MachineFunction &MF)
|
||||
{
|
||||
MF.dump();
|
||||
TM = &MF.getTarget();
|
||||
const AMDILSubtarget &STM = TM->getSubtarget<AMDILSubtarget>();
|
||||
|
||||
if (STM.dumpCode()) {
|
||||
MF.dump();
|
||||
}
|
||||
|
||||
emitState(MF);
|
||||
|
||||
|
|
|
|||
|
|
@ -543,6 +543,9 @@ int si_pipe_shader_create(
|
|||
unsigned char * inst_bytes;
|
||||
unsigned inst_byte_count;
|
||||
unsigned i;
|
||||
bool dump;
|
||||
|
||||
dump = debug_get_bool_option("RADEON_DUMP_SHADERS", FALSE);
|
||||
|
||||
radeon_llvm_context_init(&si_shader_ctx.radeon_bld);
|
||||
bld_base = &si_shader_ctx.radeon_bld.soa.bld_base;
|
||||
|
|
@ -568,14 +571,18 @@ int si_pipe_shader_create(
|
|||
radeon_llvm_finalize_module(&si_shader_ctx.radeon_bld);
|
||||
|
||||
mod = bld_base->base.gallivm->module;
|
||||
tgsi_dump(shader->tokens, 0);
|
||||
LLVMDumpModule(mod);
|
||||
radeon_llvm_compile(mod, &inst_bytes, &inst_byte_count, "SI", 1 /* dump */);
|
||||
fprintf(stderr, "SI CODE:\n");
|
||||
for (i = 0; i < inst_byte_count; i+=4 ) {
|
||||
fprintf(stderr, "%02x%02x%02x%02x\n", inst_bytes[i + 3],
|
||||
inst_bytes[i + 2], inst_bytes[i + 1],
|
||||
inst_bytes[i]);
|
||||
if (dump) {
|
||||
tgsi_dump(shader->tokens, 0);
|
||||
LLVMDumpModule(mod);
|
||||
}
|
||||
radeon_llvm_compile(mod, &inst_bytes, &inst_byte_count, "SI", dump);
|
||||
if (dump) {
|
||||
fprintf(stderr, "SI CODE:\n");
|
||||
for (i = 0; i < inst_byte_count; i+=4 ) {
|
||||
fprintf(stderr, "%02x%02x%02x%02x\n", inst_bytes[i + 3],
|
||||
inst_bytes[i + 2], inst_bytes[i + 1],
|
||||
inst_bytes[i]);
|
||||
}
|
||||
}
|
||||
|
||||
shader->num_sgprs = util_le32_to_cpu(*(uint32_t*)inst_bytes);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue