summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2021-01-11 22:57:32 -0500
committerMarge Bot <eric+marge@anholt.net>2021-01-20 21:53:13 +0000
commit76d6351dab7e716775ec965a2bb467713d97d03b (patch)
tree1d654f2540e1297d1bc58cac87b574661619a488
parent185a2472a4c7aa24d74901af54c44bccd76fca41 (diff)
radeonsi: don't validate inlinable uniforms at draw time
Let's trust the state tracker that it sets inlinable uniforms only when shaders can use them. Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8600>
-rw-r--r--src/gallium/drivers/radeonsi/si_descriptors.c2
-rw-r--r--src/gallium/drivers/radeonsi/si_pipe.h2
-rw-r--r--src/gallium/drivers/radeonsi/si_state_draw.cpp8
-rw-r--r--src/gallium/drivers/radeonsi/si_state_shaders.c5
4 files changed, 1 insertions, 16 deletions
diff --git a/src/gallium/drivers/radeonsi/si_descriptors.c b/src/gallium/drivers/radeonsi/si_descriptors.c
index 1fbbfd40ff3..75cfc1c8662 100644
--- a/src/gallium/drivers/radeonsi/si_descriptors.c
+++ b/src/gallium/drivers/radeonsi/si_descriptors.c
@@ -1192,8 +1192,8 @@ static void si_set_inlinable_constants(struct pipe_context *ctx,
struct si_context *sctx = (struct si_context *)ctx;
memcpy(sctx->inlinable_uniforms[shader], values, num_values * 4);
- sctx->inlinable_uniforms_dirty_mask |= 1 << shader;
sctx->inlinable_uniforms_valid_mask |= 1 << shader;
+ sctx->do_update_shaders = true;
}
void si_get_pipe_constant_buffer(struct si_context *sctx, uint shader, uint slot,
diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h
index e00f9a1af3d..ba77a1ebf5e 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.h
+++ b/src/gallium/drivers/radeonsi/si_pipe.h
@@ -1073,8 +1073,6 @@ struct si_context {
unsigned descriptors_dirty;
unsigned shader_pointers_dirty;
unsigned shader_needs_decompress_mask;
- unsigned shader_has_inlinable_uniforms_mask;
- unsigned inlinable_uniforms_dirty_mask;
unsigned inlinable_uniforms_valid_mask;
uint32_t inlinable_uniforms[SI_NUM_SHADERS][MAX_INLINABLE_UNIFORMS];
struct si_buffer_resources rw_buffers;
diff --git a/src/gallium/drivers/radeonsi/si_state_draw.cpp b/src/gallium/drivers/radeonsi/si_state_draw.cpp
index 9b1ae0ea91a..977a3028288 100644
--- a/src/gallium/drivers/radeonsi/si_state_draw.cpp
+++ b/src/gallium/drivers/radeonsi/si_state_draw.cpp
@@ -1954,14 +1954,6 @@ static void si_draw_vbo(struct pipe_context *ctx,
}
}
- if (sctx->shader_has_inlinable_uniforms_mask &
- sctx->inlinable_uniforms_valid_mask &
- sctx->inlinable_uniforms_dirty_mask) {
- sctx->do_update_shaders = true;
- /* If inlinable uniforms are not valid, they are also not dirty, so clear all bits. */
- sctx->inlinable_uniforms_dirty_mask = 0;
- }
-
if (unlikely(sctx->do_update_shaders)) {
if (unlikely(!si_update_shaders(sctx))) {
DRAW_CLEANUP;
diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c
index 4342c26f00d..3326ad934fe 100644
--- a/src/gallium/drivers/radeonsi/si_state_shaders.c
+++ b/src/gallium/drivers/radeonsi/si_state_shaders.c
@@ -2969,11 +2969,6 @@ static void si_update_common_shader_state(struct si_context *sctx, struct si_sha
si_shader_uses_bindless_images(sctx->tcs_shader.cso) ||
si_shader_uses_bindless_images(sctx->tes_shader.cso);
- if (sel && sel->info.base.num_inlinable_uniforms)
- sctx->shader_has_inlinable_uniforms_mask |= 1 << type;
- else
- sctx->shader_has_inlinable_uniforms_mask &= ~(1 << type);
-
/* Invalidate inlinable uniforms. */
sctx->inlinable_uniforms_valid_mask &= ~(1 << type);