radeonsi: clean up other scratch buffer functions
authorMarek Olšák <marek.olsak@amd.com>
Thu, 8 Oct 2015 23:37:57 +0000 (01:37 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Sat, 17 Oct 2015 19:40:03 +0000 (21:40 +0200)
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
src/gallium/drivers/radeonsi/si_state_shaders.c

index 9395c3149d0c4144cf01597902b2b2e3dfb03ce5..71349a56323d1ef8239709fba51a4f9842d5f61d 100644 (file)
@@ -1205,30 +1205,23 @@ static int si_update_scratch_buffer(struct si_context *sctx,
 
 static unsigned si_get_current_scratch_buffer_size(struct si_context *sctx)
 {
-       if (!sctx->scratch_buffer)
-               return 0;
-
-       return sctx->scratch_buffer->b.b.width0;
+       return sctx->scratch_buffer ? sctx->scratch_buffer->b.b.width0 : 0;
 }
 
-static unsigned si_get_scratch_buffer_bytes_per_wave(struct si_context *sctx,
-                                       struct si_shader_selector *sel)
+static unsigned si_get_scratch_buffer_bytes_per_wave(struct si_shader_selector *sel)
 {
-       if (!sel)
-               return 0;
-
-       return sel->current->scratch_bytes_per_wave;
+       return sel ? sel->current->scratch_bytes_per_wave : 0;
 }
 
 static unsigned si_get_max_scratch_bytes_per_wave(struct si_context *sctx)
 {
        unsigned bytes = 0;
 
-       bytes = MAX2(bytes, si_get_scratch_buffer_bytes_per_wave(sctx, sctx->ps_shader));
-       bytes = MAX2(bytes, si_get_scratch_buffer_bytes_per_wave(sctx, sctx->gs_shader));
-       bytes = MAX2(bytes, si_get_scratch_buffer_bytes_per_wave(sctx, sctx->vs_shader));
-       bytes = MAX2(bytes, si_get_scratch_buffer_bytes_per_wave(sctx, sctx->tcs_shader));
-       bytes = MAX2(bytes, si_get_scratch_buffer_bytes_per_wave(sctx, sctx->tes_shader));
+       bytes = MAX2(bytes, si_get_scratch_buffer_bytes_per_wave(sctx->ps_shader));
+       bytes = MAX2(bytes, si_get_scratch_buffer_bytes_per_wave(sctx->gs_shader));
+       bytes = MAX2(bytes, si_get_scratch_buffer_bytes_per_wave(sctx->vs_shader));
+       bytes = MAX2(bytes, si_get_scratch_buffer_bytes_per_wave(sctx->tcs_shader));
+       bytes = MAX2(bytes, si_get_scratch_buffer_bytes_per_wave(sctx->tes_shader));
        return bytes;
 }