mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 13:10:10 +01:00
svga: check for and skip null vertex buffer pointers
Fixes regressions with google earth and other things. Reviewed-by: José Fonseca <jfonseca@vmware.com>
This commit is contained in:
parent
b5752e16e8
commit
8dd3e341b3
1 changed files with 11 additions and 7 deletions
|
|
@ -66,12 +66,14 @@ svga_swtnl_draw_vbo(struct svga_context *svga,
|
|||
* Map vertex buffers
|
||||
*/
|
||||
for (i = 0; i < svga->curr.num_vertex_buffers; i++) {
|
||||
map = pipe_buffer_map(&svga->pipe,
|
||||
svga->curr.vb[i].buffer,
|
||||
PIPE_TRANSFER_READ,
|
||||
&vb_transfer[i]);
|
||||
if (svga->curr.vb[i].buffer) {
|
||||
map = pipe_buffer_map(&svga->pipe,
|
||||
svga->curr.vb[i].buffer,
|
||||
PIPE_TRANSFER_READ,
|
||||
&vb_transfer[i]);
|
||||
|
||||
draw_set_mapped_vertex_buffer(draw, i, map);
|
||||
draw_set_mapped_vertex_buffer(draw, i, map);
|
||||
}
|
||||
}
|
||||
|
||||
/* TODO move this to update_swtnl_draw */
|
||||
|
|
@ -109,8 +111,10 @@ svga_swtnl_draw_vbo(struct svga_context *svga,
|
|||
* unmap vertex/index buffers
|
||||
*/
|
||||
for (i = 0; i < svga->curr.num_vertex_buffers; i++) {
|
||||
pipe_buffer_unmap(&svga->pipe, vb_transfer[i]);
|
||||
draw_set_mapped_vertex_buffer(draw, i, NULL);
|
||||
if (svga->curr.vb[i].buffer) {
|
||||
pipe_buffer_unmap(&svga->pipe, vb_transfer[i]);
|
||||
draw_set_mapped_vertex_buffer(draw, i, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
if (ib_transfer) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue