aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2018-03-19 16:51:21 -0400
committerMarek Olšák <[email protected]>2018-04-02 13:10:36 -0400
commitf75421751782222e724510c7918edfe09ba33c7a (patch)
tree3258f50a5585a4a64f54afe47a4c7efc28348f1e /src/mesa/state_tracker
parent31881079af7cbd3cb0b0395c93802e45569cd9e5 (diff)
st/mesa: don't draw if the bound element array buffer is not allocated
Tested-by: Dieter Nützel <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_draw.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c
index e9ffc18d915..8011d0f25ca 100644
--- a/src/mesa/state_tracker/st_draw.c
+++ b/src/mesa/state_tracker/st_draw.c
@@ -177,6 +177,13 @@ st_draw_vbo(struct gl_context *ctx,
/* indices are in a real VBO */
info.has_user_indices = false;
info.index.resource = st_buffer_object(bufobj)->buffer;
+
+ /* Return if the bound element array buffer doesn't have any backing
+ * storage. (nothing to do)
+ */
+ if (!info.index.resource)
+ return;
+
start = pointer_to_offset(ib->ptr) / info.index_size;
} else {
/* indices are in user space memory */