diff options
author | Erik Faye-Lund <[email protected]> | 2019-03-06 13:29:35 +0100 |
---|---|---|
committer | Erik Faye-Lund <[email protected]> | 2019-04-29 10:28:38 +0000 |
commit | a8e8204b18697e8f45643abdd5b32b6c8f3659ac (patch) | |
tree | 7909cfa3e4f053370d013901a3eb10f979bc38df /src | |
parent | 0607ceb655d594bbc9b3240fb66be217acb36b8a (diff) |
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 <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/auxiliary/util/u_vbuf.c | 3 |
1 files changed, 3 insertions, 0 deletions
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 |