radeonsi: don't prefetch VBO descriptors if vertex elements == NULL

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
This commit is contained in:
Marek Olšák 2017-08-17 16:59:31 +02:00
parent ea1b97714d
commit db039d67aa
2 changed files with 4 additions and 1 deletions

View file

@ -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);

View file

@ -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. */