Add multiple color buffer attachments points to gl::Framebuffer.
Also addded the checks for framebuffer completeness as defined by the ES2 spec and EXT_draw_buffers.
TRAC #22656
Signed-off-by: Nicolas Capens
Signed-off-by: Shannon Woods
Author: Jamie Madill
git-svn-id: https://angleproject.googlecode.com/svn/branches/es3proto@2065 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libGLESv2/Framebuffer.h b/src/libGLESv2/Framebuffer.h
index a68c05d..9a1bee0 100644
--- a/src/libGLESv2/Framebuffer.h
+++ b/src/libGLESv2/Framebuffer.h
@@ -34,6 +34,7 @@
virtual ~Framebuffer();
+ void setColorbuffer(unsigned int colorAttachment, GLenum type, GLuint colorbuffer);
void setColorbuffer(GLenum type, GLuint colorbuffer);
void setDepthbuffer(GLenum type, GLuint depthbuffer);
void setStencilbuffer(GLenum type, GLuint stencilbuffer);
@@ -41,31 +42,42 @@
void detachTexture(GLuint texture);
void detachRenderbuffer(GLuint renderbuffer);
+ unsigned int getRenderTargetSerial(unsigned int colorAttachment) const;
unsigned int getRenderTargetSerial() const;
unsigned int getDepthbufferSerial() const;
unsigned int getStencilbufferSerial() const;
+ Renderbuffer *getColorbuffer(unsigned int colorAttachment) const;
Renderbuffer *getColorbuffer() const;
Renderbuffer *getDepthbuffer() const;
Renderbuffer *getStencilbuffer() const;
Renderbuffer *getDepthOrStencilbuffer() const;
+ Renderbuffer *getReadColorbuffer() const;
+ Renderbuffer *getFirstColorBuffer() const;
+ GLenum getColorbufferType(unsigned int colorAttachment) const;
GLenum getColorbufferType() const;
GLenum getDepthbufferType() const;
GLenum getStencilbufferType() const;
+ GLuint getColorbufferHandle(unsigned int colorAttachment) const;
GLuint getColorbufferHandle() const;
GLuint getDepthbufferHandle() const;
GLuint getStencilbufferHandle() const;
+ GLenum getDrawBufferState(unsigned int colorAttachment) const;
+ void setDrawBufferState(unsigned int colorAttachment, GLenum drawBuffer);
+
bool hasStencil() const;
int getSamples() const;
virtual GLenum completeness() const;
protected:
- GLenum mColorbufferType;
- BindingPointer<Renderbuffer> mColorbufferPointer;
+ GLenum mColorbufferTypes[IMPLEMENTATION_MAX_DRAW_BUFFERS];
+ BindingPointer<Renderbuffer> mColorbufferPointers[IMPLEMENTATION_MAX_DRAW_BUFFERS];
+ GLenum mDrawBufferStates[IMPLEMENTATION_MAX_DRAW_BUFFERS];
+ GLenum mReadBufferState;
GLenum mDepthbufferType;
BindingPointer<Renderbuffer> mDepthbufferPointer;