diff options
-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. */ |