summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2015-10-09 01:35:32 +0200
committerMarek Olšák <[email protected]>2015-10-17 21:40:03 +0200
commit9098d7e9bd97fd3d674fc93441ea9ab01c2779c7 (patch)
tree653db7f43c69ed0765911c7933e5e2c25422aa29 /src/gallium/drivers/radeonsi
parent938a1bee34cc8e0c22a9b99c6b3d247b88e94cc2 (diff)
radeonsi: clean up copy-pasted scratch buffer updates
Reviewed-by: Michel Dänzer <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi')
-rw-r--r--src/gallium/drivers/radeonsi/si_state_shaders.c39
1 files changed, 13 insertions, 26 deletions
diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c
index c1d61d527cb..9395c3149d0 100644
--- a/src/gallium/drivers/radeonsi/si_state_shaders.c
+++ b/src/gallium/drivers/radeonsi/si_state_shaders.c
@@ -1243,7 +1243,6 @@ static bool si_update_spi_tmpring_size(struct si_context *sctx)
int r;
if (scratch_needed_size > 0) {
-
if (scratch_needed_size > current_scratch_buffer_size) {
/* Create a bigger scratch buffer */
pipe_resource_reference(
@@ -1282,38 +1281,26 @@ static bool si_update_spi_tmpring_size(struct si_context *sctx)
si_pm4_bind_state(sctx, hs, sctx->tcs_shader->current->pm4);
/* VS can be bound as LS, ES, or VS. */
- if (sctx->tes_shader) {
- r = si_update_scratch_buffer(sctx, sctx->vs_shader);
- if (r < 0)
- return false;
- if (r == 1)
+ r = si_update_scratch_buffer(sctx, sctx->vs_shader);
+ if (r < 0)
+ return false;
+ if (r == 1) {
+ if (sctx->tes_shader)
si_pm4_bind_state(sctx, ls, sctx->vs_shader->current->pm4);
- } else if (sctx->gs_shader) {
- r = si_update_scratch_buffer(sctx, sctx->vs_shader);
- if (r < 0)
- return false;
- if (r == 1)
+ else if (sctx->gs_shader)
si_pm4_bind_state(sctx, es, sctx->vs_shader->current->pm4);
- } else {
- r = si_update_scratch_buffer(sctx, sctx->vs_shader);
- if (r < 0)
- return false;
- if (r == 1)
+ else
si_pm4_bind_state(sctx, vs, sctx->vs_shader->current->pm4);
}
/* TES can be bound as ES or VS. */
- if (sctx->gs_shader) {
- r = si_update_scratch_buffer(sctx, sctx->tes_shader);
- if (r < 0)
- return false;
- if (r == 1)
+ r = si_update_scratch_buffer(sctx, sctx->tes_shader);
+ if (r < 0)
+ return false;
+ if (r == 1) {
+ if (sctx->gs_shader)
si_pm4_bind_state(sctx, es, sctx->tes_shader->current->pm4);
- } else {
- r = si_update_scratch_buffer(sctx, sctx->tes_shader);
- if (r < 0)
- return false;
- if (r == 1)
+ else
si_pm4_bind_state(sctx, vs, sctx->tes_shader->current->pm4);
}
}