diff options
author | Michal Krol <[email protected]> | 2010-03-10 12:04:00 +0100 |
---|---|---|
committer | Michal Krol <[email protected]> | 2010-03-10 14:16:40 +0100 |
commit | 504ad3606dfd5891ee04d85d3af2c233fd362c51 (patch) | |
tree | 7e0ab334fde9ffe7e04287cf059002d6f63d8b13 /src/gallium | |
parent | c282c0b6e40f9ed3cbf9d4c4eeb01d1896763246 (diff) |
svga: Check if vertex elements has been bound before using it.
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/svga/svga_state_need_swtnl.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gallium/drivers/svga/svga_state_need_swtnl.c b/src/gallium/drivers/svga/svga_state_need_swtnl.c index 10d473584d1..dfaab53aef4 100644 --- a/src/gallium/drivers/svga/svga_state_need_swtnl.c +++ b/src/gallium/drivers/svga/svga_state_need_swtnl.c @@ -76,6 +76,11 @@ static int update_need_swvfetch( struct svga_context *svga, unsigned i; boolean need_swvfetch = FALSE; + if (!svga->curr.velems) { + /* No vertex elements bound. */ + return 0; + } + for (i = 0; i < svga->curr.velems->count; i++) { svga->state.sw.ve_format[i] = svga_translate_vertex_format(svga->curr.velems->velem[i].src_format); if (svga->state.sw.ve_format[i] == SVGA3D_DECLTYPE_MAX) { |