aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2019-08-20 20:07:26 -0400
committerMarek Olšák <[email protected]>2019-08-27 16:16:08 -0400
commit776f05a307a4c120e7c9e3b9cc964bc6ca0e222c (patch)
treeced4ddcd1de2553880268c11d4c2ddcca596dbc2
parentcab5b3861dad8c6bc9dea80d2bd66e560ef63ed7 (diff)
radeonsi/gfx10: fix the PRIMITIVES_GENERATED query if using legacy streamout
Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]>
-rw-r--r--src/gallium/drivers/radeonsi/si_state.h1
-rw-r--r--src/gallium/drivers/radeonsi/si_state_shaders.c7
-rw-r--r--src/gallium/drivers/radeonsi/si_state_streamout.c5
3 files changed, 9 insertions, 4 deletions
diff --git a/src/gallium/drivers/radeonsi/si_state.h b/src/gallium/drivers/radeonsi/si_state.h
index 11c7224b1d8..3480c4f7eeb 100644
--- a/src/gallium/drivers/radeonsi/si_state.h
+++ b/src/gallium/drivers/radeonsi/si_state.h
@@ -601,6 +601,7 @@ void si_shader_selector_key_vs(struct si_context *sctx,
struct si_shader_key *key,
struct si_vs_prolog_bits *prolog_key);
unsigned si_get_input_prim(const struct si_shader_selector *gs);
+bool si_update_ngg(struct si_context *sctx);
/* si_state_draw.c */
void si_emit_surface_sync(struct si_context *sctx, struct radeon_cmdbuf *cs,
diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c
index 22c54d32e9f..72719d8c475 100644
--- a/src/gallium/drivers/radeonsi/si_state_shaders.c
+++ b/src/gallium/drivers/radeonsi/si_state_shaders.c
@@ -2984,8 +2984,6 @@ static void si_update_common_shader_state(struct si_context *sctx)
sctx->do_update_shaders = true;
}
-static bool si_update_ngg(struct si_context *sctx);
-
static void si_bind_vs_shader(struct pipe_context *ctx, void *state)
{
struct si_context *sctx = (struct si_context *)ctx;
@@ -3024,7 +3022,7 @@ static void si_update_tess_uses_prim_id(struct si_context *sctx)
sctx->ps_shader.cso->info.uses_primid);
}
-static bool si_update_ngg(struct si_context *sctx)
+bool si_update_ngg(struct si_context *sctx)
{
if (!sctx->screen->use_ngg) {
assert(!sctx->ngg);
@@ -3039,7 +3037,8 @@ static bool si_update_ngg(struct si_context *sctx)
} else if (!sctx->screen->use_ngg_streamout) {
struct si_shader_selector *last = si_get_vs(sctx)->cso;
- if (last && last->so.num_outputs)
+ if ((last && last->so.num_outputs) ||
+ sctx->streamout.prims_gen_query_enabled)
new_ngg = false;
}
diff --git a/src/gallium/drivers/radeonsi/si_state_streamout.c b/src/gallium/drivers/radeonsi/si_state_streamout.c
index ae91c55e0c2..9b1d05f4df8 100644
--- a/src/gallium/drivers/radeonsi/si_state_streamout.c
+++ b/src/gallium/drivers/radeonsi/si_state_streamout.c
@@ -470,6 +470,11 @@ void si_update_prims_generated_query_state(struct si_context *sctx,
if (old_strmout_en != si_get_strmout_en(sctx))
si_mark_atom_dirty(sctx, &sctx->atoms.s.streamout_enable);
+
+ if (si_update_ngg(sctx)) {
+ si_shader_change_notify(sctx);
+ sctx->do_update_shaders = true;
+ }
}
}