From: Marek Olšák <marek.ol...@amd.com> --- src/gallium/drivers/radeonsi/si_compute.c | 2 +- src/gallium/drivers/radeonsi/si_shader.c | 6 ++---- src/gallium/drivers/radeonsi/si_shader.h | 6 ++---- src/gallium/drivers/radeonsi/si_state_shaders.c | 2 +- 4 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/src/gallium/drivers/radeonsi/si_compute.c b/src/gallium/drivers/radeonsi/si_compute.c index 63f1ac9..382e5a1 100644 --- a/src/gallium/drivers/radeonsi/si_compute.c +++ b/src/gallium/drivers/radeonsi/si_compute.c @@ -335,21 +335,21 @@ static bool si_setup_compute_scratch_buffer(struct si_context *sctx, PIPE_USAGE_DEFAULT, scratch_needed, 256); if (!sctx->compute_scratch_buffer) return false; } if (sctx->compute_scratch_buffer != shader->scratch_bo && scratch_needed) { uint64_t scratch_va = sctx->compute_scratch_buffer->gpu_address; - si_shader_apply_scratch_relocs(sctx, shader, config, scratch_va); + si_shader_apply_scratch_relocs(shader, scratch_va); if (si_shader_binary_upload(sctx->screen, shader)) return false; r600_resource_reference(&shader->scratch_bo, sctx->compute_scratch_buffer); } return true; } diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index fed8639..f1eee32 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -6462,24 +6462,22 @@ void si_shader_binary_read_config(struct ac_shader_binary *binary, } } break; } } if (!conf->spi_ps_input_addr) conf->spi_ps_input_addr = conf->spi_ps_input_ena; } -void si_shader_apply_scratch_relocs(struct si_context *sctx, - struct si_shader *shader, - struct si_shader_config *config, - uint64_t scratch_va) +void si_shader_apply_scratch_relocs(struct si_shader *shader, + uint64_t scratch_va) { unsigned i; uint32_t scratch_rsrc_dword0 = scratch_va; uint32_t scratch_rsrc_dword1 = S_008F04_BASE_ADDRESS_HI(scratch_va >> 32); /* Enable scratch coalescing. */ scratch_rsrc_dword1 |= S_008F04_SWIZZLE_ENABLE(1); for (i = 0 ; i < shader->binary.reloc_count; i++) { diff --git a/src/gallium/drivers/radeonsi/si_shader.h b/src/gallium/drivers/radeonsi/si_shader.h index 4a2c042..61269bd 100644 --- a/src/gallium/drivers/radeonsi/si_shader.h +++ b/src/gallium/drivers/radeonsi/si_shader.h @@ -598,24 +598,22 @@ int si_shader_create(struct si_screen *sscreen, LLVMTargetMachineRef tm, struct pipe_debug_callback *debug); void si_shader_destroy(struct si_shader *shader); unsigned si_shader_io_get_unique_index(unsigned semantic_name, unsigned index); unsigned si_shader_io_get_unique_index2(unsigned name, unsigned index); int si_shader_binary_upload(struct si_screen *sscreen, struct si_shader *shader); void si_shader_dump(struct si_screen *sscreen, struct si_shader *shader, struct pipe_debug_callback *debug, unsigned processor, FILE *f, bool check_debug_option); void si_multiwave_lds_size_workaround(struct si_screen *sscreen, unsigned *lds_size); -void si_shader_apply_scratch_relocs(struct si_context *sctx, - struct si_shader *shader, - struct si_shader_config *config, - uint64_t scratch_va); +void si_shader_apply_scratch_relocs(struct si_shader *shader, + uint64_t scratch_va); void si_shader_binary_read_config(struct ac_shader_binary *binary, struct si_shader_config *conf, unsigned symbol_offset); unsigned si_get_spi_shader_z_format(bool writes_z, bool writes_stencil, bool writes_samplemask); const char *si_get_shader_name(struct si_shader *shader, unsigned processor); /* Inline helpers. */ /* Return the pointer to the main shader part's pointer. */ diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c index e479422..d5de749 100644 --- a/src/gallium/drivers/radeonsi/si_state_shaders.c +++ b/src/gallium/drivers/radeonsi/si_state_shaders.c @@ -2595,21 +2595,21 @@ static int si_update_scratch_buffer(struct si_context *sctx, if (shader->config.scratch_bytes_per_wave == 0) return 0; /* This shader is already configured to use the current * scratch buffer. */ if (shader->scratch_bo == sctx->scratch_buffer) return 0; assert(sctx->scratch_buffer); - si_shader_apply_scratch_relocs(sctx, shader, &shader->config, scratch_va); + si_shader_apply_scratch_relocs(shader, scratch_va); /* Replace the shader bo with a new bo that has the relocs applied. */ r = si_shader_binary_upload(sctx->screen, shader); if (r) return r; /* Update the shader state to use the new shader bo. */ si_shader_init_pm4_state(sctx->screen, shader); r600_resource_reference(&shader->scratch_bo, sctx->scratch_buffer); -- 2.7.4 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev