Bug 13757

Summary: [FBO]IsFramebufferEXT should return true for names created by GenFramebuffersEXT
Product: Mesa Reporter: Shuang He <shuang.he>
Component: Mesa coreAssignee: Eric Anholt <eric>
Status: VERIFIED INVALID QA Contact:
Severity: normal    
Priority: medium CC: eric, mesa-dev
Version: unspecified   
Hardware: Other   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: test case

Description Shuang He 2007-12-20 18:02:47 UTC
System Environment:
--------------------------
--Mesa:e54329233522591bbe8aad8a3fd6bcdc1e430f03 

Bug detailed description:
--------------------------
IsFramebufferEXT return false for names created by GenFramebuffersEXT, before these names are bound
According to OpenGL spec,         
The command

            boolean IsFramebufferEXT( uint framebuffer );

        returns TRUE if <framebuffer> is the name of an framebuffer
        object.  If <framebuffer> is zero, or if <framebuffer> is a
        non-zero value that is not the name of an framebuffer object,
        IsFramebufferEXT return FALSE.

IsFramebufferEXT should return TRUE for names created by GenFramebuffersEXT
but the Mesa implementation is now depend this on whether this framebuffer name is bound.

Reproduce steps:
----------------
start X
compile and run the attached test case


Current result:
----------------
IsFramebufferEXT return false for names created by GenFramebuffersEXT, before these names are bound


Expected result:
----------------
IsFramebufferEXT should return true for names created by GenFramebuffersEXT, before these names are bound
Comment 1 Shuang He 2007-12-20 18:04:21 UTC
Created attachment 13260 [details]
test case
Comment 2 Brian Paul 2008-01-01 08:26:04 UTC
I believe Mesa is correct as-is.  The GL_EXT_framebuffer_object spec says:

"""
    The command

      void GenFramebuffersEXT(sizei n, uint *ids);

    returns <n> previously unused framebuffer object names in <ids>.
    These names are marked as used, for the purposes of
    GenFramebuffersEXT only, but they acquire state and type only when
    they are first bound, just as if they were unused.
"""

So the ID doesn't really name an FBO until the ID has been bound.
This is consistant with NVIDIA's GL.  It works the same way for texture objects too.
Comment 3 Shuang He 2008-01-01 17:25:43 UTC
(In reply to comment #2)
> I believe Mesa is correct as-is.  The GL_EXT_framebuffer_object spec says:
> 
> """
>     The command
> 
>       void GenFramebuffersEXT(sizei n, uint *ids);
> 
>     returns <n> previously unused framebuffer object names in <ids>.
>     These names are marked as used, for the purposes of
>     GenFramebuffersEXT only, but they acquire state and type only when
>     they are first bound, just as if they were unused.
> """
> 
> So the ID doesn't really name an FBO until the ID has been bound.
> This is consistant with NVIDIA's GL.  It works the same way for texture objects
> too.
> 

OK, you're right
Comment 4 Shuang He 2008-10-12 19:07:52 UTC
verified

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.