Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 1 | // |
| 2 | // Copyright 2016 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 | // FramebufferVk.cpp: |
| 7 | // Implements the class methods for FramebufferVk. |
| 8 | // |
| 9 | |
| 10 | #include "libANGLE/renderer/vulkan/FramebufferVk.h" |
| 11 | |
Jamie Madill | 7b57b9d | 2017-01-13 09:33:38 -0500 | [diff] [blame] | 12 | #include <vulkan/vulkan.h> |
Jamie Madill | 231c7f5 | 2017-04-26 13:45:37 -0400 | [diff] [blame] | 13 | #include <array> |
Jamie Madill | 7b57b9d | 2017-01-13 09:33:38 -0500 | [diff] [blame] | 14 | |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 15 | #include "common/debug.h" |
Jamie Madill | 7b57b9d | 2017-01-13 09:33:38 -0500 | [diff] [blame] | 16 | #include "image_util/imageformats.h" |
Jamie Madill | c564c07 | 2017-06-01 12:45:42 -0400 | [diff] [blame] | 17 | #include "libANGLE/Context.h" |
| 18 | #include "libANGLE/Display.h" |
Jamie Madill | 7b57b9d | 2017-01-13 09:33:38 -0500 | [diff] [blame] | 19 | #include "libANGLE/formatutils.h" |
| 20 | #include "libANGLE/renderer/renderer_utils.h" |
| 21 | #include "libANGLE/renderer/vulkan/ContextVk.h" |
Jamie Madill | 5deea72 | 2017-02-16 10:44:46 -0500 | [diff] [blame] | 22 | #include "libANGLE/renderer/vulkan/DisplayVk.h" |
Jamie Madill | 7b57b9d | 2017-01-13 09:33:38 -0500 | [diff] [blame] | 23 | #include "libANGLE/renderer/vulkan/RenderTargetVk.h" |
| 24 | #include "libANGLE/renderer/vulkan/RendererVk.h" |
| 25 | #include "libANGLE/renderer/vulkan/SurfaceVk.h" |
| 26 | #include "libANGLE/renderer/vulkan/formatutilsvk.h" |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 27 | |
| 28 | namespace rx |
| 29 | { |
| 30 | |
Jamie Madill | 7b57b9d | 2017-01-13 09:33:38 -0500 | [diff] [blame] | 31 | namespace |
| 32 | { |
Jamie Madill | 7b57b9d | 2017-01-13 09:33:38 -0500 | [diff] [blame] | 33 | gl::ErrorOrResult<const gl::InternalFormat *> GetReadAttachmentInfo( |
Jamie Madill | 4928b7c | 2017-06-20 12:57:39 -0400 | [diff] [blame] | 34 | const gl::Context *context, |
Jamie Madill | 7b57b9d | 2017-01-13 09:33:38 -0500 | [diff] [blame] | 35 | const gl::FramebufferAttachment *readAttachment) |
| 36 | { |
| 37 | RenderTargetVk *renderTarget = nullptr; |
Jamie Madill | 4928b7c | 2017-06-20 12:57:39 -0400 | [diff] [blame] | 38 | ANGLE_TRY(readAttachment->getRenderTarget(context, &renderTarget)); |
Jamie Madill | 7b57b9d | 2017-01-13 09:33:38 -0500 | [diff] [blame] | 39 | |
Jamie Madill | 1d7be50 | 2017-10-29 18:06:50 -0400 | [diff] [blame] | 40 | GLenum implFormat = renderTarget->format->textureFormat().fboImplementationInternalFormat; |
Geoff Lang | ca27139 | 2017-04-05 12:30:00 -0400 | [diff] [blame] | 41 | return &gl::GetSizedInternalFormatInfo(implFormat); |
Jamie Madill | 7b57b9d | 2017-01-13 09:33:38 -0500 | [diff] [blame] | 42 | } |
Jamie Madill | 7b57b9d | 2017-01-13 09:33:38 -0500 | [diff] [blame] | 43 | } // anonymous namespace |
| 44 | |
| 45 | // static |
| 46 | FramebufferVk *FramebufferVk::CreateUserFBO(const gl::FramebufferState &state) |
| 47 | { |
| 48 | return new FramebufferVk(state); |
| 49 | } |
| 50 | |
| 51 | // static |
| 52 | FramebufferVk *FramebufferVk::CreateDefaultFBO(const gl::FramebufferState &state, |
| 53 | WindowSurfaceVk *backbuffer) |
| 54 | { |
| 55 | return new FramebufferVk(state, backbuffer); |
| 56 | } |
| 57 | |
Jamie Madill | ab9f9c3 | 2017-01-17 17:47:34 -0500 | [diff] [blame] | 58 | FramebufferVk::FramebufferVk(const gl::FramebufferState &state) |
Jamie Madill | 9f2a861 | 2017-11-30 12:43:09 -0500 | [diff] [blame] | 59 | : FramebufferImpl(state), mBackbuffer(nullptr), mRenderPassDesc(), mFramebuffer() |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 60 | { |
| 61 | } |
| 62 | |
Jamie Madill | 7b57b9d | 2017-01-13 09:33:38 -0500 | [diff] [blame] | 63 | FramebufferVk::FramebufferVk(const gl::FramebufferState &state, WindowSurfaceVk *backbuffer) |
Jamie Madill | 9f2a861 | 2017-11-30 12:43:09 -0500 | [diff] [blame] | 64 | : FramebufferImpl(state), mBackbuffer(backbuffer), mRenderPassDesc(), mFramebuffer() |
Jamie Madill | 7b57b9d | 2017-01-13 09:33:38 -0500 | [diff] [blame] | 65 | { |
| 66 | } |
| 67 | |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 68 | FramebufferVk::~FramebufferVk() |
| 69 | { |
| 70 | } |
| 71 | |
Jamie Madill | c564c07 | 2017-06-01 12:45:42 -0400 | [diff] [blame] | 72 | void FramebufferVk::destroy(const gl::Context *context) |
Jamie Madill | 5deea72 | 2017-02-16 10:44:46 -0500 | [diff] [blame] | 73 | { |
Jamie Madill | e1f3ad4 | 2017-10-28 23:00:42 -0400 | [diff] [blame] | 74 | RendererVk *renderer = vk::GetImpl(context)->getRenderer(); |
Jamie Madill | 5deea72 | 2017-02-16 10:44:46 -0500 | [diff] [blame] | 75 | |
Jamie Madill | 526543c | 2017-10-28 10:59:16 -0400 | [diff] [blame] | 76 | renderer->releaseResource(*this, &mFramebuffer); |
Jamie Madill | 5deea72 | 2017-02-16 10:44:46 -0500 | [diff] [blame] | 77 | } |
| 78 | |
Jamie Madill | c564c07 | 2017-06-01 12:45:42 -0400 | [diff] [blame] | 79 | void FramebufferVk::destroyDefault(const egl::Display *display) |
Jamie Madill | 5deea72 | 2017-02-16 10:44:46 -0500 | [diff] [blame] | 80 | { |
Jamie Madill | e1f3ad4 | 2017-10-28 23:00:42 -0400 | [diff] [blame] | 81 | VkDevice device = vk::GetImpl(display)->getRenderer()->getDevice(); |
Jamie Madill | 5deea72 | 2017-02-16 10:44:46 -0500 | [diff] [blame] | 82 | |
Jamie Madill | 5deea72 | 2017-02-16 10:44:46 -0500 | [diff] [blame] | 83 | mFramebuffer.destroy(device); |
| 84 | } |
| 85 | |
Jamie Madill | 4928b7c | 2017-06-20 12:57:39 -0400 | [diff] [blame] | 86 | gl::Error FramebufferVk::discard(const gl::Context *context, |
| 87 | size_t count, |
| 88 | const GLenum *attachments) |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 89 | { |
| 90 | UNIMPLEMENTED(); |
Yuly Novikov | c4d18aa | 2017-03-09 18:45:02 -0500 | [diff] [blame] | 91 | return gl::InternalError(); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 92 | } |
| 93 | |
Jamie Madill | 4928b7c | 2017-06-20 12:57:39 -0400 | [diff] [blame] | 94 | gl::Error FramebufferVk::invalidate(const gl::Context *context, |
| 95 | size_t count, |
| 96 | const GLenum *attachments) |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 97 | { |
| 98 | UNIMPLEMENTED(); |
Yuly Novikov | c4d18aa | 2017-03-09 18:45:02 -0500 | [diff] [blame] | 99 | return gl::InternalError(); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 100 | } |
| 101 | |
Jamie Madill | 4928b7c | 2017-06-20 12:57:39 -0400 | [diff] [blame] | 102 | gl::Error FramebufferVk::invalidateSub(const gl::Context *context, |
| 103 | size_t count, |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 104 | const GLenum *attachments, |
| 105 | const gl::Rectangle &area) |
| 106 | { |
| 107 | UNIMPLEMENTED(); |
Yuly Novikov | c4d18aa | 2017-03-09 18:45:02 -0500 | [diff] [blame] | 108 | return gl::InternalError(); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 109 | } |
| 110 | |
Jamie Madill | c564c07 | 2017-06-01 12:45:42 -0400 | [diff] [blame] | 111 | gl::Error FramebufferVk::clear(const gl::Context *context, GLbitfield mask) |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 112 | { |
Jamie Madill | e1f3ad4 | 2017-10-28 23:00:42 -0400 | [diff] [blame] | 113 | ContextVk *contextVk = vk::GetImpl(context); |
Jamie Madill | 7b57b9d | 2017-01-13 09:33:38 -0500 | [diff] [blame] | 114 | |
| 115 | if (mState.getDepthAttachment() && (mask & GL_DEPTH_BUFFER_BIT) != 0) |
| 116 | { |
| 117 | // TODO(jmadill): Depth clear |
| 118 | UNIMPLEMENTED(); |
| 119 | } |
| 120 | |
| 121 | if (mState.getStencilAttachment() && (mask & GL_STENCIL_BUFFER_BIT) != 0) |
| 122 | { |
| 123 | // TODO(jmadill): Stencil clear |
| 124 | UNIMPLEMENTED(); |
| 125 | } |
| 126 | |
| 127 | if ((mask & GL_COLOR_BUFFER_BIT) == 0) |
| 128 | { |
| 129 | return gl::NoError(); |
| 130 | } |
| 131 | |
| 132 | const auto &glState = context->getGLState(); |
| 133 | const auto &clearColor = glState.getColorClearValue(); |
| 134 | VkClearColorValue clearColorValue; |
| 135 | clearColorValue.float32[0] = clearColor.red; |
| 136 | clearColorValue.float32[1] = clearColor.green; |
| 137 | clearColorValue.float32[2] = clearColor.blue; |
| 138 | clearColorValue.float32[3] = clearColor.alpha; |
| 139 | |
| 140 | // TODO(jmadill): Scissored clears. |
| 141 | const auto *attachment = mState.getFirstNonNullAttachment(); |
| 142 | ASSERT(attachment && attachment->isAttached()); |
| 143 | const auto &size = attachment->getSize(); |
| 144 | const gl::Rectangle renderArea(0, 0, size.width, size.height); |
| 145 | |
Jamie Madill | 7f738d4 | 2017-11-20 17:06:27 -0500 | [diff] [blame] | 146 | vk::CommandBufferAndState *commandBuffer = nullptr; |
Jamie Madill | 0c0dc34 | 2017-03-24 14:18:51 -0400 | [diff] [blame] | 147 | ANGLE_TRY(contextVk->getStartedCommandBuffer(&commandBuffer)); |
Jamie Madill | 7b57b9d | 2017-01-13 09:33:38 -0500 | [diff] [blame] | 148 | |
| 149 | for (const auto &colorAttachment : mState.getColorAttachments()) |
| 150 | { |
| 151 | if (colorAttachment.isAttached()) |
| 152 | { |
| 153 | RenderTargetVk *renderTarget = nullptr; |
Jamie Madill | 4928b7c | 2017-06-20 12:57:39 -0400 | [diff] [blame] | 154 | ANGLE_TRY(colorAttachment.getRenderTarget(context, &renderTarget)); |
Jamie Madill | 7b57b9d | 2017-01-13 09:33:38 -0500 | [diff] [blame] | 155 | renderTarget->image->changeLayoutTop( |
| 156 | VK_IMAGE_ASPECT_COLOR_BIT, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, commandBuffer); |
| 157 | commandBuffer->clearSingleColorImage(*renderTarget->image, clearColorValue); |
| 158 | } |
| 159 | } |
| 160 | |
Jamie Madill | 7b57b9d | 2017-01-13 09:33:38 -0500 | [diff] [blame] | 161 | return gl::NoError(); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 162 | } |
| 163 | |
Jamie Madill | c564c07 | 2017-06-01 12:45:42 -0400 | [diff] [blame] | 164 | gl::Error FramebufferVk::clearBufferfv(const gl::Context *context, |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 165 | GLenum buffer, |
| 166 | GLint drawbuffer, |
| 167 | const GLfloat *values) |
| 168 | { |
| 169 | UNIMPLEMENTED(); |
Yuly Novikov | c4d18aa | 2017-03-09 18:45:02 -0500 | [diff] [blame] | 170 | return gl::InternalError(); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 171 | } |
| 172 | |
Jamie Madill | c564c07 | 2017-06-01 12:45:42 -0400 | [diff] [blame] | 173 | gl::Error FramebufferVk::clearBufferuiv(const gl::Context *context, |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 174 | GLenum buffer, |
| 175 | GLint drawbuffer, |
| 176 | const GLuint *values) |
| 177 | { |
| 178 | UNIMPLEMENTED(); |
Yuly Novikov | c4d18aa | 2017-03-09 18:45:02 -0500 | [diff] [blame] | 179 | return gl::InternalError(); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 180 | } |
| 181 | |
Jamie Madill | c564c07 | 2017-06-01 12:45:42 -0400 | [diff] [blame] | 182 | gl::Error FramebufferVk::clearBufferiv(const gl::Context *context, |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 183 | GLenum buffer, |
| 184 | GLint drawbuffer, |
| 185 | const GLint *values) |
| 186 | { |
| 187 | UNIMPLEMENTED(); |
Yuly Novikov | c4d18aa | 2017-03-09 18:45:02 -0500 | [diff] [blame] | 188 | return gl::InternalError(); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 189 | } |
| 190 | |
Jamie Madill | c564c07 | 2017-06-01 12:45:42 -0400 | [diff] [blame] | 191 | gl::Error FramebufferVk::clearBufferfi(const gl::Context *context, |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 192 | GLenum buffer, |
| 193 | GLint drawbuffer, |
| 194 | GLfloat depth, |
| 195 | GLint stencil) |
| 196 | { |
| 197 | UNIMPLEMENTED(); |
Yuly Novikov | c4d18aa | 2017-03-09 18:45:02 -0500 | [diff] [blame] | 198 | return gl::InternalError(); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 199 | } |
| 200 | |
Jamie Madill | 4928b7c | 2017-06-20 12:57:39 -0400 | [diff] [blame] | 201 | GLenum FramebufferVk::getImplementationColorReadFormat(const gl::Context *context) const |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 202 | { |
Jamie Madill | 4928b7c | 2017-06-20 12:57:39 -0400 | [diff] [blame] | 203 | auto errOrResult = GetReadAttachmentInfo(context, mState.getReadAttachment()); |
Jamie Madill | 7b57b9d | 2017-01-13 09:33:38 -0500 | [diff] [blame] | 204 | |
| 205 | // TODO(jmadill): Handle getRenderTarget error. |
| 206 | if (errOrResult.isError()) |
| 207 | { |
Yuly Novikov | d73f852 | 2017-01-13 17:48:57 -0500 | [diff] [blame] | 208 | ERR() << "Internal error in FramebufferVk::getImplementationColorReadFormat."; |
Jamie Madill | 7b57b9d | 2017-01-13 09:33:38 -0500 | [diff] [blame] | 209 | return GL_NONE; |
| 210 | } |
| 211 | |
| 212 | return errOrResult.getResult()->format; |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 213 | } |
| 214 | |
Jamie Madill | 4928b7c | 2017-06-20 12:57:39 -0400 | [diff] [blame] | 215 | GLenum FramebufferVk::getImplementationColorReadType(const gl::Context *context) const |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 216 | { |
Jamie Madill | 4928b7c | 2017-06-20 12:57:39 -0400 | [diff] [blame] | 217 | auto errOrResult = GetReadAttachmentInfo(context, mState.getReadAttachment()); |
Jamie Madill | 7b57b9d | 2017-01-13 09:33:38 -0500 | [diff] [blame] | 218 | |
| 219 | // TODO(jmadill): Handle getRenderTarget error. |
| 220 | if (errOrResult.isError()) |
| 221 | { |
Yuly Novikov | d73f852 | 2017-01-13 17:48:57 -0500 | [diff] [blame] | 222 | ERR() << "Internal error in FramebufferVk::getImplementationColorReadFormat."; |
Jamie Madill | 7b57b9d | 2017-01-13 09:33:38 -0500 | [diff] [blame] | 223 | return GL_NONE; |
| 224 | } |
| 225 | |
| 226 | return errOrResult.getResult()->type; |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 227 | } |
| 228 | |
Jamie Madill | c564c07 | 2017-06-01 12:45:42 -0400 | [diff] [blame] | 229 | gl::Error FramebufferVk::readPixels(const gl::Context *context, |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 230 | const gl::Rectangle &area, |
| 231 | GLenum format, |
| 232 | GLenum type, |
Jamie Madill | d482615 | 2017-09-21 11:18:59 -0400 | [diff] [blame] | 233 | void *pixels) |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 234 | { |
Jamie Madill | 7b57b9d | 2017-01-13 09:33:38 -0500 | [diff] [blame] | 235 | const auto &glState = context->getGLState(); |
| 236 | const auto *readFramebuffer = glState.getReadFramebuffer(); |
| 237 | const auto *readAttachment = readFramebuffer->getReadColorbuffer(); |
| 238 | |
| 239 | RenderTargetVk *renderTarget = nullptr; |
Jamie Madill | 4928b7c | 2017-06-20 12:57:39 -0400 | [diff] [blame] | 240 | ANGLE_TRY(readAttachment->getRenderTarget(context, &renderTarget)); |
Jamie Madill | 7b57b9d | 2017-01-13 09:33:38 -0500 | [diff] [blame] | 241 | |
Jamie Madill | e1f3ad4 | 2017-10-28 23:00:42 -0400 | [diff] [blame] | 242 | ContextVk *contextVk = vk::GetImpl(context); |
Jamie Madill | 7b57b9d | 2017-01-13 09:33:38 -0500 | [diff] [blame] | 243 | RendererVk *renderer = contextVk->getRenderer(); |
Jamie Madill | 5deea72 | 2017-02-16 10:44:46 -0500 | [diff] [blame] | 244 | VkDevice device = renderer->getDevice(); |
Jamie Madill | 7b57b9d | 2017-01-13 09:33:38 -0500 | [diff] [blame] | 245 | |
| 246 | vk::Image *readImage = renderTarget->image; |
| 247 | vk::StagingImage stagingImage; |
Jamie Madill | 5deea72 | 2017-02-16 10:44:46 -0500 | [diff] [blame] | 248 | ANGLE_TRY(renderer->createStagingImage(TextureDimension::TEX_2D, *renderTarget->format, |
Jamie Madill | 035fd6b | 2017-10-03 15:43:22 -0400 | [diff] [blame] | 249 | renderTarget->extents, vk::StagingUsage::Read, |
| 250 | &stagingImage)); |
Jamie Madill | 7b57b9d | 2017-01-13 09:33:38 -0500 | [diff] [blame] | 251 | |
Jamie Madill | 7f738d4 | 2017-11-20 17:06:27 -0500 | [diff] [blame] | 252 | vk::CommandBufferAndState *commandBuffer = nullptr; |
Jamie Madill | 0c0dc34 | 2017-03-24 14:18:51 -0400 | [diff] [blame] | 253 | ANGLE_TRY(contextVk->getStartedCommandBuffer(&commandBuffer)); |
| 254 | |
Jamie Madill | d482615 | 2017-09-21 11:18:59 -0400 | [diff] [blame] | 255 | // End render pass if we're in one. |
Jamie Madill | 1b03824 | 2017-11-01 15:14:36 -0400 | [diff] [blame] | 256 | renderer->endRenderPass(); |
Jamie Madill | d482615 | 2017-09-21 11:18:59 -0400 | [diff] [blame] | 257 | |
Jamie Madill | 7b57b9d | 2017-01-13 09:33:38 -0500 | [diff] [blame] | 258 | stagingImage.getImage().changeLayoutTop(VK_IMAGE_ASPECT_COLOR_BIT, VK_IMAGE_LAYOUT_GENERAL, |
| 259 | commandBuffer); |
| 260 | |
Jamie Madill | d33c77c | 2017-11-09 13:08:30 -0500 | [diff] [blame] | 261 | readImage->changeLayoutWithStages( |
| 262 | VK_IMAGE_ASPECT_COLOR_BIT, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, |
| 263 | VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, commandBuffer); |
Jamie Madill | 815a6c9 | 2017-10-21 14:33:04 -0400 | [diff] [blame] | 264 | |
| 265 | VkImageCopy region; |
| 266 | region.srcSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; |
| 267 | region.srcSubresource.mipLevel = 0; |
| 268 | region.srcSubresource.baseArrayLayer = 0; |
| 269 | region.srcSubresource.layerCount = 1; |
| 270 | region.srcOffset.x = area.x; |
| 271 | region.srcOffset.y = area.y; |
| 272 | region.srcOffset.z = 0; |
| 273 | region.dstSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; |
| 274 | region.dstSubresource.mipLevel = 0; |
| 275 | region.dstSubresource.baseArrayLayer = 0; |
| 276 | region.dstSubresource.layerCount = 1; |
| 277 | region.dstOffset.x = 0; |
| 278 | region.dstOffset.y = 0; |
| 279 | region.dstOffset.z = 0; |
| 280 | region.extent.width = area.width; |
| 281 | region.extent.height = area.height; |
| 282 | region.extent.depth = 1; |
| 283 | |
| 284 | commandBuffer->copyImage(*readImage, stagingImage.getImage(), 1, ®ion); |
Jamie Madill | 7b57b9d | 2017-01-13 09:33:38 -0500 | [diff] [blame] | 285 | |
Jamie Madill | 0c0dc34 | 2017-03-24 14:18:51 -0400 | [diff] [blame] | 286 | ANGLE_TRY(renderer->submitAndFinishCommandBuffer(commandBuffer)); |
Jamie Madill | 7b57b9d | 2017-01-13 09:33:38 -0500 | [diff] [blame] | 287 | |
| 288 | // TODO(jmadill): parameters |
| 289 | uint8_t *mapPointer = nullptr; |
Jamie Madill | 5deea72 | 2017-02-16 10:44:46 -0500 | [diff] [blame] | 290 | ANGLE_TRY( |
| 291 | stagingImage.getDeviceMemory().map(device, 0, stagingImage.getSize(), 0, &mapPointer)); |
Jamie Madill | 7b57b9d | 2017-01-13 09:33:38 -0500 | [diff] [blame] | 292 | |
Jamie Madill | 1d7be50 | 2017-10-29 18:06:50 -0400 | [diff] [blame] | 293 | const auto &angleFormat = renderTarget->format->textureFormat(); |
Jamie Madill | 7b57b9d | 2017-01-13 09:33:38 -0500 | [diff] [blame] | 294 | |
| 295 | // TODO(jmadill): Use pixel bytes from the ANGLE format directly. |
Geoff Lang | ca27139 | 2017-04-05 12:30:00 -0400 | [diff] [blame] | 296 | const auto &glFormat = gl::GetSizedInternalFormatInfo(angleFormat.glInternalFormat); |
Jamie Madill | 7b57b9d | 2017-01-13 09:33:38 -0500 | [diff] [blame] | 297 | int inputPitch = glFormat.pixelBytes * area.width; |
| 298 | |
| 299 | PackPixelsParams params; |
| 300 | params.area = area; |
| 301 | params.format = format; |
| 302 | params.type = type; |
| 303 | params.outputPitch = inputPitch; |
Corentin Wallez | 336129f | 2017-10-17 15:55:40 -0400 | [diff] [blame] | 304 | params.packBuffer = glState.getTargetBuffer(gl::BufferBinding::PixelPack); |
Corentin Wallez | cda6af1 | 2017-10-30 19:20:37 -0400 | [diff] [blame] | 305 | params.pack = glState.getPackState(); |
Jamie Madill | 7b57b9d | 2017-01-13 09:33:38 -0500 | [diff] [blame] | 306 | |
| 307 | PackPixels(params, angleFormat, inputPitch, mapPointer, reinterpret_cast<uint8_t *>(pixels)); |
| 308 | |
Jamie Madill | 5deea72 | 2017-02-16 10:44:46 -0500 | [diff] [blame] | 309 | stagingImage.getDeviceMemory().unmap(device); |
Jamie Madill | e88ec8e | 2017-10-31 17:18:14 -0400 | [diff] [blame] | 310 | renderer->releaseObject(renderer->getCurrentQueueSerial(), &stagingImage); |
Jamie Madill | f651c77 | 2017-02-21 15:03:51 -0500 | [diff] [blame] | 311 | |
Jamie Madill | 7b57b9d | 2017-01-13 09:33:38 -0500 | [diff] [blame] | 312 | return vk::NoError(); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 313 | } |
| 314 | |
Jamie Madill | c564c07 | 2017-06-01 12:45:42 -0400 | [diff] [blame] | 315 | gl::Error FramebufferVk::blit(const gl::Context *context, |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 316 | const gl::Rectangle &sourceArea, |
| 317 | const gl::Rectangle &destArea, |
| 318 | GLbitfield mask, |
| 319 | GLenum filter) |
| 320 | { |
| 321 | UNIMPLEMENTED(); |
Yuly Novikov | c4d18aa | 2017-03-09 18:45:02 -0500 | [diff] [blame] | 322 | return gl::InternalError(); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 323 | } |
| 324 | |
Kenneth Russell | ce8602a | 2017-10-03 18:23:08 -0700 | [diff] [blame] | 325 | bool FramebufferVk::checkStatus(const gl::Context *context) const |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 326 | { |
Jamie Madill | b79e7bb | 2017-10-24 13:55:50 -0400 | [diff] [blame] | 327 | return true; |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 328 | } |
| 329 | |
Jamie Madill | c564c07 | 2017-06-01 12:45:42 -0400 | [diff] [blame] | 330 | void FramebufferVk::syncState(const gl::Context *context, |
| 331 | const gl::Framebuffer::DirtyBits &dirtyBits) |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 332 | { |
Jamie Madill | e1f3ad4 | 2017-10-28 23:00:42 -0400 | [diff] [blame] | 333 | ContextVk *contextVk = vk::GetImpl(context); |
Jamie Madill | 7bd1666 | 2017-10-28 19:40:50 -0400 | [diff] [blame] | 334 | RendererVk *renderer = contextVk->getRenderer(); |
Jamie Madill | dd43e6c | 2017-03-24 14:18:49 -0400 | [diff] [blame] | 335 | |
| 336 | ASSERT(dirtyBits.any()); |
| 337 | |
Jamie Madill | 7b57b9d | 2017-01-13 09:33:38 -0500 | [diff] [blame] | 338 | // TODO(jmadill): Smarter update. |
Jamie Madill | 9f2a861 | 2017-11-30 12:43:09 -0500 | [diff] [blame] | 339 | mRenderPassDesc.reset(); |
Jamie Madill | 7bd1666 | 2017-10-28 19:40:50 -0400 | [diff] [blame] | 340 | renderer->releaseResource(*this, &mFramebuffer); |
| 341 | renderer->onReleaseRenderPass(this); |
Jamie Madill | 7210656 | 2017-03-24 14:18:50 -0400 | [diff] [blame] | 342 | |
| 343 | // TODO(jmadill): Use pipeline cache. |
| 344 | contextVk->invalidateCurrentPipeline(); |
Jamie Madill | ab9f9c3 | 2017-01-17 17:47:34 -0500 | [diff] [blame] | 345 | } |
| 346 | |
Jamie Madill | 9f2a861 | 2017-11-30 12:43:09 -0500 | [diff] [blame] | 347 | const vk::RenderPassDesc &FramebufferVk::getRenderPassDesc(const gl::Context *context) |
Jamie Madill | ab9f9c3 | 2017-01-17 17:47:34 -0500 | [diff] [blame] | 348 | { |
Jamie Madill | 9f2a861 | 2017-11-30 12:43:09 -0500 | [diff] [blame] | 349 | if (mRenderPassDesc.valid()) |
Jamie Madill | ab9f9c3 | 2017-01-17 17:47:34 -0500 | [diff] [blame] | 350 | { |
Jamie Madill | 9f2a861 | 2017-11-30 12:43:09 -0500 | [diff] [blame] | 351 | return mRenderPassDesc.value(); |
Jamie Madill | ab9f9c3 | 2017-01-17 17:47:34 -0500 | [diff] [blame] | 352 | } |
| 353 | |
Jamie Madill | 0b684ce | 2017-11-23 12:57:39 -0500 | [diff] [blame] | 354 | vk::RenderPassDesc desc; |
Jamie Madill | ab9f9c3 | 2017-01-17 17:47:34 -0500 | [diff] [blame] | 355 | |
| 356 | const auto &colorAttachments = mState.getColorAttachments(); |
| 357 | for (size_t attachmentIndex = 0; attachmentIndex < colorAttachments.size(); ++attachmentIndex) |
| 358 | { |
| 359 | const auto &colorAttachment = colorAttachments[attachmentIndex]; |
| 360 | if (colorAttachment.isAttached()) |
| 361 | { |
Jamie Madill | ab9f9c3 | 2017-01-17 17:47:34 -0500 | [diff] [blame] | 362 | RenderTargetVk *renderTarget = nullptr; |
Jamie Madill | 9f2a861 | 2017-11-30 12:43:09 -0500 | [diff] [blame] | 363 | ANGLE_SWALLOW_ERR(colorAttachment.getRenderTarget(context, &renderTarget)); |
Jamie Madill | bef918c | 2017-12-13 13:11:30 -0500 | [diff] [blame^] | 364 | desc.packColorAttachment(*renderTarget->format, colorAttachment.getSamples()); |
Jamie Madill | ab9f9c3 | 2017-01-17 17:47:34 -0500 | [diff] [blame] | 365 | } |
| 366 | } |
| 367 | |
| 368 | const auto *depthStencilAttachment = mState.getDepthStencilAttachment(); |
Jamie Madill | ab9f9c3 | 2017-01-17 17:47:34 -0500 | [diff] [blame] | 369 | |
Jamie Madill | 0b684ce | 2017-11-23 12:57:39 -0500 | [diff] [blame] | 370 | if (depthStencilAttachment && depthStencilAttachment->isAttached()) |
Jamie Madill | ab9f9c3 | 2017-01-17 17:47:34 -0500 | [diff] [blame] | 371 | { |
Jamie Madill | ab9f9c3 | 2017-01-17 17:47:34 -0500 | [diff] [blame] | 372 | RenderTargetVk *renderTarget = nullptr; |
Jamie Madill | 9f2a861 | 2017-11-30 12:43:09 -0500 | [diff] [blame] | 373 | ANGLE_SWALLOW_ERR(depthStencilAttachment->getRenderTarget(context, &renderTarget)); |
Jamie Madill | bef918c | 2017-12-13 13:11:30 -0500 | [diff] [blame^] | 374 | desc.packDepthStencilAttachment(*renderTarget->format, |
| 375 | depthStencilAttachment->getSamples()); |
Jamie Madill | ab9f9c3 | 2017-01-17 17:47:34 -0500 | [diff] [blame] | 376 | } |
| 377 | |
Jamie Madill | 9f2a861 | 2017-11-30 12:43:09 -0500 | [diff] [blame] | 378 | mRenderPassDesc = desc; |
| 379 | return mRenderPassDesc.value(); |
Jamie Madill | ab9f9c3 | 2017-01-17 17:47:34 -0500 | [diff] [blame] | 380 | } |
| 381 | |
Jamie Madill | 4928b7c | 2017-06-20 12:57:39 -0400 | [diff] [blame] | 382 | gl::ErrorOrResult<vk::Framebuffer *> FramebufferVk::getFramebuffer(const gl::Context *context, |
Jamie Madill | 9f2a861 | 2017-11-30 12:43:09 -0500 | [diff] [blame] | 383 | RendererVk *rendererVk) |
Jamie Madill | ab9f9c3 | 2017-01-17 17:47:34 -0500 | [diff] [blame] | 384 | { |
| 385 | // If we've already created our cached Framebuffer, return it. |
Jamie Madill | dd43e6c | 2017-03-24 14:18:49 -0400 | [diff] [blame] | 386 | if (mFramebuffer.valid()) |
Jamie Madill | ab9f9c3 | 2017-01-17 17:47:34 -0500 | [diff] [blame] | 387 | { |
| 388 | return &mFramebuffer; |
| 389 | } |
| 390 | |
Jamie Madill | 9f2a861 | 2017-11-30 12:43:09 -0500 | [diff] [blame] | 391 | const vk::RenderPassDesc &desc = getRenderPassDesc(context); |
| 392 | |
Jamie Madill | ab9f9c3 | 2017-01-17 17:47:34 -0500 | [diff] [blame] | 393 | vk::RenderPass *renderPass = nullptr; |
Jamie Madill | 9f2a861 | 2017-11-30 12:43:09 -0500 | [diff] [blame] | 394 | ANGLE_TRY(rendererVk->getCompatibleRenderPass(desc, &renderPass)); |
Jamie Madill | ab9f9c3 | 2017-01-17 17:47:34 -0500 | [diff] [blame] | 395 | |
| 396 | // If we've a Framebuffer provided by a Surface (default FBO/backbuffer), query it. |
Jamie Madill | 9f2a861 | 2017-11-30 12:43:09 -0500 | [diff] [blame] | 397 | VkDevice device = rendererVk->getDevice(); |
Jamie Madill | ab9f9c3 | 2017-01-17 17:47:34 -0500 | [diff] [blame] | 398 | if (mBackbuffer) |
| 399 | { |
| 400 | return mBackbuffer->getCurrentFramebuffer(device, *renderPass); |
| 401 | } |
| 402 | |
| 403 | // Gather VkImageViews over all FBO attachments, also size of attached region. |
| 404 | std::vector<VkImageView> attachments; |
| 405 | gl::Extents attachmentsSize; |
| 406 | |
| 407 | const auto &colorAttachments = mState.getColorAttachments(); |
| 408 | for (size_t attachmentIndex = 0; attachmentIndex < colorAttachments.size(); ++attachmentIndex) |
| 409 | { |
| 410 | const auto &colorAttachment = colorAttachments[attachmentIndex]; |
| 411 | if (colorAttachment.isAttached()) |
| 412 | { |
| 413 | RenderTargetVk *renderTarget = nullptr; |
Jamie Madill | 4928b7c | 2017-06-20 12:57:39 -0400 | [diff] [blame] | 414 | ANGLE_TRY(colorAttachment.getRenderTarget<RenderTargetVk>(context, &renderTarget)); |
Jamie Madill | ab9f9c3 | 2017-01-17 17:47:34 -0500 | [diff] [blame] | 415 | attachments.push_back(renderTarget->imageView->getHandle()); |
| 416 | |
| 417 | ASSERT(attachmentsSize.empty() || attachmentsSize == colorAttachment.getSize()); |
| 418 | attachmentsSize = colorAttachment.getSize(); |
| 419 | } |
| 420 | } |
| 421 | |
| 422 | const auto *depthStencilAttachment = mState.getDepthStencilAttachment(); |
| 423 | if (depthStencilAttachment && depthStencilAttachment->isAttached()) |
| 424 | { |
| 425 | RenderTargetVk *renderTarget = nullptr; |
Jamie Madill | 4928b7c | 2017-06-20 12:57:39 -0400 | [diff] [blame] | 426 | ANGLE_TRY(depthStencilAttachment->getRenderTarget<RenderTargetVk>(context, &renderTarget)); |
Jamie Madill | ab9f9c3 | 2017-01-17 17:47:34 -0500 | [diff] [blame] | 427 | attachments.push_back(renderTarget->imageView->getHandle()); |
| 428 | |
| 429 | ASSERT(attachmentsSize.empty() || attachmentsSize == depthStencilAttachment->getSize()); |
| 430 | attachmentsSize = depthStencilAttachment->getSize(); |
| 431 | } |
| 432 | |
| 433 | ASSERT(!attachments.empty()); |
| 434 | |
| 435 | VkFramebufferCreateInfo framebufferInfo; |
| 436 | |
| 437 | framebufferInfo.sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO; |
| 438 | framebufferInfo.pNext = nullptr; |
| 439 | framebufferInfo.flags = 0; |
Jamie Madill | 9f2a861 | 2017-11-30 12:43:09 -0500 | [diff] [blame] | 440 | framebufferInfo.renderPass = renderPass->getHandle(); |
Jamie Madill | ab9f9c3 | 2017-01-17 17:47:34 -0500 | [diff] [blame] | 441 | framebufferInfo.attachmentCount = static_cast<uint32_t>(attachments.size()); |
| 442 | framebufferInfo.pAttachments = attachments.data(); |
| 443 | framebufferInfo.width = static_cast<uint32_t>(attachmentsSize.width); |
| 444 | framebufferInfo.height = static_cast<uint32_t>(attachmentsSize.height); |
| 445 | framebufferInfo.layers = 1; |
| 446 | |
Jamie Madill | 25301b6 | 2017-10-28 20:59:31 -0400 | [diff] [blame] | 447 | ANGLE_TRY(mFramebuffer.init(device, framebufferInfo)); |
Jamie Madill | 5deea72 | 2017-02-16 10:44:46 -0500 | [diff] [blame] | 448 | |
Jamie Madill | ab9f9c3 | 2017-01-17 17:47:34 -0500 | [diff] [blame] | 449 | return &mFramebuffer; |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 450 | } |
| 451 | |
JiangYizhou | bddc46b | 2016-12-09 09:50:51 +0800 | [diff] [blame] | 452 | gl::Error FramebufferVk::getSamplePosition(size_t index, GLfloat *xy) const |
| 453 | { |
| 454 | UNIMPLEMENTED(); |
| 455 | return gl::InternalError() << "getSamplePosition is unimplemented."; |
| 456 | } |
| 457 | |
Jamie Madill | 1b03824 | 2017-11-01 15:14:36 -0400 | [diff] [blame] | 458 | gl::Error FramebufferVk::beginRenderPass(const gl::Context *context, |
Jamie Madill | 9f2a861 | 2017-11-30 12:43:09 -0500 | [diff] [blame] | 459 | RendererVk *rendererVk, |
Jamie Madill | 1b03824 | 2017-11-01 15:14:36 -0400 | [diff] [blame] | 460 | vk::CommandBuffer *commandBuffer, |
| 461 | Serial queueSerial) |
Jamie Madill | df68a6f | 2017-01-13 17:29:53 -0500 | [diff] [blame] | 462 | { |
Jamie Madill | bef918c | 2017-12-13 13:11:30 -0500 | [diff] [blame^] | 463 | uint32_t attachmentIndex = 0; |
| 464 | vk::AttachmentOpsArray attachmentOps; |
| 465 | |
Jamie Madill | 4c26fc2 | 2017-02-24 11:04:10 -0500 | [diff] [blame] | 466 | // TODO(jmadill): Cache render targets. |
| 467 | for (const auto &colorAttachment : mState.getColorAttachments()) |
| 468 | { |
| 469 | if (colorAttachment.isAttached()) |
| 470 | { |
| 471 | RenderTargetVk *renderTarget = nullptr; |
Jamie Madill | 4928b7c | 2017-06-20 12:57:39 -0400 | [diff] [blame] | 472 | ANGLE_TRY(colorAttachment.getRenderTarget<RenderTargetVk>(context, &renderTarget)); |
Jamie Madill | 4c26fc2 | 2017-02-24 11:04:10 -0500 | [diff] [blame] | 473 | renderTarget->resource->setQueueSerial(queueSerial); |
Jamie Madill | bef918c | 2017-12-13 13:11:30 -0500 | [diff] [blame^] | 474 | |
| 475 | // Fill in some default load and store ops. |
| 476 | attachmentOps.initDummyOp(attachmentIndex++, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL); |
Jamie Madill | 4c26fc2 | 2017-02-24 11:04:10 -0500 | [diff] [blame] | 477 | } |
| 478 | } |
| 479 | |
| 480 | const auto *depthStencilAttachment = mState.getDepthStencilAttachment(); |
| 481 | if (depthStencilAttachment && depthStencilAttachment->isAttached()) |
| 482 | { |
| 483 | RenderTargetVk *renderTarget = nullptr; |
Jamie Madill | 4928b7c | 2017-06-20 12:57:39 -0400 | [diff] [blame] | 484 | ANGLE_TRY(depthStencilAttachment->getRenderTarget<RenderTargetVk>(context, &renderTarget)); |
Jamie Madill | 4c26fc2 | 2017-02-24 11:04:10 -0500 | [diff] [blame] | 485 | renderTarget->resource->setQueueSerial(queueSerial); |
Jamie Madill | bef918c | 2017-12-13 13:11:30 -0500 | [diff] [blame^] | 486 | |
| 487 | // Fill in some default load and store ops. |
| 488 | attachmentOps.initDummyOp(attachmentIndex++, |
| 489 | VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL); |
Jamie Madill | 4c26fc2 | 2017-02-24 11:04:10 -0500 | [diff] [blame] | 490 | } |
| 491 | |
Jamie Madill | df68a6f | 2017-01-13 17:29:53 -0500 | [diff] [blame] | 492 | vk::Framebuffer *framebuffer = nullptr; |
Jamie Madill | 9f2a861 | 2017-11-30 12:43:09 -0500 | [diff] [blame] | 493 | ANGLE_TRY_RESULT(getFramebuffer(context, rendererVk), framebuffer); |
Jamie Madill | df68a6f | 2017-01-13 17:29:53 -0500 | [diff] [blame] | 494 | ASSERT(framebuffer && framebuffer->valid()); |
| 495 | |
Jamie Madill | 9f2a861 | 2017-11-30 12:43:09 -0500 | [diff] [blame] | 496 | const vk::RenderPassDesc &desc = getRenderPassDesc(context); |
| 497 | |
Jamie Madill | df68a6f | 2017-01-13 17:29:53 -0500 | [diff] [blame] | 498 | vk::RenderPass *renderPass = nullptr; |
Jamie Madill | bef918c | 2017-12-13 13:11:30 -0500 | [diff] [blame^] | 499 | ANGLE_TRY(rendererVk->getRenderPassWithOps(desc, attachmentOps, &renderPass)); |
Jamie Madill | df68a6f | 2017-01-13 17:29:53 -0500 | [diff] [blame] | 500 | ASSERT(renderPass && renderPass->valid()); |
| 501 | |
| 502 | // TODO(jmadill): Proper clear value implementation. |
Jamie Madill | 1b03824 | 2017-11-01 15:14:36 -0400 | [diff] [blame] | 503 | const gl::State &glState = context->getGLState(); |
Jamie Madill | df68a6f | 2017-01-13 17:29:53 -0500 | [diff] [blame] | 504 | VkClearColorValue colorClear; |
| 505 | memset(&colorClear, 0, sizeof(VkClearColorValue)); |
| 506 | colorClear.float32[0] = glState.getColorClearValue().red; |
| 507 | colorClear.float32[1] = glState.getColorClearValue().green; |
| 508 | colorClear.float32[2] = glState.getColorClearValue().blue; |
| 509 | colorClear.float32[3] = glState.getColorClearValue().alpha; |
| 510 | |
| 511 | std::vector<VkClearValue> attachmentClearValues; |
| 512 | attachmentClearValues.push_back({colorClear}); |
| 513 | |
| 514 | // Updated the cached image layout of the attachments in this FBO. |
| 515 | // For a default FBO, we need to call through to the WindowSurfaceVk |
| 516 | // TODO(jmadill): Iterate over all attachments. |
Jamie Madill | df68a6f | 2017-01-13 17:29:53 -0500 | [diff] [blame] | 517 | RenderTargetVk *renderTarget = nullptr; |
Jamie Madill | 4928b7c | 2017-06-20 12:57:39 -0400 | [diff] [blame] | 518 | ANGLE_TRY(mState.getFirstColorAttachment()->getRenderTarget(context, &renderTarget)); |
Jamie Madill | df68a6f | 2017-01-13 17:29:53 -0500 | [diff] [blame] | 519 | renderTarget->image->updateLayout(VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL); |
| 520 | |
Jamie Madill | e218f15 | 2017-11-30 12:38:50 -0500 | [diff] [blame] | 521 | commandBuffer->beginRenderPass(*renderPass, *framebuffer, glState.getViewport(), 1, |
| 522 | attachmentClearValues.data()); |
Jamie Madill | 4c26fc2 | 2017-02-24 11:04:10 -0500 | [diff] [blame] | 523 | |
| 524 | setQueueSerial(queueSerial); |
| 525 | if (mBackbuffer) |
| 526 | { |
| 527 | mBackbuffer->setQueueSerial(queueSerial); |
| 528 | } |
| 529 | |
Jamie Madill | df68a6f | 2017-01-13 17:29:53 -0500 | [diff] [blame] | 530 | return gl::NoError(); |
| 531 | } |
| 532 | |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 533 | } // namespace rx |