st: use _mesa_is_bufferobj()
authorBrian Paul <brianp@vmware.com>
Wed, 8 Jun 2011 14:05:41 +0000 (08:05 -0600)
committerBrian Paul <brianp@vmware.com>
Wed, 8 Jun 2011 14:05:41 +0000 (08:05 -0600)
src/mesa/state_tracker/st_draw.c

index 46a4f9cf8c53f4f7a430b121385208b54fb369d9..56955d357b105d7c2e95f99778b346478659ebc2 100644 (file)
@@ -42,6 +42,7 @@
 
 #include "main/imports.h"
 #include "main/image.h"
+#include "main/bufferobj.h"
 #include "main/macros.h"
 #include "main/mfeatures.h"
 #include "program/prog_uniform.h"
@@ -336,7 +337,7 @@ setup_interleaved_attribs(struct gl_context *ctx,
       assert(element_size == array->Size * _mesa_sizeof_type(array->Type));
 
       if (attr == 0) {
-         if (bufobj && bufobj->Name) {
+         if (bufobj && _mesa_is_bufferobj(bufobj)) {
             vbuffer->buffer = NULL;
             pipe_resource_reference(&vbuffer->buffer, stobj->buffer);
             vbuffer->buffer_offset = pointer_to_offset(low_addr);
@@ -402,7 +403,7 @@ setup_non_interleaved_attribs(struct gl_context *ctx,
 
       assert(element_size == array->Size * _mesa_sizeof_type(array->Type));
 
-      if (bufobj && bufobj->Name) {
+      if (bufobj && _mesa_is_bufferobj(bufobj)) {
          /* Attribute data is in a VBO.
           * Recall that for VBOs, the gl_client_array->Ptr field is
           * really an offset from the start of the VBO, not a pointer.
@@ -493,7 +494,7 @@ setup_index_buffer(struct gl_context *ctx,
       }
 
       /* get/create the index buffer object */
-      if (bufobj && bufobj->Name) {
+      if (bufobj && _mesa_is_bufferobj(bufobj)) {
          /* elements/indexes are in a real VBO */
          struct st_buffer_object *stobj = st_buffer_object(bufobj);
          pipe_resource_reference(&ibuffer->buffer, stobj->buffer);