freedreno: fix crash when flush() but no rendering

If we haven't created a batch, just bail in pipe->flush(), since there
is nothing to do.

Fixes crash in warsow, which creates a whole bunch of contexts used for
nothing but texture uploads.

Signed-off-by: Rob Clark <robdclark@gmail.com>
This commit is contained in:
Rob Clark 2017-05-14 11:32:44 -04:00
parent 06a51fb4e5
commit e4ad86952a

View file

@ -45,6 +45,12 @@ fd_context_flush(struct pipe_context *pctx, struct pipe_fence_handle **fence,
{
struct fd_context *ctx = fd_context(pctx);
if (!ctx->batch) {
if (fence)
*fence = NULL;
return;
}
if (flags & PIPE_FLUSH_FENCE_FD)
ctx->batch->needs_out_fence_fd = true;