aco: print final ir instead if printing asm is unsupported

Not a perfect replacement, but it's better than nothing.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25522>
This commit is contained in:
Georg Lehmann
2023-10-03 11:55:03 +02:00
committed by Marge Bot
parent 73605d46dd
commit 0e819465b3
+15 -15
View File
@@ -84,25 +84,25 @@ get_disasm_string(aco::Program* program, std::vector<uint32_t>& code, unsigned e
{
std::string disasm;
if (check_print_asm_support(program)) {
char* data = NULL;
size_t disasm_size = 0;
struct u_memstream mem;
if (u_memstream_open(&mem, &data, &disasm_size)) {
FILE* const memf = u_memstream_get(&mem);
char* data = NULL;
size_t disasm_size = 0;
struct u_memstream mem;
if (u_memstream_open(&mem, &data, &disasm_size)) {
FILE* const memf = u_memstream_get(&mem);
if (check_print_asm_support(program)) {
aco::print_asm(program, code, exec_size / 4u, memf);
fputc(0, memf);
u_memstream_close(&mem);
} else {
fprintf(memf, "Shader disassembly is not supported in the current configuration"
#ifndef LLVM_AVAILABLE
" (LLVM not available)"
#endif
", falling back to print_program.\n\n");
aco::aco_print_program(program, memf);
}
fputc(0, memf);
u_memstream_close(&mem);
disasm = std::string(data, data + disasm_size);
free(data);
} else {
disasm = "Shader disassembly is not supported in the current configuration"
#ifndef LLVM_AVAILABLE
" (LLVM not available)"
#endif
".\n";
}
return disasm;