From 5f22f3207e298f53aaf8c965a39f758578a28600 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 11 Nov 2013 10:57:23 -0700 Subject: mesa: use _mesa_is_bufferobj() helper in _mesa_vertex_attrib_address() And use a regular if statment to slightly improve readability. Jordan Justen --- src/mesa/main/varray.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/mesa/main') diff --git a/src/mesa/main/varray.h b/src/mesa/main/varray.h index ecfc6b6c9b6..3b9f39a61df 100644 --- a/src/mesa/main/varray.h +++ b/src/mesa/main/varray.h @@ -76,9 +76,10 @@ static inline const GLubyte * _mesa_vertex_attrib_address(const struct gl_vertex_attrib_array *array, const struct gl_vertex_buffer_binding *binding) { - return (binding->BufferObj->Name == 0 ? - array->Ptr : - (const GLubyte *)(binding->Offset + array->RelativeOffset)); + if (_mesa_is_bufferobj(binding->BufferObj)) + return (const GLubyte *) (binding->Offset + array->RelativeOffset); + else + return array->Ptr; } /** -- cgit v1.2.3