summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi/si_pipe.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2018-09-28 20:38:26 -0400
committerMarek Olšák <[email protected]>2018-10-16 15:28:22 -0400
commit41a6c3de1fb4b955217b0f53b3f301d236acebb3 (patch)
tree1cc25899afb619cc9e5aa183096ce6c026c74b68 /src/gallium/drivers/radeonsi/si_pipe.c
parentb94824c787ba747060f359391ddf454a15843e63 (diff)
radeonsi: don't re-upload the sample position constant buffer repeatedly
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_pipe.c')
-rw-r--r--src/gallium/drivers/radeonsi/si_pipe.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c
index 14b075c7b76..4b481b47af3 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.c
+++ b/src/gallium/drivers/radeonsi/si_pipe.c
@@ -160,6 +160,7 @@ static void si_destroy_context(struct pipe_context *context)
pipe_resource_reference(&sctx->gsvs_ring, NULL);
pipe_resource_reference(&sctx->tess_rings, NULL);
pipe_resource_reference(&sctx->null_const_buf.buffer, NULL);
+ pipe_resource_reference(&sctx->sample_pos_buffer, NULL);
r600_resource_reference(&sctx->border_color_buffer, NULL);
free(sctx->border_color_table);
r600_resource_reference(&sctx->scratch_buffer, NULL);
@@ -599,6 +600,12 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen,
util_dynarray_init(&sctx->resident_img_needs_color_decompress, NULL);
util_dynarray_init(&sctx->resident_tex_needs_depth_decompress, NULL);
+ sctx->sample_pos_buffer =
+ pipe_buffer_create(sctx->b.screen, 0, PIPE_USAGE_DEFAULT,
+ sizeof(sctx->sample_positions));
+ pipe_buffer_write(&sctx->b, sctx->sample_pos_buffer, 0,
+ sizeof(sctx->sample_positions), &sctx->sample_positions);
+
/* this must be last */
si_begin_new_gfx_cs(sctx);
return &sctx->b;