From b97947972193b6b004a0ee49da31146230d43dd8 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Thu, 16 Nov 2006 02:33:38 +0000 Subject: Make sure vbo's are mapped before accessing their contents in api_arrayelt.c. Reported by Haihao Xiang. --- src/mesa/drivers/dri/i965/brw_save_api.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/mesa/drivers/dri/i965') diff --git a/src/mesa/drivers/dri/i965/brw_save_api.c b/src/mesa/drivers/dri/i965/brw_save_api.c index 9c0e4af48a..b2f255d095 100644 --- a/src/mesa/drivers/dri/i965/brw_save_api.c +++ b/src/mesa/drivers/dri/i965/brw_save_api.c @@ -855,10 +855,14 @@ static void GLAPIENTRY _save_OBE_DrawArrays(GLenum mode, GLint start, GLsizei co if (!_mesa_validate_DrawArrays( ctx, mode, start, count )) return; + _ae_map_vbos( ctx ); + brw_save_NotifyBegin( ctx, mode | BRW_SAVE_PRIM_WEAK ); for (i = 0; i < count; i++) CALL_ArrayElement(GET_DISPATCH(), (start + i)); CALL_End(GET_DISPATCH(), ()); + + _ae_unmap_vbos( ctx ); } /* Could do better by copying the arrays and element list intact and @@ -873,6 +877,8 @@ static void GLAPIENTRY _save_OBE_DrawElements(GLenum mode, GLsizei count, GLenum if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices )) return; + _ae_map_vbos( ctx ); + brw_save_NotifyBegin( ctx, mode | BRW_SAVE_PRIM_WEAK ); switch (type) { @@ -894,6 +900,8 @@ static void GLAPIENTRY _save_OBE_DrawElements(GLenum mode, GLsizei count, GLenum } CALL_End(GET_DISPATCH(), ()); + + _ae_unmap_vbos( ctx ); } static void GLAPIENTRY _save_OBE_DrawRangeElements(GLenum mode, -- cgit v1.2.3