radeonsi/gfx10: jump over the shader query atomic if the queries are disabled
[mesa.git] / src / gallium / drivers / radeonsi / gfx10_query.c
index 8584b2af505ebed7f16310f8d4041e60fd835a9f..56ecbd54850e523591286419b5cde23c2e9b5d26 100644 (file)
@@ -180,6 +180,7 @@ success:;
        sbuf.buffer_offset = qbuf->head;
        sbuf.buffer_size = sizeof(struct gfx10_sh_query_buffer_mem);
        si_set_rw_shader_buffer(sctx, GFX10_GS_QUERY_BUF, &sbuf);
        sbuf.buffer_offset = qbuf->head;
        sbuf.buffer_size = sizeof(struct gfx10_sh_query_buffer_mem);
        si_set_rw_shader_buffer(sctx, GFX10_GS_QUERY_BUF, &sbuf);
+       sctx->current_vs_state |= S_VS_STATE_STREAMOUT_QUERY_ENABLED(1);
 
        si_mark_atom_dirty(sctx, &sctx->atoms.s.shader_query);
        return true;
 
        si_mark_atom_dirty(sctx, &sctx->atoms.s.shader_query);
        return true;
@@ -242,6 +243,7 @@ static bool gfx10_sh_query_end(struct si_context *sctx, struct si_query *rquery)
                gfx10_alloc_query_buffer(sctx);
        } else {
                si_set_rw_shader_buffer(sctx, GFX10_GS_QUERY_BUF, NULL);
                gfx10_alloc_query_buffer(sctx);
        } else {
                si_set_rw_shader_buffer(sctx, GFX10_GS_QUERY_BUF, NULL);
+               sctx->current_vs_state &= C_VS_STATE_STREAMOUT_QUERY_ENABLED;
 
                /* If a query_begin is followed by a query_end without a draw
                 * in-between, we need to clear the atom to ensure that the
 
                /* If a query_begin is followed by a query_end without a draw
                 * in-between, we need to clear the atom to ensure that the