Mesa (master): gallium/u_vbuf: support NULL-resources
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Apr 29 10:36:19 UTC 2019
Module: Mesa
Branch: master
Commit: a8e8204b18697e8f45643abdd5b32b6c8f3659ac
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=a8e8204b18697e8f45643abdd5b32b6c8f3659ac
Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date: Wed Mar 6 13:29:35 2019 +0100
gallium/u_vbuf: support NULL-resources
It's legal for a buffer-object to have a NULL-resource, but let's just
skip over it, as there's nothing to do.
Signed-off-by: Erik Faye-Lund <erik.faye-lund at collabora.com>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
---
src/gallium/auxiliary/util/u_vbuf.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/gallium/auxiliary/util/u_vbuf.c b/src/gallium/auxiliary/util/u_vbuf.c
index 02a59bc0575..200bfffbd39 100644
--- a/src/gallium/auxiliary/util/u_vbuf.c
+++ b/src/gallium/auxiliary/util/u_vbuf.c
@@ -418,6 +418,9 @@ u_vbuf_translate_buffers(struct u_vbuf *mgr, struct translate_key *key,
unsigned size = vb->stride ? num_vertices * vb->stride
: sizeof(double)*4;
+ if (!vb->buffer.resource)
+ continue;
+
if (offset + size > vb->buffer.resource->width0) {
/* Don't try to map past end of buffer. This often happens when
* we're translating an attribute that's at offset > 0 from the
More information about the mesa-commit
mailing list