Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 1 | // |
| 2 | // Copyright 2015 The ANGLE Project Authors. All rights reserved. |
| 3 | // Use of this source code is governed by a BSD-style license that can be |
| 4 | // found in the LICENSE file. |
| 5 | // |
| 6 | |
| 7 | // FramebufferGL.cpp: Implements the class methods for FramebufferGL. |
| 8 | |
| 9 | #include "libANGLE/renderer/gl/FramebufferGL.h" |
| 10 | |
| 11 | #include "common/debug.h" |
Jamie Madill | d1f5ef2 | 2015-04-01 14:17:06 -0400 | [diff] [blame] | 12 | #include "libANGLE/Data.h" |
Jamie Madill | 87de362 | 2015-03-16 10:41:44 -0400 | [diff] [blame] | 13 | #include "libANGLE/State.h" |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 14 | #include "libANGLE/FramebufferAttachment.h" |
| 15 | #include "libANGLE/angletypes.h" |
| 16 | #include "libANGLE/formatutils.h" |
| 17 | #include "libANGLE/renderer/gl/FunctionsGL.h" |
Jacek Caban | fa60f69 | 2015-04-27 18:23:44 +0200 | [diff] [blame] | 18 | #include "libANGLE/renderer/gl/RenderbufferGL.h" |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 19 | #include "libANGLE/renderer/gl/StateManagerGL.h" |
| 20 | #include "libANGLE/renderer/gl/TextureGL.h" |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 21 | |
| 22 | namespace rx |
| 23 | { |
| 24 | |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 25 | FramebufferGL::FramebufferGL(const gl::Framebuffer::Data &data, const FunctionsGL *functions, StateManagerGL *stateManager, bool isDefault) |
| 26 | : FramebufferImpl(data), |
| 27 | mFunctions(functions), |
| 28 | mStateManager(stateManager), |
Corentin Wallez | 6ab01b9 | 2015-08-03 10:16:36 -0700 | [diff] [blame^] | 29 | mFramebufferID(0), |
| 30 | mIsDefault(isDefault) |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 31 | { |
Corentin Wallez | 6ab01b9 | 2015-08-03 10:16:36 -0700 | [diff] [blame^] | 32 | if (!mIsDefault) |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 33 | { |
| 34 | mFunctions->genFramebuffers(1, &mFramebufferID); |
| 35 | } |
| 36 | } |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 37 | |
| 38 | FramebufferGL::~FramebufferGL() |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 39 | { |
Geoff Lang | 1eb708e | 2015-05-04 14:58:23 -0400 | [diff] [blame] | 40 | mStateManager->deleteFramebuffer(mFramebufferID); |
| 41 | mFramebufferID = 0; |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 42 | } |
| 43 | |
| 44 | static void BindFramebufferAttachment(const FunctionsGL *functions, GLenum attachmentPoint, |
| 45 | const gl::FramebufferAttachment *attachment) |
| 46 | { |
| 47 | if (attachment) |
| 48 | { |
| 49 | if (attachment->type() == GL_TEXTURE) |
| 50 | { |
Jamie Madill | 5160ec1 | 2015-04-14 08:13:48 -0400 | [diff] [blame] | 51 | const gl::Texture *texture = attachment->getTexture(); |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 52 | const TextureGL *textureGL = GetImplAs<TextureGL>(texture); |
| 53 | |
| 54 | if (texture->getTarget() == GL_TEXTURE_2D) |
| 55 | { |
| 56 | functions->framebufferTexture2D(GL_FRAMEBUFFER, attachmentPoint, GL_TEXTURE_2D, |
| 57 | textureGL->getTextureID(), attachment->mipLevel()); |
| 58 | } |
| 59 | else if (texture->getTarget() == GL_TEXTURE_CUBE_MAP) |
| 60 | { |
| 61 | functions->framebufferTexture2D(GL_FRAMEBUFFER, attachmentPoint, attachment->cubeMapFace(), |
| 62 | textureGL->getTextureID(), attachment->mipLevel()); |
| 63 | } |
| 64 | else if (texture->getTarget() == GL_TEXTURE_2D_ARRAY || texture->getTarget() == GL_TEXTURE_3D) |
| 65 | { |
| 66 | functions->framebufferTextureLayer(GL_FRAMEBUFFER, attachmentPoint, textureGL->getTextureID(), |
| 67 | attachment->mipLevel(), attachment->layer()); |
| 68 | } |
| 69 | else |
| 70 | { |
| 71 | UNREACHABLE(); |
| 72 | } |
| 73 | } |
| 74 | else if (attachment->type() == GL_RENDERBUFFER) |
| 75 | { |
Jamie Madill | 5160ec1 | 2015-04-14 08:13:48 -0400 | [diff] [blame] | 76 | const gl::Renderbuffer *renderbuffer = attachment->getRenderbuffer(); |
Geoff Lang | cd69f1c | 2015-03-18 14:33:23 -0400 | [diff] [blame] | 77 | const RenderbufferGL *renderbufferGL = GetImplAs<RenderbufferGL>(renderbuffer); |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 78 | |
Geoff Lang | cd69f1c | 2015-03-18 14:33:23 -0400 | [diff] [blame] | 79 | functions->framebufferRenderbuffer(GL_FRAMEBUFFER, attachmentPoint, GL_RENDERBUFFER, |
| 80 | renderbufferGL->getRenderbufferID()); |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 81 | } |
| 82 | else |
| 83 | { |
| 84 | UNREACHABLE(); |
| 85 | } |
| 86 | } |
| 87 | else |
| 88 | { |
| 89 | // Unbind this attachment |
| 90 | functions->framebufferTexture2D(GL_FRAMEBUFFER, attachmentPoint, GL_TEXTURE_2D, 0, 0); |
| 91 | } |
| 92 | } |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 93 | |
Jamie Madill | 7d75e2b | 2015-04-30 09:42:18 -0400 | [diff] [blame] | 94 | void FramebufferGL::onUpdateColorAttachment(size_t index) |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 95 | { |
Corentin Wallez | 6ab01b9 | 2015-08-03 10:16:36 -0700 | [diff] [blame^] | 96 | if (!mIsDefault) |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 97 | { |
| 98 | mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID); |
Jamie Madill | 7d75e2b | 2015-04-30 09:42:18 -0400 | [diff] [blame] | 99 | BindFramebufferAttachment(mFunctions, |
| 100 | GL_COLOR_ATTACHMENT0 + index, |
| 101 | mData.getColorAttachment(static_cast<unsigned int>(index))); |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 102 | } |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 103 | } |
| 104 | |
Jamie Madill | 7d75e2b | 2015-04-30 09:42:18 -0400 | [diff] [blame] | 105 | void FramebufferGL::onUpdateDepthAttachment() |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 106 | { |
Corentin Wallez | 6ab01b9 | 2015-08-03 10:16:36 -0700 | [diff] [blame^] | 107 | if (!mIsDefault) |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 108 | { |
| 109 | mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID); |
Jamie Madill | 7d75e2b | 2015-04-30 09:42:18 -0400 | [diff] [blame] | 110 | BindFramebufferAttachment(mFunctions, |
| 111 | GL_DEPTH_ATTACHMENT, |
| 112 | mData.getDepthAttachment()); |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 113 | } |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 114 | } |
| 115 | |
Jamie Madill | 7d75e2b | 2015-04-30 09:42:18 -0400 | [diff] [blame] | 116 | void FramebufferGL::onUpdateStencilAttachment() |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 117 | { |
Corentin Wallez | 6ab01b9 | 2015-08-03 10:16:36 -0700 | [diff] [blame^] | 118 | if (!mIsDefault) |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 119 | { |
| 120 | mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID); |
Jamie Madill | 7d75e2b | 2015-04-30 09:42:18 -0400 | [diff] [blame] | 121 | BindFramebufferAttachment(mFunctions, |
| 122 | GL_STENCIL_ATTACHMENT, |
| 123 | mData.getStencilAttachment()); |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 124 | } |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 125 | } |
| 126 | |
Jamie Madill | 7d75e2b | 2015-04-30 09:42:18 -0400 | [diff] [blame] | 127 | void FramebufferGL::onUpdateDepthStencilAttachment() |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 128 | { |
Corentin Wallez | 6ab01b9 | 2015-08-03 10:16:36 -0700 | [diff] [blame^] | 129 | if (!mIsDefault) |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 130 | { |
| 131 | mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID); |
Jamie Madill | 7d75e2b | 2015-04-30 09:42:18 -0400 | [diff] [blame] | 132 | BindFramebufferAttachment(mFunctions, |
| 133 | GL_DEPTH_STENCIL_ATTACHMENT, |
| 134 | mData.getDepthStencilAttachment()); |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 135 | } |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 136 | } |
| 137 | |
| 138 | void FramebufferGL::setDrawBuffers(size_t count, const GLenum *buffers) |
| 139 | { |
Corentin Wallez | 6ab01b9 | 2015-08-03 10:16:36 -0700 | [diff] [blame^] | 140 | if (!mIsDefault) |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 141 | { |
| 142 | mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID); |
| 143 | mFunctions->drawBuffers(count, buffers); |
| 144 | } |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 145 | } |
| 146 | |
| 147 | void FramebufferGL::setReadBuffer(GLenum buffer) |
| 148 | { |
Corentin Wallez | 6ab01b9 | 2015-08-03 10:16:36 -0700 | [diff] [blame^] | 149 | if (!mIsDefault) |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 150 | { |
| 151 | mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID); |
| 152 | mFunctions->readBuffer(buffer); |
| 153 | } |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 154 | } |
| 155 | |
Austin Kinross | 0833263 | 2015-05-05 13:35:47 -0700 | [diff] [blame] | 156 | gl::Error FramebufferGL::discard(size_t count, const GLenum *attachments) |
| 157 | { |
| 158 | UNIMPLEMENTED(); |
| 159 | return gl::Error(GL_INVALID_OPERATION); |
| 160 | } |
| 161 | |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 162 | gl::Error FramebufferGL::invalidate(size_t count, const GLenum *attachments) |
| 163 | { |
Geoff Lang | 64a7244 | 2015-04-01 14:43:11 -0400 | [diff] [blame] | 164 | // Since this function is just a hint and not available until OpenGL 4.3, only call it if it is available. |
| 165 | if (mFunctions->invalidateFramebuffer) |
| 166 | { |
| 167 | mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID); |
| 168 | mFunctions->invalidateFramebuffer(GL_FRAMEBUFFER, count, attachments); |
| 169 | } |
| 170 | |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 171 | return gl::Error(GL_NO_ERROR); |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 172 | } |
| 173 | |
| 174 | gl::Error FramebufferGL::invalidateSub(size_t count, const GLenum *attachments, const gl::Rectangle &area) |
| 175 | { |
Geoff Lang | 64a7244 | 2015-04-01 14:43:11 -0400 | [diff] [blame] | 176 | // Since this function is just a hint and not available until OpenGL 4.3, only call it if it is available. |
| 177 | if (mFunctions->invalidateSubFramebuffer) |
| 178 | { |
| 179 | mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID); |
| 180 | mFunctions->invalidateSubFramebuffer(GL_FRAMEBUFFER, count, attachments, area.x, area.y, area.width, area.height); |
| 181 | } |
| 182 | |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 183 | return gl::Error(GL_NO_ERROR); |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 184 | } |
| 185 | |
Jamie Madill | d1f5ef2 | 2015-04-01 14:17:06 -0400 | [diff] [blame] | 186 | gl::Error FramebufferGL::clear(const gl::Data &data, GLbitfield mask) |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 187 | { |
Jamie Madill | d1f5ef2 | 2015-04-01 14:17:06 -0400 | [diff] [blame] | 188 | mStateManager->setClearState(*data.state, mask); |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 189 | mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID); |
| 190 | mFunctions->clear(mask); |
| 191 | |
| 192 | return gl::Error(GL_NO_ERROR); |
| 193 | } |
| 194 | |
| 195 | static GLbitfield GetClearBufferMask(GLenum buffer) |
| 196 | { |
| 197 | switch (buffer) |
| 198 | { |
| 199 | case GL_COLOR: return GL_COLOR_BUFFER_BIT; |
| 200 | case GL_DEPTH: return GL_DEPTH_BUFFER_BIT; |
| 201 | case GL_STENCIL: return GL_STENCIL_BUFFER_BIT; |
| 202 | case GL_DEPTH_STENCIL: return GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT; |
| 203 | default: UNREACHABLE(); return 0; |
| 204 | } |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 205 | } |
| 206 | |
| 207 | gl::Error FramebufferGL::clearBufferfv(const gl::State &state, GLenum buffer, GLint drawbuffer, const GLfloat *values) |
| 208 | { |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 209 | mStateManager->setClearState(state, GetClearBufferMask(buffer)); |
| 210 | mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID); |
| 211 | mFunctions->clearBufferfv(buffer, drawbuffer, values); |
| 212 | |
| 213 | return gl::Error(GL_NO_ERROR); |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 214 | } |
| 215 | |
| 216 | gl::Error FramebufferGL::clearBufferuiv(const gl::State &state, GLenum buffer, GLint drawbuffer, const GLuint *values) |
| 217 | { |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 218 | mStateManager->setClearState(state, GetClearBufferMask(buffer)); |
| 219 | mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID); |
| 220 | mFunctions->clearBufferuiv(buffer, drawbuffer, values); |
| 221 | |
| 222 | return gl::Error(GL_NO_ERROR); |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 223 | } |
| 224 | |
| 225 | gl::Error FramebufferGL::clearBufferiv(const gl::State &state, GLenum buffer, GLint drawbuffer, const GLint *values) |
| 226 | { |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 227 | mStateManager->setClearState(state, GetClearBufferMask(buffer)); |
| 228 | mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID); |
| 229 | mFunctions->clearBufferiv(buffer, drawbuffer, values); |
| 230 | |
| 231 | return gl::Error(GL_NO_ERROR); |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 232 | } |
| 233 | |
| 234 | gl::Error FramebufferGL::clearBufferfi(const gl::State &state, GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil) |
| 235 | { |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 236 | mStateManager->setClearState(state, GetClearBufferMask(buffer)); |
| 237 | mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID); |
| 238 | mFunctions->clearBufferfi(buffer, drawbuffer, depth, stencil); |
| 239 | |
| 240 | return gl::Error(GL_NO_ERROR); |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 241 | } |
| 242 | |
| 243 | GLenum FramebufferGL::getImplementationColorReadFormat() const |
| 244 | { |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 245 | const gl::FramebufferAttachment *readAttachment = getData().getReadAttachment(); |
| 246 | GLenum internalFormat = readAttachment->getInternalFormat(); |
| 247 | const gl::InternalFormat &internalFormatInfo = gl::GetInternalFormatInfo(internalFormat); |
| 248 | return internalFormatInfo.format; |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 249 | } |
| 250 | |
| 251 | GLenum FramebufferGL::getImplementationColorReadType() const |
| 252 | { |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 253 | const gl::FramebufferAttachment *readAttachment = getData().getReadAttachment(); |
| 254 | GLenum internalFormat = readAttachment->getInternalFormat(); |
| 255 | const gl::InternalFormat &internalFormatInfo = gl::GetInternalFormatInfo(internalFormat); |
| 256 | return internalFormatInfo.type; |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 257 | } |
| 258 | |
| 259 | gl::Error FramebufferGL::readPixels(const gl::State &state, const gl::Rectangle &area, GLenum format, GLenum type, GLvoid *pixels) const |
| 260 | { |
Jamie Madill | 87de362 | 2015-03-16 10:41:44 -0400 | [diff] [blame] | 261 | const gl::PixelPackState &packState = state.getPackState(); |
Geoff Lang | afce829 | 2015-06-05 16:25:16 -0400 | [diff] [blame] | 262 | if (packState.pixelBuffer.get() != nullptr) |
Jamie Madill | 87de362 | 2015-03-16 10:41:44 -0400 | [diff] [blame] | 263 | { |
| 264 | UNIMPLEMENTED(); |
Jamie Madill | 87de362 | 2015-03-16 10:41:44 -0400 | [diff] [blame] | 265 | } |
Geoff Lang | afce829 | 2015-06-05 16:25:16 -0400 | [diff] [blame] | 266 | mStateManager->setPixelPackState(packState.alignment, packState.rowLength, packState.skipRows, packState.skipPixels); |
Jamie Madill | 87de362 | 2015-03-16 10:41:44 -0400 | [diff] [blame] | 267 | |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 268 | mStateManager->bindFramebuffer(GL_READ_FRAMEBUFFER, mFramebufferID); |
| 269 | mFunctions->readPixels(area.x, area.y, area.width, area.height, format, type, pixels); |
| 270 | |
| 271 | return gl::Error(GL_NO_ERROR); |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 272 | } |
| 273 | |
| 274 | gl::Error FramebufferGL::blit(const gl::State &state, const gl::Rectangle &sourceArea, const gl::Rectangle &destArea, |
| 275 | GLbitfield mask, GLenum filter, const gl::Framebuffer *sourceFramebuffer) |
| 276 | { |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 277 | const FramebufferGL *sourceFramebufferGL = GetImplAs<FramebufferGL>(sourceFramebuffer); |
| 278 | |
| 279 | mStateManager->bindFramebuffer(GL_READ_FRAMEBUFFER, sourceFramebufferGL->getFramebufferID()); |
| 280 | mStateManager->bindFramebuffer(GL_DRAW_FRAMEBUFFER, mFramebufferID); |
| 281 | |
| 282 | mFunctions->blitFramebuffer(sourceArea.x, sourceArea.y, sourceArea.x + sourceArea.width, sourceArea.y + sourceArea.height, |
| 283 | destArea.x, destArea.y, destArea.x + destArea.width, destArea.y + destArea.height, |
| 284 | mask, filter); |
| 285 | |
| 286 | return gl::Error(GL_NO_ERROR); |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 287 | } |
| 288 | |
| 289 | GLenum FramebufferGL::checkStatus() const |
| 290 | { |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 291 | mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID); |
| 292 | return mFunctions->checkFramebufferStatus(GL_FRAMEBUFFER); |
| 293 | } |
| 294 | |
| 295 | GLuint FramebufferGL::getFramebufferID() const |
| 296 | { |
| 297 | return mFramebufferID; |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 298 | } |
| 299 | |
| 300 | } |