diff options
author | Marek Olšák <[email protected]> | 2015-12-27 23:22:14 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2016-01-03 22:41:16 +0100 |
commit | b6d95248f0c423dfde573617cffddb4fa2d3c8ab (patch) | |
tree | 780485e2f687a0fcdf06c14aa89dbd551cf4edcf /src | |
parent | 7fa6bb47e3a19f4ad745f7a9fc77d24c7482d045 (diff) |
radeonsi: move si_shader_binary_upload out of si_shader_binary_read
Reviewed-by: Edward O'Callaghan <[email protected]>
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_compute.c | 1 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_shader.c | 16 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_shader.h | 4 |
3 files changed, 10 insertions, 11 deletions
diff --git a/src/gallium/drivers/radeonsi/si_compute.c b/src/gallium/drivers/radeonsi/si_compute.c index 469e1cc0bcd..3d10e0eeb5c 100644 --- a/src/gallium/drivers/radeonsi/si_compute.c +++ b/src/gallium/drivers/radeonsi/si_compute.c @@ -138,6 +138,7 @@ static void *si_create_compute_state( init_scratch_buffer(sctx, program); si_shader_binary_read(sctx->screen, &program->shader, &sctx->b.debug, TGSI_PROCESSOR_COMPUTE); + si_shader_binary_upload(sctx->screen, &program->shader); #endif program->input_buffer = si_resource_create_custom(sctx->b.b.screen, diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index 779550bfb95..c7e38b4eed4 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -3887,16 +3887,12 @@ static void si_shader_dump_disassembly(const struct radeon_shader_binary *binary } } -int si_shader_binary_read(struct si_screen *sscreen, struct si_shader *shader, - struct pipe_debug_callback *debug, unsigned processor) +void si_shader_binary_read(struct si_screen *sscreen, struct si_shader *shader, + struct pipe_debug_callback *debug, unsigned processor) { const struct radeon_shader_binary *binary = &shader->binary; - int r; si_shader_binary_read_config(sscreen, shader, 0); - r = si_shader_binary_upload(sscreen, shader); - if (r) - return r; if (r600_can_dump_shader(&sscreen->b, processor)) { if (!(sscreen->b.debug_flags & DBG_NO_ASM)) @@ -3913,8 +3909,6 @@ int si_shader_binary_read(struct si_screen *sscreen, struct si_shader *shader, "Shader Stats: SGPRS: %d VGPRS: %d Code Size: %d LDS: %d Scratch: %d", shader->num_sgprs, shader->num_vgprs, binary->code_size, shader->lds_size, shader->scratch_bytes_per_wave); - - return 0; } int si_compile_llvm(struct si_screen *sscreen, struct si_shader *shader, @@ -3939,7 +3933,11 @@ int si_compile_llvm(struct si_screen *sscreen, struct si_shader *shader, return r; } - r = si_shader_binary_read(sscreen, shader, debug, processor); + si_shader_binary_read(sscreen, shader, debug, processor); + + r = si_shader_binary_upload(sscreen, shader); + if (r) + return r; FREE(shader->binary.config); FREE(shader->binary.rodata); diff --git a/src/gallium/drivers/radeonsi/si_shader.h b/src/gallium/drivers/radeonsi/si_shader.h index 236148c34da..882f6980502 100644 --- a/src/gallium/drivers/radeonsi/si_shader.h +++ b/src/gallium/drivers/radeonsi/si_shader.h @@ -336,8 +336,8 @@ int si_compile_llvm(struct si_screen *sscreen, struct si_shader *shader, void si_shader_destroy(struct si_shader *shader); unsigned si_shader_io_get_unique_index(unsigned semantic_name, unsigned index); int si_shader_binary_upload(struct si_screen *sscreen, struct si_shader *shader); -int si_shader_binary_read(struct si_screen *sscreen, struct si_shader *shader, - struct pipe_debug_callback *debug, unsigned processor); +void si_shader_binary_read(struct si_screen *sscreen, struct si_shader *shader, + struct pipe_debug_callback *debug, unsigned processor); void si_shader_apply_scratch_relocs(struct si_context *sctx, struct si_shader *shader, uint64_t scratch_va); |