Inertia's picture

Enum: Framebuffer Objects (Version15) [done!]

Spec: http://www.opengl.org/registry/specs/EXT/framebuffer_object.txt

            // Old: void GL.Ext.GetFramebufferAttachmentParameter(All target, All attachment, All pname, out params);
            // New: void GL.Ext.GetFramebufferAttachmentParameter(FramebufferTarget target, FboAttachment attachment, FboPName pname, out params);
 
            // Old: All GL.Ext.CheckFramebufferStat(All target);
            // New: FBOErrorCode GL.Ext.CheckFramebufferStat(FramebufferTarget target);
 
            // note: these are 3 functions
            // Old: void GL.Ext.FramebufferTexture(1/2/3)D(All target, All attachment, All textarget, int texture, int level); 
            // New: void GL.Ext.FramebufferTexture(1/2/3)D(FramebufferTarget target, FboAttachment attachment, TextureTarget textarget, int texture, int level); 
            // using TextureTarget is a little errorprone, but avoids creating a new enum. 
 
            // Old: void GL.Ext.FramebufferRenderbuffer(All target, All attachment, All renderbuffertarget, int renderbuffer);
            // New: void GL.Ext.FramebufferRenderbuffer(FramebufferTarget target, FboAttachment attachment, RenderbufferTarget renderbuffertarget, int renderbuffer);
 
            // Old: void GL.Ext.GetRenderbufferParameter(All target, All pname, out int params);
            // New: void GL.Ext.GetRenderbufferParameter(RenderbufferTarget target, RenderbufferPName pname, out int params);
 
            // Old: void GL.Ext.RenderbufferStorage(All target, All internalformat, int width, int height);
            // New: void GL.Ext.RenderbufferStorage(RenderbufferTarget target, RenderbufferStorage internalformat, int width, int height);
 
            // Old: void GL.Ext.BindFramebuffer(All target, int framebuffer);
            // New: void GL.Ext.BindFramebuffer(FramebufferTarget target, int framebuffer);
 
            // Old: void GL.Ext.BindRenderbuffer(All target, int renderbuffer);
            // New: void GL.Ext.BindRenderbuffer(RenderbufferTarget target, int renderbuffer);
 
            // Old: GL.Ext.GenerateMipmap(All target);
            // New: GL.Ext.GenerateMipmap(GenerateMipmapTarget target);

Enum changes:

        // token values are same as in TextureTarget, but only these 4 are accepted by the func.
        public enum GenerateMipmapTarget : int
        {
            TEXTURE_1D,
            TEXTURE_2D,
            TEXTURE_CUBE_MAP,
            TEXTURE_3D,
        }
 
        public enum FramebufferTarget : int
        {
            FRAMEBUFFER_EXT = 0x8D40,
        }
 
        public enum RenderbufferTarget : int
        {
            RENDERBUFFER_EXT = 0x8D41,
        }
 
        public enum RenderbufferStorage : int
        {
            STENCIL_INDEX_EXT = 0x8D45, // from fbo-ext.h
            STENCIL_INDEX1_EXT = 0x8D46,
            STENCIL_INDEX4_EXT = 0x8D47,
            STENCIL_INDEX8_EXT = 0x8D48,
            STENCIL_INDEX16_EXT = 0x8D49,
        }
 
        public enum FBOErrorCode : int
        {
            FRAMEBUFFER_COMPLETE_EXT = 0x8CD5,
            FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT = 0x8CD6,
            FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT = 0x8CD7,
            FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT = 0x8CD8, // from fbo-ext.h
            FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT = 0x8CD9,
            FRAMEBUFFER_INCOMPLETE_FORMATS_EXT = 0x8CDA,
            FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT = 0x8CDB,
            FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT = 0x8CDC,
            FRAMEBUFFER_UNSUPPORTED_EXT = 0x8CDD,
            FRAMEBUFFER_STATUS_ERROR_EXT = 0x8CDE, // from fbo-ext.h
        }
 
        public enum FboAttachment : int
        {
            COLOR_ATTACHMENT0_EXT = 0x8CE0,
            COLOR_ATTACHMENT1_EXT = 0x8CE1,
            COLOR_ATTACHMENT2_EXT = 0x8CE2,
            COLOR_ATTACHMENT3_EXT = 0x8CE3,
            COLOR_ATTACHMENT4_EXT = 0x8CE4,
            COLOR_ATTACHMENT5_EXT = 0x8CE5,
            COLOR_ATTACHMENT6_EXT = 0x8CE6,
            COLOR_ATTACHMENT7_EXT = 0x8CE7,
            COLOR_ATTACHMENT8_EXT = 0x8CE8,
            COLOR_ATTACHMENT9_EXT = 0x8CE9,
            COLOR_ATTACHMENT10_EXT = 0x8CEA,
            COLOR_ATTACHMENT11_EXT = 0x8CEB,
            COLOR_ATTACHMENT12_EXT = 0x8CEC,
            COLOR_ATTACHMENT13_EXT = 0x8CED,
            COLOR_ATTACHMENT14_EXT = 0x8CEE,
            COLOR_ATTACHMENT15_EXT = 0x8CEF,
            DEPTH_ATTACHMENT_EXT = 0x8D00,
            STENCIL_ATTACHMENT_EXT = 0x8D20,
        }
 
        public enum FboPName : int
        {
            FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT = 0x8CD0,
            FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT = 0x8CD1,
            FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT = 0x8CD2,
            FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT = 0x8CD3,
            FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT = 0x8CD4,
        }
 
        public enum RenderbufferPName : int
        {
            RENDERBUFFER_WIDTH_EXT = 0x8D42,
            RENDERBUFFER_HEIGHT_EXT = 0x8D43,
            RENDERBUFFER_INTERNAL_FORMAT_EXT = 0x8D44,
            RENDERBUFFER_RED_SIZE_EXT = 0x8D50,
            RENDERBUFFER_GREEN_SIZE_EXT = 0x8D51,
            RENDERBUFFER_BLUE_SIZE_EXT = 0x8D52,
            RENDERBUFFER_ALPHA_SIZE_EXT = 0x8D53,
            RENDERBUFFER_DEPTH_SIZE_EXT = 0x8D54,
            RENDERBUFFER_STENCIL_SIZE_EXT = 0x8D55,
        }
 
// add to Enum: GetPName
 
FRAMEBUFFER_BINDING_EXT             0x8CA6
RENDERBUFFER_BINDING_EXT            0x8CA7
MAX_COLOR_ATTACHMENTS_EXT           0x8CDF
MAX_RENDERBUFFER_SIZE_EXT           0x84E8
 
// add to Enum: ErrorCode
 
INVALID_FRAMEBUFFER_OPERATION_EXT   0x0506
 

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Inertia's picture

It appears the official FBO spec is missing this token (belongs to enum FBOErrorCode)

GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT = 0x8CD8

This was found as possible errormessages returned, from an ATi paper with the explanation of the errorcode: "An object has been attached to more than one attachment point."

Since that value is missing in the enum, i believe it might be deprecated or ATi-only. Don't see any problem including this though, the worst case would be that the opengl driver cannot return this value as error.

the Fiddler's picture

Thanks, I'll add this too. Since it is only used as a return value it doesn't present a problem.

Inertia's picture

I've run a crosscheck with:

http://graphics.stanford.edu/~yoel/notes/fbo-ext.h

added 3 tokens (including the duplicate attachment one) to the initial post, they are marked // from fbo-ext.h. The values of the tokens fit into the reserved values for the other tokens, so i'm quite positive they are correct.

the Fiddler's picture

The new tokens are marked as invalid in the specs, e.g. "removed STENCIL_INDEX_EXT = 0x8D45 in rev. #114 of the spec".

Added everything, looks quite nice now.

Inertia's picture

Excellent :) Any other Extensions you have in mind?

the Fiddler's picture

Nope, I think we have covered about 95% of normal use cases. OpenGL 3 will fix the rest anynway :)

Inertia's picture

OpenGL 3 will fix the rest anynway :)
Yeah, one day. In the future. In a galaxy far, far away. The GL3 progress report is almost 1/3 year late now, and solid drivers will probably not be seen 2008 :P