diff options
author | Marek Olšák <[email protected]> | 2017-08-17 16:59:31 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2017-08-21 23:06:42 +0200 |
commit | db039d67aaae0c3af46cdefe78ea79c5ba860cfe (patch) | |
tree | 3c547905ec3e71812835086aebb9215aa4c82ded /src/gallium | |
parent | ea1b97714d9bd443c178ee43b19bf10f9a17d3d5 (diff) |
radeonsi: don't prefetch VBO descriptors if vertex elements == NULL
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_cp_dma.c | 3 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_hw_context.c | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/gallium/drivers/radeonsi/si_cp_dma.c b/src/gallium/drivers/radeonsi/si_cp_dma.c index 91a6aff4c12..1aa1ef28c9c 100644 --- a/src/gallium/drivers/radeonsi/si_cp_dma.c +++ b/src/gallium/drivers/radeonsi/si_cp_dma.c @@ -450,6 +450,9 @@ static void cik_prefetch_shader_async(struct si_context *sctx, static void cik_prefetch_VBO_descriptors(struct si_context *sctx) { + if (!sctx->vertex_elements) + return; + cik_prefetch_TC_L2_async(sctx, &sctx->vertex_buffers.buffer->b.b, sctx->vertex_buffers.buffer_offset, sctx->vertex_elements->desc_list_byte_size); diff --git a/src/gallium/drivers/radeonsi/si_hw_context.c b/src/gallium/drivers/radeonsi/si_hw_context.c index 46e60739382..d9170c30954 100644 --- a/src/gallium/drivers/radeonsi/si_hw_context.c +++ b/src/gallium/drivers/radeonsi/si_hw_context.c @@ -228,7 +228,7 @@ void si_begin_new_cs(struct si_context *ctx) ctx->prefetch_L2_mask |= SI_PREFETCH_VS; if (ctx->queued.named.ps) ctx->prefetch_L2_mask |= SI_PREFETCH_PS; - if (ctx->vertex_buffers.buffer) + if (ctx->vertex_buffers.buffer && ctx->vertex_elements) ctx->prefetch_L2_mask |= SI_PREFETCH_VBO_DESCRIPTORS; /* CLEAR_STATE disables all colorbuffers, so only enable bound ones. */ |