freedreno/ir3: Move the native code output to mesa_log as well.
I didn't feel like rewriting ir3_shader_disasm() off of FILE *s, so use the same trick as the disasm_info path above to write to memory and then hand the multi-line blob off to mesa_log. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9262>
This commit is contained in:
parent
9d458336c6
commit
88fe7ab4fa
|
@ -259,12 +259,20 @@ assemble_variant(struct ir3_shader_variant *v)
|
|||
}
|
||||
|
||||
if (dbg_enabled || shader_overridden) {
|
||||
fprintf(stdout, "Native code%s for unnamed %s shader %s with sha1 %s:\n",
|
||||
char *stream_data = NULL;
|
||||
size_t stream_size = 0;
|
||||
FILE *stream = open_memstream(&stream_data, &stream_size);
|
||||
|
||||
fprintf(stream, "Native code%s for unnamed %s shader %s with sha1 %s:\n",
|
||||
shader_overridden ? " (overridden)" : "",
|
||||
ir3_shader_stage(v), v->shader->nir->info.name, sha1buf);
|
||||
if (v->shader->type == MESA_SHADER_FRAGMENT)
|
||||
fprintf(stdout, "SIMD0\n");
|
||||
ir3_shader_disasm(v, v->bin, stdout);
|
||||
fprintf(stream, "SIMD0\n");
|
||||
ir3_shader_disasm(v, v->bin, stream);
|
||||
fclose(stream);
|
||||
|
||||
mesa_log_multiline(MESA_LOG_INFO, stream_data);
|
||||
free(stream_data);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue