From ced14f1c7a821dbb3fdb3c76b50a256c6568c714 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Mon, 11 Jun 2018 14:05:19 -0400 Subject: freedreno: remove per-stateobj dirty_mask's These never got updated in fd_context_all_dirty() so actually trying to rely on them (in the case of fd5_emit_images()) ends up in some cases where state is not emitted but should be. Best to just rip this out. Signed-off-by: Rob Clark --- src/gallium/drivers/freedreno/a2xx/fd2_emit.c | 32 ++++++++++----------------- 1 file changed, 12 insertions(+), 20 deletions(-) (limited to 'src/gallium/drivers/freedreno/a2xx') diff --git a/src/gallium/drivers/freedreno/a2xx/fd2_emit.c b/src/gallium/drivers/freedreno/a2xx/fd2_emit.c index a787b71e379..d749eb0324a 100644 --- a/src/gallium/drivers/freedreno/a2xx/fd2_emit.c +++ b/src/gallium/drivers/freedreno/a2xx/fd2_emit.c @@ -58,10 +58,6 @@ emit_constants(struct fd_ringbuffer *ring, uint32_t base, uint32_t start_base = base; unsigned i; - // XXX TODO only emit dirty consts.. but we need to keep track if - // they are clobbered by a clear, gmem2mem, or mem2gmem.. - constbuf->dirty_mask = enabled_mask; - /* emit user constants: */ while (enabled_mask) { unsigned index = ffs(enabled_mask) - 1; @@ -79,25 +75,21 @@ emit_constants(struct fd_ringbuffer *ring, uint32_t base, if (shader && ((base - start_base) >= (shader->first_immediate * 4))) break; - if (constbuf->dirty_mask & (1 << index)) { - const uint32_t *dwords; - - if (cb->user_buffer) { - dwords = cb->user_buffer; - } else { - struct fd_resource *rsc = fd_resource(cb->buffer); - dwords = fd_bo_map(rsc->bo); - } + const uint32_t *dwords; - dwords = (uint32_t *)(((uint8_t *)dwords) + cb->buffer_offset); + if (cb->user_buffer) { + dwords = cb->user_buffer; + } else { + struct fd_resource *rsc = fd_resource(cb->buffer); + dwords = fd_bo_map(rsc->bo); + } - OUT_PKT3(ring, CP_SET_CONSTANT, size + 1); - OUT_RING(ring, base); - for (i = 0; i < size; i++) - OUT_RING(ring, *(dwords++)); + dwords = (uint32_t *)(((uint8_t *)dwords) + cb->buffer_offset); - constbuf->dirty_mask &= ~(1 << index); - } + OUT_PKT3(ring, CP_SET_CONSTANT, size + 1); + OUT_RING(ring, base); + for (i = 0; i < size; i++) + OUT_RING(ring, *(dwords++)); base += size; enabled_mask &= ~(1 << index); -- cgit v1.2.3