mesa: use _mesa_is_bufferobj() helper in _mesa_vertex_attrib_address()
authorBrian Paul <brianp@vmware.com>
Mon, 11 Nov 2013 17:57:23 +0000 (10:57 -0700)
committerBrian Paul <brianp@vmware.com>
Tue, 12 Nov 2013 18:05:14 +0000 (11:05 -0700)
And use a regular if statment to slightly improve readability.

Jordan Justen <jordan.l.justen@intel.com>

src/mesa/main/varray.h

index ecfc6b6c9b602606dea4729f1c3da7ce82977500..3b9f39a61df9b974051479e8174ed40e74635f58 100644 (file)
@@ -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;       
 }
 
 /**