diff options
author | Darren Powell <[email protected]> | 2014-03-31 18:00:28 -0400 |
---|---|---|
committer | Tom Stellard <[email protected]> | 2014-04-17 19:37:58 -0400 |
commit | bc86690f137a71a6f1cdcc0393a4b3f181df7240 (patch) | |
tree | 00fcb3e0adebc68d28e7328d5752fae3a8690c90 /src/gallium/drivers/radeonsi/si_shader.c | |
parent | 9f9ab8ec0dd9739e90de5aa5b8434d105d351f31 (diff) |
radeonsi: Added Diag Handler to receive LLVM Error messages
Reviewed-by: Tom Stellard <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_shader.c')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_shader.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index e4390eeac1f..0d070d3cef6 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -2293,14 +2293,19 @@ static void preload_streamout_buffers(struct si_shader_context *si_shader_ctx) int si_compile_llvm(struct si_context *sctx, struct si_pipe_shader *shader, LLVMModuleRef mod) { + unsigned r; /* llvm_compile result */ unsigned i; uint32_t *ptr; struct radeon_shader_binary binary; bool dump = r600_can_dump_shader(&sctx->screen->b, shader->selector ? shader->selector->tokens : NULL); + const char * gpu_family = r600_get_llvm_processor_name(sctx->screen->b.family); + + /* Use LLVM to compile shader */ memset(&binary, 0, sizeof(binary)); - radeon_llvm_compile(mod, &binary, - r600_get_llvm_processor_name(sctx->screen->b.family), dump); + r = radeon_llvm_compile(mod, &binary, gpu_family, dump); + + /* Output binary dump if rscreen->debug_flags are set */ if (dump && ! binary.disassembled) { fprintf(stderr, "SI CODE:\n"); for (i = 0; i < binary.code_size; i+=4 ) { @@ -2313,6 +2318,7 @@ int si_compile_llvm(struct si_context *sctx, struct si_pipe_shader *shader, /* XXX: We may be able to emit some of these values directly rather than * extracting fields to be emitted later. */ + /* Parse config data in compiled binary */ for (i = 0; i < binary.config_size; i+= 8) { unsigned reg = util_le32_to_cpu(*(uint32_t*)(binary.config + i)); unsigned value = util_le32_to_cpu(*(uint32_t*)(binary.config + i + 4)); @@ -2361,7 +2367,7 @@ int si_compile_llvm(struct si_context *sctx, struct si_pipe_shader *shader, free(binary.code); free(binary.config); - return 0; + return r; } /* Generate code for the hardware VS shader stage to go with a geometry shader */ |