fprintf(f, "%s:\n\n", radv_get_shader_name(shader, stage));
+ if (shader->spirv) {
+ fprintf(f, "SPIRV:\n");
+ radv_print_spirv(shader->spirv, shader->spirv_size, f);
+ }
+
if (shader->nir) {
fprintf(f, "NIR:\n");
nir_print_shader(shader->nir, f);
}
void
-radv_print_spirv(struct radv_shader_module *module, FILE *fp)
+radv_print_spirv(uint32_t *data, uint32_t size, FILE *fp)
{
char path[] = "/tmp/fileXXXXXX";
char line[2048], command[128];
if (fd < 0)
return;
- if (write(fd, module->data, module->size) == -1)
+ if (write(fd, data, size) == -1)
goto fail;
sprintf(command, "spirv-dis %s", path);
radv_check_gpu_hangs(struct radv_queue *queue, struct radeon_winsys_cs *cs);
void
-radv_print_spirv(struct radv_shader_module *module, FILE *fp);
+radv_print_spirv(uint32_t *data, uint32_t size, FILE *fp);
#endif
assert(module->size % 4 == 0);
if (device->debug_flags & RADV_DEBUG_DUMP_SPIRV)
- radv_print_spirv(module, stderr);
+ radv_print_spirv(spirv, module->size, stderr);
uint32_t num_spec_entries = 0;
struct nir_spirv_specialization *spec_entries = NULL;
variant->disasm_string = binary.disasm_string;
if (!gs_copy_shader && !module->nir) {
variant->nir = shader;
+ variant->spirv = (uint32_t *)module->data;
+ variant->spirv_size = module->size;
}
} else {
free(binary.disasm_string);