Bug 31514

Summary: isBuffer returns true for unbound buffers
Product: Mesa Reporter: Adrienne Walker <enne>
Component: Mesa coreAssignee: mesa-dev
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium    
Version: 7.9   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Adrienne Walker 2010-11-09 15:31:45 UTC
According to the OpenGL spec, "A name returned by glGenBuffers, but not yet associated with a buffer object by calling glBindBuffer, is not the name of a buffer object."

GLuint buf;
glGenBuffers(1, &buf);
ASSERT(!glIsBuffer(buf));

In Mesa, glIsBuffer returns true for such an unbound buffer.  Other glIs* functions (e.g. glIsFramebuffer) appear to behave correctly.
Comment 1 Brian Paul 2010-11-09 15:57:41 UTC
Can you tell me exactly where it says that in the spec (and which version of the spec)?  I don't doubt you, but I'm having trouble finding that language.

The original GL_ARB_vertex_buffer_object extension spec doesn't exactly nail this down.
Comment 2 Adrienne Walker 2010-11-09 17:09:21 UTC
(In reply to comment #1)
> Can you tell me exactly where it says that in the spec (and which version of
> the spec)?  I don't doubt you, but I'm having trouble finding that language.

I was reading that from here: http://www.opengl.org/sdk/docs/man/xhtml/glIsBuffer.xml

According to http://www.opengl.org/documentation this should be the OpenGL 2.1 version, but the OpenGL 3.3 reference link appears to go to the same set of pages, so I'm no longer quite sure which it is.

Please correct me if I'm reading the wrong version or if this bug doesn't apply here.  :)
Comment 3 Brian Paul 2010-11-10 07:33:38 UTC
I just ran a test with NVIDIA's driver (version 256.35) and it returns GL_TRUE like Mesa does.  I wonder what AMD's driver does?

This is one of those corner cases where the spec may say one thing but drivers do something a little different.  Part of me wants to follow the spec to the letter, but there's also something to be said for consistency with other drivers...
Comment 4 Brian Paul 2010-11-10 07:47:20 UTC
BTW, I just added a new piglit test (isbufferobj) for this bug/issue.
Comment 5 Adrienne Walker 2010-11-11 10:12:30 UTC
(In reply to comment #3)
> I just ran a test with NVIDIA's driver (version 256.35) and it returns GL_TRUE
> like Mesa does.  I wonder what AMD's driver does?

As another data point, the ATI driver on my OSX machine returns GL_FALSE.
 
> This is one of those corner cases where the spec may say one thing but drivers
> do something a little different.  Part of me wants to follow the spec to the
> letter, but there's also something to be said for consistency with other
> drivers...

I can understand both of those thoughts.  Although, it does seem a bit internally inconsistent to me that IsBuffer doesn't follow the spec in this corner case but IsFramebuffer does.
Comment 6 Vinson Lee 2010-11-11 13:00:19 UTC
piglit isbufferobj results

Mesa - warn
NVIDIA - warn
ATI - pass
Mac OS X - pass
Intel - pass
Comment 7 Brian Paul 2010-11-11 13:51:01 UTC
Thanks for testing, Vinson.  I've committed a fix to Mesa (c552f273f559968dfd770367e25329baccbcd0c4) so it now behaves as the other drivers.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.