From: Brian Paul Date: Mon, 11 Nov 2013 17:57:23 +0000 (-0700) Subject: mesa: use _mesa_is_bufferobj() helper in _mesa_vertex_attrib_address() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5f22f3207e298f53aaf8c965a39f758578a28600;p=mesa.git mesa: use _mesa_is_bufferobj() helper in _mesa_vertex_attrib_address() And use a regular if statment to slightly improve readability. Jordan Justen --- 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; } /**