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 | |
Jamie Madill | 60ec6ea | 2016-01-22 15:27:19 -0500 | [diff] [blame] | 11 | #include "common/BitSetIterator.h" |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 12 | #include "common/debug.h" |
Jamie Madill | 9082b98 | 2016-04-27 15:21:51 -0400 | [diff] [blame] | 13 | #include "libANGLE/ContextState.h" |
Jamie Madill | 87de362 | 2015-03-16 10:41:44 -0400 | [diff] [blame] | 14 | #include "libANGLE/State.h" |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 15 | #include "libANGLE/FramebufferAttachment.h" |
| 16 | #include "libANGLE/angletypes.h" |
| 17 | #include "libANGLE/formatutils.h" |
Jamie Madill | 8415b5f | 2016-04-26 13:41:39 -0400 | [diff] [blame] | 18 | #include "libANGLE/renderer/ContextImpl.h" |
Corentin Wallez | 26a717b | 2016-09-27 08:45:42 -0700 | [diff] [blame] | 19 | #include "libANGLE/renderer/gl/BlitGL.h" |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 20 | #include "libANGLE/renderer/gl/FunctionsGL.h" |
Jacek Caban | fa60f69 | 2015-04-27 18:23:44 +0200 | [diff] [blame] | 21 | #include "libANGLE/renderer/gl/RenderbufferGL.h" |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 22 | #include "libANGLE/renderer/gl/StateManagerGL.h" |
| 23 | #include "libANGLE/renderer/gl/TextureGL.h" |
Geoff Lang | afd7f0a | 2015-09-09 15:33:31 -0400 | [diff] [blame] | 24 | #include "libANGLE/renderer/gl/WorkaroundsGL.h" |
Geoff Lang | f607c60 | 2016-09-21 11:46:48 -0400 | [diff] [blame] | 25 | #include "libANGLE/renderer/gl/formatutilsgl.h" |
Corentin Wallez | 886de36 | 2016-09-27 10:49:35 -0400 | [diff] [blame] | 26 | #include "libANGLE/renderer/gl/renderergl_utils.h" |
Jamie Madill | cc86d64 | 2015-11-24 13:00:07 -0500 | [diff] [blame] | 27 | #include "platform/Platform.h" |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 28 | |
Jamie Madill | 60ec6ea | 2016-01-22 15:27:19 -0500 | [diff] [blame] | 29 | using namespace gl; |
Corentin Wallez | 9a8d366 | 2016-09-22 12:18:29 -0400 | [diff] [blame] | 30 | using angle::CheckedNumeric; |
Jamie Madill | 60ec6ea | 2016-01-22 15:27:19 -0500 | [diff] [blame] | 31 | |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 32 | namespace rx |
| 33 | { |
| 34 | |
Jamie Madill | 48ef11b | 2016-04-27 15:21:52 -0400 | [diff] [blame] | 35 | FramebufferGL::FramebufferGL(const FramebufferState &state, |
Geoff Lang | afd7f0a | 2015-09-09 15:33:31 -0400 | [diff] [blame] | 36 | const FunctionsGL *functions, |
| 37 | StateManagerGL *stateManager, |
| 38 | const WorkaroundsGL &workarounds, |
Corentin Wallez | 26a717b | 2016-09-27 08:45:42 -0700 | [diff] [blame] | 39 | BlitGL *blitter, |
Geoff Lang | afd7f0a | 2015-09-09 15:33:31 -0400 | [diff] [blame] | 40 | bool isDefault) |
Jamie Madill | 48ef11b | 2016-04-27 15:21:52 -0400 | [diff] [blame] | 41 | : FramebufferImpl(state), |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 42 | mFunctions(functions), |
| 43 | mStateManager(stateManager), |
Geoff Lang | afd7f0a | 2015-09-09 15:33:31 -0400 | [diff] [blame] | 44 | mWorkarounds(workarounds), |
Corentin Wallez | 26a717b | 2016-09-27 08:45:42 -0700 | [diff] [blame] | 45 | mBlitter(blitter), |
Corentin Wallez | 6ab01b9 | 2015-08-03 10:16:36 -0700 | [diff] [blame] | 46 | mFramebufferID(0), |
| 47 | mIsDefault(isDefault) |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 48 | { |
Corentin Wallez | 6ab01b9 | 2015-08-03 10:16:36 -0700 | [diff] [blame] | 49 | if (!mIsDefault) |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 50 | { |
| 51 | mFunctions->genFramebuffers(1, &mFramebufferID); |
| 52 | } |
| 53 | } |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 54 | |
Corentin Wallez | 86f8dd7 | 2015-08-12 12:37:48 -0700 | [diff] [blame] | 55 | FramebufferGL::FramebufferGL(GLuint id, |
Jamie Madill | 48ef11b | 2016-04-27 15:21:52 -0400 | [diff] [blame] | 56 | const FramebufferState &state, |
Corentin Wallez | 86f8dd7 | 2015-08-12 12:37:48 -0700 | [diff] [blame] | 57 | const FunctionsGL *functions, |
Geoff Lang | afd7f0a | 2015-09-09 15:33:31 -0400 | [diff] [blame] | 58 | const WorkaroundsGL &workarounds, |
Corentin Wallez | 26a717b | 2016-09-27 08:45:42 -0700 | [diff] [blame] | 59 | BlitGL *blitter, |
Corentin Wallez | 86f8dd7 | 2015-08-12 12:37:48 -0700 | [diff] [blame] | 60 | StateManagerGL *stateManager) |
Jamie Madill | 48ef11b | 2016-04-27 15:21:52 -0400 | [diff] [blame] | 61 | : FramebufferImpl(state), |
Corentin Wallez | 86f8dd7 | 2015-08-12 12:37:48 -0700 | [diff] [blame] | 62 | mFunctions(functions), |
| 63 | mStateManager(stateManager), |
Geoff Lang | afd7f0a | 2015-09-09 15:33:31 -0400 | [diff] [blame] | 64 | mWorkarounds(workarounds), |
Corentin Wallez | 26a717b | 2016-09-27 08:45:42 -0700 | [diff] [blame] | 65 | mBlitter(blitter), |
Corentin Wallez | 86f8dd7 | 2015-08-12 12:37:48 -0700 | [diff] [blame] | 66 | mFramebufferID(id), |
| 67 | mIsDefault(true) |
| 68 | { |
| 69 | } |
| 70 | |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 71 | FramebufferGL::~FramebufferGL() |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 72 | { |
Geoff Lang | 1eb708e | 2015-05-04 14:58:23 -0400 | [diff] [blame] | 73 | mStateManager->deleteFramebuffer(mFramebufferID); |
| 74 | mFramebufferID = 0; |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 75 | } |
| 76 | |
Jamie Madill | 60ec6ea | 2016-01-22 15:27:19 -0500 | [diff] [blame] | 77 | static void BindFramebufferAttachment(const FunctionsGL *functions, |
| 78 | GLenum attachmentPoint, |
| 79 | const FramebufferAttachment *attachment) |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 80 | { |
| 81 | if (attachment) |
| 82 | { |
| 83 | if (attachment->type() == GL_TEXTURE) |
| 84 | { |
Jamie Madill | 60ec6ea | 2016-01-22 15:27:19 -0500 | [diff] [blame] | 85 | const Texture *texture = attachment->getTexture(); |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 86 | const TextureGL *textureGL = GetImplAs<TextureGL>(texture); |
| 87 | |
| 88 | if (texture->getTarget() == GL_TEXTURE_2D) |
| 89 | { |
| 90 | functions->framebufferTexture2D(GL_FRAMEBUFFER, attachmentPoint, GL_TEXTURE_2D, |
| 91 | textureGL->getTextureID(), attachment->mipLevel()); |
| 92 | } |
| 93 | else if (texture->getTarget() == GL_TEXTURE_CUBE_MAP) |
| 94 | { |
| 95 | functions->framebufferTexture2D(GL_FRAMEBUFFER, attachmentPoint, attachment->cubeMapFace(), |
| 96 | textureGL->getTextureID(), attachment->mipLevel()); |
| 97 | } |
| 98 | else if (texture->getTarget() == GL_TEXTURE_2D_ARRAY || texture->getTarget() == GL_TEXTURE_3D) |
| 99 | { |
| 100 | functions->framebufferTextureLayer(GL_FRAMEBUFFER, attachmentPoint, textureGL->getTextureID(), |
| 101 | attachment->mipLevel(), attachment->layer()); |
| 102 | } |
| 103 | else |
| 104 | { |
| 105 | UNREACHABLE(); |
| 106 | } |
| 107 | } |
| 108 | else if (attachment->type() == GL_RENDERBUFFER) |
| 109 | { |
Jamie Madill | 60ec6ea | 2016-01-22 15:27:19 -0500 | [diff] [blame] | 110 | const Renderbuffer *renderbuffer = attachment->getRenderbuffer(); |
Geoff Lang | cd69f1c | 2015-03-18 14:33:23 -0400 | [diff] [blame] | 111 | const RenderbufferGL *renderbufferGL = GetImplAs<RenderbufferGL>(renderbuffer); |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 112 | |
Geoff Lang | cd69f1c | 2015-03-18 14:33:23 -0400 | [diff] [blame] | 113 | functions->framebufferRenderbuffer(GL_FRAMEBUFFER, attachmentPoint, GL_RENDERBUFFER, |
| 114 | renderbufferGL->getRenderbufferID()); |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 115 | } |
| 116 | else |
| 117 | { |
| 118 | UNREACHABLE(); |
| 119 | } |
| 120 | } |
| 121 | else |
| 122 | { |
| 123 | // Unbind this attachment |
| 124 | functions->framebufferTexture2D(GL_FRAMEBUFFER, attachmentPoint, GL_TEXTURE_2D, 0, 0); |
| 125 | } |
| 126 | } |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 127 | |
Jamie Madill | 60ec6ea | 2016-01-22 15:27:19 -0500 | [diff] [blame] | 128 | Error FramebufferGL::discard(size_t count, const GLenum *attachments) |
Austin Kinross | 0833263 | 2015-05-05 13:35:47 -0700 | [diff] [blame] | 129 | { |
| 130 | UNIMPLEMENTED(); |
Jamie Madill | 60ec6ea | 2016-01-22 15:27:19 -0500 | [diff] [blame] | 131 | return Error(GL_INVALID_OPERATION); |
Austin Kinross | 0833263 | 2015-05-05 13:35:47 -0700 | [diff] [blame] | 132 | } |
| 133 | |
Jamie Madill | 60ec6ea | 2016-01-22 15:27:19 -0500 | [diff] [blame] | 134 | Error FramebufferGL::invalidate(size_t count, const GLenum *attachments) |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 135 | { |
Geoff Lang | 64a7244 | 2015-04-01 14:43:11 -0400 | [diff] [blame] | 136 | // Since this function is just a hint and not available until OpenGL 4.3, only call it if it is available. |
| 137 | if (mFunctions->invalidateFramebuffer) |
| 138 | { |
| 139 | mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID); |
Cooper Partin | 4d61f7e | 2015-08-12 10:56:50 -0700 | [diff] [blame] | 140 | mFunctions->invalidateFramebuffer(GL_FRAMEBUFFER, static_cast<GLsizei>(count), attachments); |
Geoff Lang | 64a7244 | 2015-04-01 14:43:11 -0400 | [diff] [blame] | 141 | } |
| 142 | |
Jamie Madill | 60ec6ea | 2016-01-22 15:27:19 -0500 | [diff] [blame] | 143 | return Error(GL_NO_ERROR); |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 144 | } |
| 145 | |
Jamie Madill | 60ec6ea | 2016-01-22 15:27:19 -0500 | [diff] [blame] | 146 | Error FramebufferGL::invalidateSub(size_t count, |
| 147 | const GLenum *attachments, |
| 148 | const gl::Rectangle &area) |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 149 | { |
Geoff Lang | 64a7244 | 2015-04-01 14:43:11 -0400 | [diff] [blame] | 150 | // Since this function is just a hint and not available until OpenGL 4.3, only call it if it is available. |
| 151 | if (mFunctions->invalidateSubFramebuffer) |
| 152 | { |
| 153 | mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID); |
Cooper Partin | 4d61f7e | 2015-08-12 10:56:50 -0700 | [diff] [blame] | 154 | mFunctions->invalidateSubFramebuffer(GL_FRAMEBUFFER, static_cast<GLsizei>(count), |
| 155 | attachments, area.x, area.y, area.width, area.height); |
Geoff Lang | 64a7244 | 2015-04-01 14:43:11 -0400 | [diff] [blame] | 156 | } |
| 157 | |
Jamie Madill | 60ec6ea | 2016-01-22 15:27:19 -0500 | [diff] [blame] | 158 | return Error(GL_NO_ERROR); |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 159 | } |
| 160 | |
Jamie Madill | 8415b5f | 2016-04-26 13:41:39 -0400 | [diff] [blame] | 161 | Error FramebufferGL::clear(ContextImpl *context, GLbitfield mask) |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 162 | { |
Geoff Lang | afd7f0a | 2015-09-09 15:33:31 -0400 | [diff] [blame] | 163 | syncClearState(mask); |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 164 | mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID); |
| 165 | mFunctions->clear(mask); |
| 166 | |
Jamie Madill | 60ec6ea | 2016-01-22 15:27:19 -0500 | [diff] [blame] | 167 | return Error(GL_NO_ERROR); |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 168 | } |
| 169 | |
Jamie Madill | 8415b5f | 2016-04-26 13:41:39 -0400 | [diff] [blame] | 170 | Error FramebufferGL::clearBufferfv(ContextImpl *context, |
Jamie Madill | 60ec6ea | 2016-01-22 15:27:19 -0500 | [diff] [blame] | 171 | GLenum buffer, |
| 172 | GLint drawbuffer, |
| 173 | const GLfloat *values) |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 174 | { |
Geoff Lang | afd7f0a | 2015-09-09 15:33:31 -0400 | [diff] [blame] | 175 | syncClearBufferState(buffer, drawbuffer); |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 176 | mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID); |
| 177 | mFunctions->clearBufferfv(buffer, drawbuffer, values); |
| 178 | |
Jamie Madill | 60ec6ea | 2016-01-22 15:27:19 -0500 | [diff] [blame] | 179 | return Error(GL_NO_ERROR); |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 180 | } |
| 181 | |
Jamie Madill | 8415b5f | 2016-04-26 13:41:39 -0400 | [diff] [blame] | 182 | Error FramebufferGL::clearBufferuiv(ContextImpl *context, |
Jamie Madill | 60ec6ea | 2016-01-22 15:27:19 -0500 | [diff] [blame] | 183 | GLenum buffer, |
| 184 | GLint drawbuffer, |
| 185 | const GLuint *values) |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 186 | { |
Geoff Lang | afd7f0a | 2015-09-09 15:33:31 -0400 | [diff] [blame] | 187 | syncClearBufferState(buffer, drawbuffer); |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 188 | mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID); |
| 189 | mFunctions->clearBufferuiv(buffer, drawbuffer, values); |
| 190 | |
Jamie Madill | 60ec6ea | 2016-01-22 15:27:19 -0500 | [diff] [blame] | 191 | return Error(GL_NO_ERROR); |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 192 | } |
| 193 | |
Jamie Madill | 8415b5f | 2016-04-26 13:41:39 -0400 | [diff] [blame] | 194 | Error FramebufferGL::clearBufferiv(ContextImpl *context, |
Jamie Madill | 60ec6ea | 2016-01-22 15:27:19 -0500 | [diff] [blame] | 195 | GLenum buffer, |
| 196 | GLint drawbuffer, |
| 197 | const GLint *values) |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 198 | { |
Geoff Lang | afd7f0a | 2015-09-09 15:33:31 -0400 | [diff] [blame] | 199 | syncClearBufferState(buffer, drawbuffer); |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 200 | mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID); |
| 201 | mFunctions->clearBufferiv(buffer, drawbuffer, values); |
| 202 | |
Jamie Madill | 60ec6ea | 2016-01-22 15:27:19 -0500 | [diff] [blame] | 203 | return Error(GL_NO_ERROR); |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 204 | } |
| 205 | |
Jamie Madill | 8415b5f | 2016-04-26 13:41:39 -0400 | [diff] [blame] | 206 | Error FramebufferGL::clearBufferfi(ContextImpl *context, |
Jamie Madill | 60ec6ea | 2016-01-22 15:27:19 -0500 | [diff] [blame] | 207 | GLenum buffer, |
| 208 | GLint drawbuffer, |
| 209 | GLfloat depth, |
| 210 | GLint stencil) |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 211 | { |
Geoff Lang | afd7f0a | 2015-09-09 15:33:31 -0400 | [diff] [blame] | 212 | syncClearBufferState(buffer, drawbuffer); |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 213 | mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID); |
| 214 | mFunctions->clearBufferfi(buffer, drawbuffer, depth, stencil); |
| 215 | |
Jamie Madill | 60ec6ea | 2016-01-22 15:27:19 -0500 | [diff] [blame] | 216 | return Error(GL_NO_ERROR); |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 217 | } |
| 218 | |
| 219 | GLenum FramebufferGL::getImplementationColorReadFormat() const |
| 220 | { |
Jamie Madill | a3944d4 | 2016-07-22 22:13:26 -0400 | [diff] [blame] | 221 | const auto *readAttachment = mState.getReadAttachment(); |
| 222 | const Format &format = readAttachment->getFormat(); |
Geoff Lang | f607c60 | 2016-09-21 11:46:48 -0400 | [diff] [blame] | 223 | return format.info->getReadPixelsFormat(); |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 224 | } |
| 225 | |
| 226 | GLenum FramebufferGL::getImplementationColorReadType() const |
| 227 | { |
Jamie Madill | a3944d4 | 2016-07-22 22:13:26 -0400 | [diff] [blame] | 228 | const auto *readAttachment = mState.getReadAttachment(); |
| 229 | const Format &format = readAttachment->getFormat(); |
Geoff Lang | f607c60 | 2016-09-21 11:46:48 -0400 | [diff] [blame] | 230 | return format.info->getReadPixelsType(); |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 231 | } |
| 232 | |
Jamie Madill | 8415b5f | 2016-04-26 13:41:39 -0400 | [diff] [blame] | 233 | Error FramebufferGL::readPixels(ContextImpl *context, |
Jamie Madill | 60ec6ea | 2016-01-22 15:27:19 -0500 | [diff] [blame] | 234 | const gl::Rectangle &area, |
| 235 | GLenum format, |
| 236 | GLenum type, |
| 237 | GLvoid *pixels) const |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 238 | { |
Geoff Lang | da34d00 | 2015-09-04 11:08:59 -0400 | [diff] [blame] | 239 | // TODO: don't sync the pixel pack state here once the dirty bits contain the pixel pack buffer |
| 240 | // binding |
Jamie Madill | dfde6ab | 2016-06-09 07:07:18 -0700 | [diff] [blame] | 241 | const PixelPackState &packState = context->getGLState().getPackState(); |
Geoff Lang | da34d00 | 2015-09-04 11:08:59 -0400 | [diff] [blame] | 242 | mStateManager->setPixelPackState(packState); |
Jamie Madill | 87de362 | 2015-03-16 10:41:44 -0400 | [diff] [blame] | 243 | |
Geoff Lang | f607c60 | 2016-09-21 11:46:48 -0400 | [diff] [blame] | 244 | nativegl::ReadPixelsFormat readPixelsFormat = |
| 245 | nativegl::GetReadPixelsFormat(mFunctions, mWorkarounds, format, type); |
Corentin Wallez | 9a8d366 | 2016-09-22 12:18:29 -0400 | [diff] [blame] | 246 | GLenum readFormat = readPixelsFormat.format; |
| 247 | GLenum readType = readPixelsFormat.type; |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 248 | |
Corentin Wallez | 9a8d366 | 2016-09-22 12:18:29 -0400 | [diff] [blame] | 249 | mStateManager->bindFramebuffer(GL_READ_FRAMEBUFFER, mFramebufferID); |
| 250 | |
| 251 | if (mWorkarounds.packOverlappingRowsSeparatelyPackBuffer && packState.pixelBuffer.get() && |
| 252 | packState.rowLength != 0 && packState.rowLength < area.width) |
| 253 | { |
| 254 | return readPixelsRowByRowWorkaround(area, readFormat, readType, packState, pixels); |
| 255 | } |
| 256 | |
| 257 | if (mWorkarounds.packLastRowSeparatelyForPaddingInclusion) |
| 258 | { |
Corentin Wallez | 886de36 | 2016-09-27 10:49:35 -0400 | [diff] [blame] | 259 | gl::Extents size(area.width, area.height, 1); |
| 260 | |
Corentin Wallez | 9a8d366 | 2016-09-22 12:18:29 -0400 | [diff] [blame] | 261 | bool apply; |
Corentin Wallez | 886de36 | 2016-09-27 10:49:35 -0400 | [diff] [blame] | 262 | ANGLE_TRY_RESULT(ShouldApplyLastRowPaddingWorkaround(size, packState, readFormat, readType, |
| 263 | false, pixels), |
| 264 | apply); |
Corentin Wallez | 9a8d366 | 2016-09-22 12:18:29 -0400 | [diff] [blame] | 265 | |
| 266 | if (apply) |
| 267 | { |
| 268 | return readPixelsPaddingWorkaround(area, readFormat, readType, packState, pixels); |
| 269 | } |
| 270 | } |
| 271 | |
| 272 | mFunctions->readPixels(area.x, area.y, area.width, area.height, readFormat, readType, pixels); |
| 273 | |
| 274 | return gl::NoError(); |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 275 | } |
| 276 | |
Jamie Madill | 8415b5f | 2016-04-26 13:41:39 -0400 | [diff] [blame] | 277 | Error FramebufferGL::blit(ContextImpl *context, |
Jamie Madill | 60ec6ea | 2016-01-22 15:27:19 -0500 | [diff] [blame] | 278 | const gl::Rectangle &sourceArea, |
| 279 | const gl::Rectangle &destArea, |
| 280 | GLbitfield mask, |
Jamie Madill | 8415b5f | 2016-04-26 13:41:39 -0400 | [diff] [blame] | 281 | GLenum filter) |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 282 | { |
Jamie Madill | dfde6ab | 2016-06-09 07:07:18 -0700 | [diff] [blame] | 283 | const Framebuffer *sourceFramebuffer = context->getGLState().getReadFramebuffer(); |
Corentin Wallez | 26a717b | 2016-09-27 08:45:42 -0700 | [diff] [blame] | 284 | const Framebuffer *destFramebuffer = context->getGLState().getDrawFramebuffer(); |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 285 | |
Corentin Wallez | 6898b35 | 2016-11-10 11:41:15 -0500 | [diff] [blame^] | 286 | const FramebufferAttachment *colorReadAttachment = sourceFramebuffer->getReadColorbuffer(); |
| 287 | GLsizei readAttachmentSamples = colorReadAttachment->getSamples(); |
| 288 | |
Corentin Wallez | 26a717b | 2016-09-27 08:45:42 -0700 | [diff] [blame] | 289 | bool needManualColorBlit = false; |
| 290 | |
Corentin Wallez | 6898b35 | 2016-11-10 11:41:15 -0500 | [diff] [blame^] | 291 | // TODO(cwallez) when the filter is LINEAR and both source and destination are SRGB, we |
| 292 | // could avoid doing a manual blit. |
| 293 | |
| 294 | // Prior to OpenGL 4.4 BlitFramebuffer (section 18.3.1 of GL 4.3 core profile) reads: |
| 295 | // When values are taken from the read buffer, no linearization is performed, even |
| 296 | // if the format of the buffer is SRGB. |
| 297 | // Starting from OpenGL 4.4 (section 18.3.1) it reads: |
| 298 | // When values are taken from the read buffer, if FRAMEBUFFER_SRGB is enabled and the |
| 299 | // value of FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING for the framebuffer attachment |
| 300 | // corresponding to the read buffer is SRGB, the red, green, and blue components are |
| 301 | // converted from the non-linear sRGB color space according [...]. |
Corentin Wallez | 26a717b | 2016-09-27 08:45:42 -0700 | [diff] [blame] | 302 | { |
Corentin Wallez | 6898b35 | 2016-11-10 11:41:15 -0500 | [diff] [blame^] | 303 | bool sourceSRGB = colorReadAttachment != nullptr && |
| 304 | colorReadAttachment->getColorEncoding() == GL_SRGB; |
| 305 | needManualColorBlit = |
| 306 | needManualColorBlit || (sourceSRGB && mFunctions->isAtMostGL(gl::Version(4, 3))); |
| 307 | } |
Corentin Wallez | 26a717b | 2016-09-27 08:45:42 -0700 | [diff] [blame] | 308 | |
Corentin Wallez | 6898b35 | 2016-11-10 11:41:15 -0500 | [diff] [blame^] | 309 | // Prior to OpenGL 4.2 BlitFramebuffer (section 4.3.2 of GL 4.1 core profile) reads: |
| 310 | // Blit operations bypass the fragment pipeline. The only fragment operations which |
| 311 | // affect a blit are the pixel ownership test and scissor test. |
| 312 | // Starting from OpenGL 4.2 (section 4.3.2) it reads: |
| 313 | // When values are written to the draw buffers, blit operations bypass the fragment |
| 314 | // pipeline. The only fragment operations which affect a blit are the pixel ownership |
| 315 | // test, the scissor test and sRGB conversion. |
| 316 | if (!needManualColorBlit) |
| 317 | { |
| 318 | bool destSRGB = false; |
| 319 | for (size_t i = 0; i < destFramebuffer->getDrawbufferStateCount(); ++i) |
Corentin Wallez | 26a717b | 2016-09-27 08:45:42 -0700 | [diff] [blame] | 320 | { |
Corentin Wallez | 6898b35 | 2016-11-10 11:41:15 -0500 | [diff] [blame^] | 321 | const FramebufferAttachment *attachment = destFramebuffer->getDrawBuffer(i); |
| 322 | if (attachment && attachment->getColorEncoding() == GL_SRGB) |
Corentin Wallez | 26a717b | 2016-09-27 08:45:42 -0700 | [diff] [blame] | 323 | { |
Corentin Wallez | 6898b35 | 2016-11-10 11:41:15 -0500 | [diff] [blame^] | 324 | destSRGB = true; |
| 325 | break; |
Corentin Wallez | 26a717b | 2016-09-27 08:45:42 -0700 | [diff] [blame] | 326 | } |
Corentin Wallez | 26a717b | 2016-09-27 08:45:42 -0700 | [diff] [blame] | 327 | } |
Corentin Wallez | 6898b35 | 2016-11-10 11:41:15 -0500 | [diff] [blame^] | 328 | |
| 329 | needManualColorBlit = |
| 330 | needManualColorBlit || (destSRGB && mFunctions->isAtMostGL(gl::Version(4, 1))); |
Corentin Wallez | 26a717b | 2016-09-27 08:45:42 -0700 | [diff] [blame] | 331 | } |
| 332 | |
| 333 | // Enable FRAMEBUFFER_SRGB if needed |
Geoff Lang | 1d2c41d | 2016-10-19 16:14:46 -0700 | [diff] [blame] | 334 | mStateManager->setFramebufferSRGBEnabledForFramebuffer(true, this); |
Corentin Wallez | 26a717b | 2016-09-27 08:45:42 -0700 | [diff] [blame] | 335 | |
| 336 | GLenum blitMask = mask; |
Corentin Wallez | 6898b35 | 2016-11-10 11:41:15 -0500 | [diff] [blame^] | 337 | if (needManualColorBlit && (mask & GL_COLOR_BUFFER_BIT) && readAttachmentSamples <= 1) |
Corentin Wallez | 26a717b | 2016-09-27 08:45:42 -0700 | [diff] [blame] | 338 | { |
| 339 | ANGLE_TRY(mBlitter->blitColorBufferWithShader(sourceFramebuffer, destFramebuffer, |
| 340 | sourceArea, destArea, filter)); |
| 341 | blitMask &= ~GL_COLOR_BUFFER_BIT; |
| 342 | } |
| 343 | |
| 344 | if (blitMask == 0) |
| 345 | { |
| 346 | return gl::NoError(); |
| 347 | } |
| 348 | |
| 349 | const FramebufferGL *sourceFramebufferGL = GetImplAs<FramebufferGL>(sourceFramebuffer); |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 350 | mStateManager->bindFramebuffer(GL_READ_FRAMEBUFFER, sourceFramebufferGL->getFramebufferID()); |
| 351 | mStateManager->bindFramebuffer(GL_DRAW_FRAMEBUFFER, mFramebufferID); |
| 352 | |
Jamie Madill | 2da819e | 2015-12-03 15:53:19 -0500 | [diff] [blame] | 353 | mFunctions->blitFramebuffer(sourceArea.x, sourceArea.y, sourceArea.x1(), sourceArea.y1(), |
Corentin Wallez | 26a717b | 2016-09-27 08:45:42 -0700 | [diff] [blame] | 354 | destArea.x, destArea.y, destArea.x1(), destArea.y1(), blitMask, |
| 355 | filter); |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 356 | |
Corentin Wallez | 26a717b | 2016-09-27 08:45:42 -0700 | [diff] [blame] | 357 | return gl::NoError(); |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 358 | } |
| 359 | |
Jamie Madill | cc86d64 | 2015-11-24 13:00:07 -0500 | [diff] [blame] | 360 | bool FramebufferGL::checkStatus() const |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 361 | { |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 362 | mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID); |
Jamie Madill | cc86d64 | 2015-11-24 13:00:07 -0500 | [diff] [blame] | 363 | GLenum status = mFunctions->checkFramebufferStatus(GL_FRAMEBUFFER); |
| 364 | if (status != GL_FRAMEBUFFER_COMPLETE) |
| 365 | { |
| 366 | ANGLEPlatformCurrent()->logWarning("GL framebuffer returned incomplete."); |
| 367 | } |
| 368 | return (status == GL_FRAMEBUFFER_COMPLETE); |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 369 | } |
| 370 | |
Jamie Madill | 60ec6ea | 2016-01-22 15:27:19 -0500 | [diff] [blame] | 371 | void FramebufferGL::syncState(const Framebuffer::DirtyBits &dirtyBits) |
| 372 | { |
| 373 | // Don't need to sync state for the default FBO. |
| 374 | if (mIsDefault) |
| 375 | { |
| 376 | return; |
| 377 | } |
| 378 | |
| 379 | mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID); |
| 380 | |
| 381 | for (auto dirtyBit : angle::IterateBitSet(dirtyBits)) |
| 382 | { |
| 383 | switch (dirtyBit) |
| 384 | { |
| 385 | case Framebuffer::DIRTY_BIT_DEPTH_ATTACHMENT: |
| 386 | BindFramebufferAttachment(mFunctions, GL_DEPTH_ATTACHMENT, |
Jamie Madill | 48ef11b | 2016-04-27 15:21:52 -0400 | [diff] [blame] | 387 | mState.getDepthAttachment()); |
Jamie Madill | 60ec6ea | 2016-01-22 15:27:19 -0500 | [diff] [blame] | 388 | break; |
| 389 | case Framebuffer::DIRTY_BIT_STENCIL_ATTACHMENT: |
| 390 | BindFramebufferAttachment(mFunctions, GL_STENCIL_ATTACHMENT, |
Jamie Madill | 48ef11b | 2016-04-27 15:21:52 -0400 | [diff] [blame] | 391 | mState.getStencilAttachment()); |
Jamie Madill | 60ec6ea | 2016-01-22 15:27:19 -0500 | [diff] [blame] | 392 | break; |
| 393 | case Framebuffer::DIRTY_BIT_DRAW_BUFFERS: |
| 394 | { |
Jamie Madill | 48ef11b | 2016-04-27 15:21:52 -0400 | [diff] [blame] | 395 | const auto &drawBuffers = mState.getDrawBufferStates(); |
Jamie Madill | 60ec6ea | 2016-01-22 15:27:19 -0500 | [diff] [blame] | 396 | mFunctions->drawBuffers(static_cast<GLsizei>(drawBuffers.size()), |
| 397 | drawBuffers.data()); |
| 398 | break; |
| 399 | } |
| 400 | case Framebuffer::DIRTY_BIT_READ_BUFFER: |
Jamie Madill | 48ef11b | 2016-04-27 15:21:52 -0400 | [diff] [blame] | 401 | mFunctions->readBuffer(mState.getReadBufferState()); |
Jamie Madill | 60ec6ea | 2016-01-22 15:27:19 -0500 | [diff] [blame] | 402 | break; |
| 403 | default: |
| 404 | { |
| 405 | ASSERT(Framebuffer::DIRTY_BIT_COLOR_ATTACHMENT_0 == 0 && |
| 406 | dirtyBit < Framebuffer::DIRTY_BIT_COLOR_ATTACHMENT_MAX); |
| 407 | size_t index = |
| 408 | static_cast<size_t>(dirtyBit - Framebuffer::DIRTY_BIT_COLOR_ATTACHMENT_0); |
| 409 | BindFramebufferAttachment(mFunctions, |
| 410 | static_cast<GLenum>(GL_COLOR_ATTACHMENT0 + index), |
Jamie Madill | 48ef11b | 2016-04-27 15:21:52 -0400 | [diff] [blame] | 411 | mState.getColorAttachment(index)); |
Jamie Madill | 60ec6ea | 2016-01-22 15:27:19 -0500 | [diff] [blame] | 412 | break; |
| 413 | } |
| 414 | } |
| 415 | } |
| 416 | } |
| 417 | |
Geoff Lang | 4ad1709 | 2015-03-10 16:47:44 -0400 | [diff] [blame] | 418 | GLuint FramebufferGL::getFramebufferID() const |
| 419 | { |
| 420 | return mFramebufferID; |
Geoff Lang | f9a6f08 | 2015-01-22 13:32:49 -0500 | [diff] [blame] | 421 | } |
| 422 | |
Geoff Lang | 1d2c41d | 2016-10-19 16:14:46 -0700 | [diff] [blame] | 423 | bool FramebufferGL::isDefault() const |
Geoff Lang | afd7f0a | 2015-09-09 15:33:31 -0400 | [diff] [blame] | 424 | { |
Geoff Lang | 1d2c41d | 2016-10-19 16:14:46 -0700 | [diff] [blame] | 425 | return mIsDefault; |
Geoff Lang | afd7f0a | 2015-09-09 15:33:31 -0400 | [diff] [blame] | 426 | } |
| 427 | |
| 428 | void FramebufferGL::syncClearState(GLbitfield mask) |
| 429 | { |
Frank Henigman | a3d333c | 2016-03-22 22:09:14 -0400 | [diff] [blame] | 430 | if (mFunctions->standard == STANDARD_GL_DESKTOP) |
Geoff Lang | afd7f0a | 2015-09-09 15:33:31 -0400 | [diff] [blame] | 431 | { |
Frank Henigman | a3d333c | 2016-03-22 22:09:14 -0400 | [diff] [blame] | 432 | if (mWorkarounds.doesSRGBClearsOnLinearFramebufferAttachments && |
| 433 | (mask & GL_COLOR_BUFFER_BIT) != 0 && !mIsDefault) |
Geoff Lang | afd7f0a | 2015-09-09 15:33:31 -0400 | [diff] [blame] | 434 | { |
Corentin Wallez | 26a717b | 2016-09-27 08:45:42 -0700 | [diff] [blame] | 435 | bool hasSRGBAttachment = false; |
Jamie Madill | 48ef11b | 2016-04-27 15:21:52 -0400 | [diff] [blame] | 436 | for (const auto &attachment : mState.getColorAttachments()) |
Geoff Lang | afd7f0a | 2015-09-09 15:33:31 -0400 | [diff] [blame] | 437 | { |
Frank Henigman | a3d333c | 2016-03-22 22:09:14 -0400 | [diff] [blame] | 438 | if (attachment.isAttached() && attachment.getColorEncoding() == GL_SRGB) |
| 439 | { |
Corentin Wallez | 26a717b | 2016-09-27 08:45:42 -0700 | [diff] [blame] | 440 | hasSRGBAttachment = true; |
Frank Henigman | a3d333c | 2016-03-22 22:09:14 -0400 | [diff] [blame] | 441 | break; |
| 442 | } |
Geoff Lang | afd7f0a | 2015-09-09 15:33:31 -0400 | [diff] [blame] | 443 | } |
Geoff Lang | afd7f0a | 2015-09-09 15:33:31 -0400 | [diff] [blame] | 444 | |
Corentin Wallez | 26a717b | 2016-09-27 08:45:42 -0700 | [diff] [blame] | 445 | mStateManager->setFramebufferSRGBEnabled(hasSRGBAttachment); |
Frank Henigman | a3d333c | 2016-03-22 22:09:14 -0400 | [diff] [blame] | 446 | } |
| 447 | else |
| 448 | { |
| 449 | mStateManager->setFramebufferSRGBEnabled(!mIsDefault); |
| 450 | } |
Geoff Lang | afd7f0a | 2015-09-09 15:33:31 -0400 | [diff] [blame] | 451 | } |
| 452 | } |
| 453 | |
| 454 | void FramebufferGL::syncClearBufferState(GLenum buffer, GLint drawBuffer) |
| 455 | { |
| 456 | if (mFunctions->standard == STANDARD_GL_DESKTOP) |
| 457 | { |
| 458 | if (mWorkarounds.doesSRGBClearsOnLinearFramebufferAttachments && buffer == GL_COLOR && |
| 459 | !mIsDefault) |
| 460 | { |
| 461 | // If doing a clear on a color buffer, set SRGB blend enabled only if the color buffer |
| 462 | // is an SRGB format. |
Jamie Madill | 48ef11b | 2016-04-27 15:21:52 -0400 | [diff] [blame] | 463 | const auto &drawbufferState = mState.getDrawBufferStates(); |
| 464 | const auto &colorAttachments = mState.getColorAttachments(); |
Geoff Lang | afd7f0a | 2015-09-09 15:33:31 -0400 | [diff] [blame] | 465 | |
Jamie Madill | 60ec6ea | 2016-01-22 15:27:19 -0500 | [diff] [blame] | 466 | const FramebufferAttachment *attachment = nullptr; |
Geoff Lang | afd7f0a | 2015-09-09 15:33:31 -0400 | [diff] [blame] | 467 | if (drawbufferState[drawBuffer] >= GL_COLOR_ATTACHMENT0 && |
| 468 | drawbufferState[drawBuffer] < GL_COLOR_ATTACHMENT0 + colorAttachments.size()) |
| 469 | { |
| 470 | size_t attachmentIdx = |
| 471 | static_cast<size_t>(drawbufferState[drawBuffer] - GL_COLOR_ATTACHMENT0); |
| 472 | attachment = &colorAttachments[attachmentIdx]; |
| 473 | } |
| 474 | |
| 475 | if (attachment != nullptr) |
| 476 | { |
| 477 | mStateManager->setFramebufferSRGBEnabled(attachment->getColorEncoding() == GL_SRGB); |
| 478 | } |
| 479 | } |
| 480 | else |
| 481 | { |
| 482 | mStateManager->setFramebufferSRGBEnabled(!mIsDefault); |
| 483 | } |
| 484 | } |
| 485 | } |
Corentin Wallez | 9a8d366 | 2016-09-22 12:18:29 -0400 | [diff] [blame] | 486 | gl::Error FramebufferGL::readPixelsRowByRowWorkaround(const gl::Rectangle &area, |
| 487 | GLenum format, |
| 488 | GLenum type, |
| 489 | const gl::PixelPackState &pack, |
| 490 | GLvoid *pixels) const |
| 491 | { |
| 492 | intptr_t offset = reinterpret_cast<intptr_t>(pixels); |
| 493 | |
| 494 | const gl::InternalFormat &glFormat = |
| 495 | gl::GetInternalFormatInfo(gl::GetSizedInternalFormat(format, type)); |
| 496 | GLuint rowBytes = 0; |
| 497 | ANGLE_TRY_RESULT(glFormat.computeRowPitch(type, area.width, pack.alignment, pack.rowLength), |
| 498 | rowBytes); |
| 499 | GLuint skipBytes = 0; |
Corentin Wallez | 886de36 | 2016-09-27 10:49:35 -0400 | [diff] [blame] | 500 | ANGLE_TRY_RESULT(glFormat.computeSkipBytes(rowBytes, 0, pack, false), skipBytes); |
Corentin Wallez | 9a8d366 | 2016-09-22 12:18:29 -0400 | [diff] [blame] | 501 | |
| 502 | gl::PixelPackState directPack; |
| 503 | directPack.pixelBuffer = pack.pixelBuffer; |
| 504 | directPack.alignment = 1; |
| 505 | mStateManager->setPixelPackState(directPack); |
| 506 | directPack.pixelBuffer.set(nullptr); |
| 507 | |
| 508 | offset += skipBytes; |
| 509 | for (GLint row = 0; row < area.height; ++row) |
| 510 | { |
| 511 | mFunctions->readPixels(area.x, row + area.y, area.width, 1, format, type, |
| 512 | reinterpret_cast<GLvoid *>(offset)); |
| 513 | offset += row * rowBytes; |
| 514 | } |
| 515 | |
| 516 | return gl::NoError(); |
| 517 | } |
| 518 | |
| 519 | gl::Error FramebufferGL::readPixelsPaddingWorkaround(const gl::Rectangle &area, |
| 520 | GLenum format, |
| 521 | GLenum type, |
| 522 | const gl::PixelPackState &pack, |
| 523 | GLvoid *pixels) const |
| 524 | { |
| 525 | const gl::InternalFormat &glFormat = |
| 526 | gl::GetInternalFormatInfo(gl::GetSizedInternalFormat(format, type)); |
| 527 | GLuint rowBytes = 0; |
| 528 | ANGLE_TRY_RESULT(glFormat.computeRowPitch(type, area.width, pack.alignment, pack.rowLength), |
| 529 | rowBytes); |
| 530 | GLuint skipBytes = 0; |
Corentin Wallez | 886de36 | 2016-09-27 10:49:35 -0400 | [diff] [blame] | 531 | ANGLE_TRY_RESULT(glFormat.computeSkipBytes(rowBytes, 0, pack, false), skipBytes); |
Corentin Wallez | 9a8d366 | 2016-09-22 12:18:29 -0400 | [diff] [blame] | 532 | |
| 533 | // Get all by the last row |
| 534 | if (area.height > 1) |
| 535 | { |
| 536 | mFunctions->readPixels(area.x, area.y, area.width, area.height - 1, format, type, pixels); |
| 537 | } |
| 538 | |
| 539 | // Get the last row manually |
| 540 | gl::PixelPackState directPack; |
| 541 | directPack.pixelBuffer = pack.pixelBuffer; |
| 542 | directPack.alignment = 1; |
| 543 | mStateManager->setPixelPackState(directPack); |
| 544 | directPack.pixelBuffer.set(nullptr); |
| 545 | |
| 546 | intptr_t lastRowOffset = |
| 547 | reinterpret_cast<intptr_t>(pixels) + skipBytes + (area.height - 1) * rowBytes; |
| 548 | mFunctions->readPixels(area.x, area.y + area.height - 1, area.width, 1, format, type, |
| 549 | reinterpret_cast<GLvoid *>(lastRowOffset)); |
| 550 | |
| 551 | return gl::NoError(); |
| 552 | } |
Jamie Madill | 60ec6ea | 2016-01-22 15:27:19 -0500 | [diff] [blame] | 553 | } // namespace rx |