mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-03-11 17:50:32 +01:00
virgl: don't flush an empty range
Otherwise, the gl-1.0-long-dlist Piglit test crashes.
Fixes: db7757 ("virgl: modify how we handle GL_MAP_FLUSH_EXPLICIT_BIT")
Reported by airlied@
v2: Exit on any invalid range (Erik)
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109190
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Tested-by: Jakob Bornecrantz <jakob@collabora.com>
This commit is contained in:
parent
393a756e6a
commit
ca66457b05
1 changed files with 4 additions and 0 deletions
|
|
@ -83,6 +83,9 @@ static void virgl_buffer_transfer_unmap(struct pipe_context *ctx,
|
|||
if (trans->base.usage & PIPE_TRANSFER_WRITE) {
|
||||
struct virgl_screen *vs = virgl_screen(ctx->screen);
|
||||
if (transfer->usage & PIPE_TRANSFER_FLUSH_EXPLICIT) {
|
||||
if (trans->range.end <= trans->range.start)
|
||||
goto out;
|
||||
|
||||
transfer->box.x += trans->range.start;
|
||||
transfer->box.width = trans->range.end - trans->range.start;
|
||||
trans->offset = transfer->box.x;
|
||||
|
|
@ -96,6 +99,7 @@ static void virgl_buffer_transfer_unmap(struct pipe_context *ctx,
|
|||
|
||||
}
|
||||
|
||||
out:
|
||||
virgl_resource_destroy_transfer(vctx, trans);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue