summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gallium/drivers/radeonsi/si_blit.c7
-rw-r--r--src/gallium/drivers/radeonsi/si_descriptors.c13
-rw-r--r--src/gallium/drivers/radeonsi/si_state.c4
3 files changed, 16 insertions, 8 deletions
diff --git a/src/gallium/drivers/radeonsi/si_blit.c b/src/gallium/drivers/radeonsi/si_blit.c
index ccf37cda964..3d2c81e92fc 100644
--- a/src/gallium/drivers/radeonsi/si_blit.c
+++ b/src/gallium/drivers/radeonsi/si_blit.c
@@ -98,8 +98,11 @@ void si_blitter_end(struct si_context *sctx)
/* Restore shader pointers because the VS blit shader changed all
* non-global VS user SGPRs. */
sctx->shader_pointers_dirty |= SI_DESCS_SHADER_MASK(VERTEX);
- sctx->vertex_buffer_pointer_dirty = sctx->vb_descriptors_buffer != NULL;
- sctx->vertex_buffer_user_sgprs_dirty = sctx->num_vertex_elements > 0;
+ sctx->vertex_buffer_pointer_dirty = sctx->vb_descriptors_buffer != NULL &&
+ sctx->num_vertex_elements >
+ sctx->screen->num_vbos_in_user_sgprs;
+ sctx->vertex_buffer_user_sgprs_dirty = sctx->num_vertex_elements > 0 &&
+ sctx->screen->num_vbos_in_user_sgprs;
si_mark_atom_dirty(sctx, &sctx->atoms.s.shader_pointers);
}
diff --git a/src/gallium/drivers/radeonsi/si_descriptors.c b/src/gallium/drivers/radeonsi/si_descriptors.c
index 51f35e5963f..030a8115015 100644
--- a/src/gallium/drivers/radeonsi/si_descriptors.c
+++ b/src/gallium/drivers/radeonsi/si_descriptors.c
@@ -1528,8 +1528,7 @@ void si_rebind_buffer(struct si_context *sctx, struct pipe_resource *buf)
/* Vertex buffers. */
if (!buffer) {
- if (num_elems)
- sctx->vertex_buffers_dirty = true;
+ sctx->vertex_buffers_dirty = num_elems > 0;
} else if (buffer->bind_history & PIPE_BIND_VERTEX_BUFFER) {
for (i = 0; i < num_elems; i++) {
int vb = sctx->vertex_elements->vertex_buffer_index[i];
@@ -1540,7 +1539,7 @@ void si_rebind_buffer(struct si_context *sctx, struct pipe_resource *buf)
continue;
if (sctx->vertex_buffer[vb].buffer.resource == buf) {
- sctx->vertex_buffers_dirty = true;
+ sctx->vertex_buffers_dirty = num_elems > 0;
break;
}
}
@@ -1866,7 +1865,9 @@ static void si_mark_shader_pointers_dirty(struct si_context *sctx, unsigned shad
u_bit_consecutive(SI_DESCS_FIRST_SHADER + shader * SI_NUM_SHADER_DESCS, SI_NUM_SHADER_DESCS);
if (shader == PIPE_SHADER_VERTEX) {
- sctx->vertex_buffer_pointer_dirty = sctx->vb_descriptors_buffer != NULL;
+ sctx->vertex_buffer_pointer_dirty = sctx->vb_descriptors_buffer != NULL &&
+ sctx->num_vertex_elements >
+ sctx->screen->num_vbos_in_user_sgprs;
sctx->vertex_buffer_user_sgprs_dirty =
sctx->num_vertex_elements > 0 && sctx->screen->num_vbos_in_user_sgprs;
}
@@ -1877,7 +1878,9 @@ static void si_mark_shader_pointers_dirty(struct si_context *sctx, unsigned shad
void si_shader_pointers_mark_dirty(struct si_context *sctx)
{
sctx->shader_pointers_dirty = u_bit_consecutive(0, SI_NUM_DESCS);
- sctx->vertex_buffer_pointer_dirty = sctx->vb_descriptors_buffer != NULL;
+ sctx->vertex_buffer_pointer_dirty = sctx->vb_descriptors_buffer != NULL &&
+ sctx->num_vertex_elements >
+ sctx->screen->num_vbos_in_user_sgprs;
sctx->vertex_buffer_user_sgprs_dirty =
sctx->num_vertex_elements > 0 && sctx->screen->num_vbos_in_user_sgprs;
si_mark_atom_dirty(sctx, &sctx->atoms.s.shader_pointers);
diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
index f5c23830e39..2e2be235cf7 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -4784,6 +4784,7 @@ static void si_bind_vertex_elements(struct pipe_context *ctx, void *state)
if (sctx->num_vertex_elements) {
sctx->vertex_buffers_dirty = true;
} else {
+ sctx->vertex_buffers_dirty = false;
sctx->vertex_buffer_pointer_dirty = false;
sctx->vertex_buffer_user_sgprs_dirty = false;
}
@@ -4862,7 +4863,8 @@ static void si_set_vertex_buffers(struct pipe_context *ctx, unsigned start_slot,
for (i = 0; i < count; i++)
pipe_resource_reference(&dst[i].buffer.resource, NULL);
}
- sctx->vertex_buffers_dirty = true;
+
+ sctx->vertex_buffers_dirty = sctx->num_vertex_elements > 0;
sctx->vertex_buffer_unaligned = (orig_unaligned & ~updated_mask) | unaligned;
/* Check whether alignment may have changed in a way that requires