X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fdrivers%2Fvc4%2Fvc4_context.c;h=a9e7ff91f38d478aa78c9141244480281814f771;hb=09c1c13c4442148e45a4aeac3425382bbe90e8cd;hp=3863e4432a9837cb09ff6f3ebdd407bbe8da5172;hpb=f597ac3966405934e13a9aaa18c73211b5a40c7c;p=mesa.git diff --git a/src/gallium/drivers/vc4/vc4_context.c b/src/gallium/drivers/vc4/vc4_context.c index 3863e4432a9..a9e7ff91f38 100644 --- a/src/gallium/drivers/vc4/vc4_context.c +++ b/src/gallium/drivers/vc4/vc4_context.c @@ -66,10 +66,24 @@ vc4_pipe_flush(struct pipe_context *pctx, struct pipe_fence_handle **fence, } } +/* We can't flush the texture cache within rendering a tile, so we have to + * flush all rendering to the kernel so that the next job reading from the + * tile gets a flushed cache. + */ +static void +vc4_texture_barrier(struct pipe_context *pctx, unsigned flags) +{ + vc4_flush(pctx); +} + static void vc4_invalidate_resource(struct pipe_context *pctx, struct pipe_resource *prsc) { struct vc4_context *vc4 = vc4_context(pctx); + struct vc4_resource *rsc = vc4_resource(prsc); + + rsc->initialized_buffers = 0; + struct hash_entry *entry = _mesa_hash_table_search(vc4->write_jobs, prsc); if (!entry) @@ -96,7 +110,7 @@ vc4_context_destroy(struct pipe_context *pctx) if (vc4->uploader) u_upload_destroy(vc4->uploader); - slab_destroy(&vc4->transfer_pool); + slab_destroy_child(&vc4->transfer_pool); pipe_surface_reference(&vc4->framebuffer.cbufs[0], NULL); pipe_surface_reference(&vc4->framebuffer.zsbuf, NULL); @@ -128,6 +142,7 @@ vc4_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags) pctx->destroy = vc4_context_destroy; pctx->flush = vc4_pipe_flush; pctx->invalidate_resource = vc4_invalidate_resource; + pctx->texture_barrier = vc4_texture_barrier; vc4_draw_init(pctx); vc4_state_init(pctx); @@ -139,9 +154,13 @@ vc4_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags) vc4->fd = screen->fd; - slab_create(&vc4->transfer_pool, sizeof(struct vc4_transfer), - 16); - vc4->blitter = util_blitter_create(pctx); + slab_create_child(&vc4->transfer_pool, &screen->transfer_pool); + + vc4->uploader = u_upload_create_default(&vc4->base); + vc4->base.stream_uploader = vc4->uploader; + vc4->base.const_uploader = vc4->uploader; + + vc4->blitter = util_blitter_create(pctx); if (!vc4->blitter) goto fail; @@ -150,10 +169,6 @@ vc4_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags) if (!vc4->primconvert) goto fail; - vc4->uploader = u_upload_create(pctx, 16 * 1024, - PIPE_BIND_INDEX_BUFFER, - PIPE_USAGE_STREAM); - vc4_debug |= saved_shaderdb_flag; vc4->sample_mask = (1 << VC4_MAX_SAMPLES) - 1;