aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/i915
diff options
context:
space:
mode:
authorErik Faye-Lund <[email protected]>2019-03-06 13:28:24 +0100
committerErik Faye-Lund <[email protected]>2019-04-29 10:28:38 +0000
commita11945d179b2779b24f9727b55e0a70f003f359d (patch)
treeca5040cca508554ceb110f9e5ebdf84fb20f5032 /src/gallium/drivers/i915
parenta8e8204b18697e8f45643abdd5b32b6c8f3659ac (diff)
i915: 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]>
Diffstat (limited to 'src/gallium/drivers/i915')
-rw-r--r--src/gallium/drivers/i915/i915_context.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gallium/drivers/i915/i915_context.c b/src/gallium/drivers/i915/i915_context.c
index 8ea944003f2..f5116b80043 100644
--- a/src/gallium/drivers/i915/i915_context.c
+++ b/src/gallium/drivers/i915/i915_context.c
@@ -75,8 +75,11 @@ i915_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
for (i = 0; i < i915->nr_vertex_buffers; i++) {
const void *buf = i915->vertex_buffers[i].is_user_buffer ?
i915->vertex_buffers[i].buffer.user : NULL;
- if (!buf)
- buf = i915_buffer(i915->vertex_buffers[i].buffer.resource)->data;
+ if (!buf) {
+ if (!i915->vertex_buffers[i].buffer.resource)
+ continue;
+ buf = i915_buffer(i915->vertex_buffers[i].buffer.resource)->data;
+ }
draw_set_mapped_vertex_buffer(draw, i, buf, ~0);
}