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 | // ContextVk.cpp: |
| 7 | // Implements the class methods for ContextVk. |
| 8 | // |
| 9 | |
| 10 | #include "libANGLE/renderer/vulkan/ContextVk.h" |
| 11 | |
Jamie Madill | 20e005b | 2017-04-07 14:19:22 -0400 | [diff] [blame] | 12 | #include "common/bitset_utils.h" |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 13 | #include "common/debug.h" |
Frank Henigman | a53d0e1 | 2018-02-13 00:06:06 -0500 | [diff] [blame] | 14 | #include "common/utilities.h" |
Jamie Madill | bd159f0 | 2017-10-09 19:39:06 -0400 | [diff] [blame] | 15 | #include "libANGLE/Context.h" |
Jamie Madill | df68a6f | 2017-01-13 17:29:53 -0500 | [diff] [blame] | 16 | #include "libANGLE/Program.h" |
Jamie Madill | acccc6c | 2016-05-03 17:22:10 -0400 | [diff] [blame] | 17 | #include "libANGLE/renderer/vulkan/BufferVk.h" |
Jamie Madill | 1f46bc1 | 2018-02-20 16:09:43 -0500 | [diff] [blame] | 18 | #include "libANGLE/renderer/vulkan/CommandGraph.h" |
Jamie Madill | acccc6c | 2016-05-03 17:22:10 -0400 | [diff] [blame] | 19 | #include "libANGLE/renderer/vulkan/CompilerVk.h" |
Jamie Madill | acccc6c | 2016-05-03 17:22:10 -0400 | [diff] [blame] | 20 | #include "libANGLE/renderer/vulkan/FenceNVVk.h" |
Jamie Madill | acccc6c | 2016-05-03 17:22:10 -0400 | [diff] [blame] | 21 | #include "libANGLE/renderer/vulkan/FramebufferVk.h" |
Yunchao He | a336b90 | 2017-08-02 16:05:21 +0800 | [diff] [blame] | 22 | #include "libANGLE/renderer/vulkan/ProgramPipelineVk.h" |
Jamie Madill | acccc6c | 2016-05-03 17:22:10 -0400 | [diff] [blame] | 23 | #include "libANGLE/renderer/vulkan/ProgramVk.h" |
| 24 | #include "libANGLE/renderer/vulkan/QueryVk.h" |
| 25 | #include "libANGLE/renderer/vulkan/RenderbufferVk.h" |
| 26 | #include "libANGLE/renderer/vulkan/RendererVk.h" |
| 27 | #include "libANGLE/renderer/vulkan/SamplerVk.h" |
| 28 | #include "libANGLE/renderer/vulkan/ShaderVk.h" |
Jamie Madill | 70b5bb0 | 2017-08-28 13:32:37 -0400 | [diff] [blame] | 29 | #include "libANGLE/renderer/vulkan/SyncVk.h" |
Jamie Madill | acccc6c | 2016-05-03 17:22:10 -0400 | [diff] [blame] | 30 | #include "libANGLE/renderer/vulkan/TextureVk.h" |
| 31 | #include "libANGLE/renderer/vulkan/TransformFeedbackVk.h" |
| 32 | #include "libANGLE/renderer/vulkan/VertexArrayVk.h" |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 33 | |
| 34 | namespace rx |
| 35 | { |
Luc Ferron | 14f4817 | 2018-04-11 08:43:28 -0400 | [diff] [blame] | 36 | |
| 37 | namespace |
| 38 | { |
| 39 | constexpr gl::Rectangle kMaxSizedScissor(0, |
| 40 | 0, |
| 41 | std::numeric_limits<int>::max(), |
| 42 | std::numeric_limits<int>::max()); |
| 43 | |
Jamie Madill | 9aef367 | 2018-04-27 11:45:06 -0400 | [diff] [blame] | 44 | constexpr VkColorComponentFlags kAllColorChannelsMask = |
| 45 | (VK_COLOR_COMPONENT_R_BIT | VK_COLOR_COMPONENT_G_BIT | VK_COLOR_COMPONENT_B_BIT | |
| 46 | VK_COLOR_COMPONENT_A_BIT); |
Luc Ferron | 14f4817 | 2018-04-11 08:43:28 -0400 | [diff] [blame] | 47 | } // anonymous namespace |
| 48 | |
Jamie Madill | acccc6c | 2016-05-03 17:22:10 -0400 | [diff] [blame] | 49 | ContextVk::ContextVk(const gl::ContextState &state, RendererVk *renderer) |
Jamie Madill | 49ac74b | 2017-12-21 14:42:33 -0500 | [diff] [blame] | 50 | : ContextImpl(state), |
| 51 | mRenderer(renderer), |
Jamie Madill | 493f957 | 2018-05-24 19:52:15 -0400 | [diff] [blame] | 52 | mCurrentDrawMode(gl::PrimitiveMode::InvalidEnum), |
Luc Ferron | daedf4d | 2018-03-16 09:28:53 -0400 | [diff] [blame] | 53 | mDynamicDescriptorPool(), |
Frank Henigman | 1744895 | 2017-01-05 15:48:26 -0500 | [diff] [blame] | 54 | mTexturesDirty(false), |
Jamie Madill | 9aef367 | 2018-04-27 11:45:06 -0400 | [diff] [blame] | 55 | mVertexArrayBindingHasChanged(false), |
| 56 | mClearColorMask(kAllColorChannelsMask) |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 57 | { |
Jamie Madill | f4d693c | 2018-02-14 16:38:16 -0500 | [diff] [blame] | 58 | memset(&mClearColorValue, 0, sizeof(mClearColorValue)); |
| 59 | memset(&mClearDepthStencilValue, 0, sizeof(mClearDepthStencilValue)); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 60 | } |
| 61 | |
| 62 | ContextVk::~ContextVk() |
| 63 | { |
| 64 | } |
| 65 | |
Jamie Madill | 76e471e | 2017-10-21 09:56:01 -0400 | [diff] [blame] | 66 | void ContextVk::onDestroy(const gl::Context *context) |
| 67 | { |
Luc Ferron | 9096836 | 2018-05-04 08:47:22 -0400 | [diff] [blame] | 68 | mIncompleteTextures.onDestroy(context); |
Luc Ferron | daedf4d | 2018-03-16 09:28:53 -0400 | [diff] [blame] | 69 | mDynamicDescriptorPool.destroy(mRenderer); |
Jamie Madill | 76e471e | 2017-10-21 09:56:01 -0400 | [diff] [blame] | 70 | } |
| 71 | |
Luc Ferron | 9096836 | 2018-05-04 08:47:22 -0400 | [diff] [blame] | 72 | gl::Error ContextVk::getIncompleteTexture(const gl::Context *context, |
| 73 | gl::TextureType type, |
| 74 | gl::Texture **textureOut) |
| 75 | { |
| 76 | // At some point, we'll need to support multisample and we'll pass "this" instead of nullptr |
| 77 | // and implement the necessary interface. |
| 78 | return mIncompleteTextures.getIncompleteTexture(context, type, nullptr, textureOut); |
| 79 | } |
| 80 | |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 81 | gl::Error ContextVk::initialize() |
| 82 | { |
Jamie Madill | aaca96e | 2018-06-12 10:19:48 -0400 | [diff] [blame] | 83 | ANGLE_TRY(mDynamicDescriptorPool.init(this->getDevice(), GetUniformBufferDescriptorCount(), |
Luc Ferron | daedf4d | 2018-03-16 09:28:53 -0400 | [diff] [blame] | 84 | mRenderer->getMaxActiveTextures())); |
Jamie Madill | 76e471e | 2017-10-21 09:56:01 -0400 | [diff] [blame] | 85 | |
Jamie Madill | f2f6d37 | 2018-01-10 21:37:23 -0500 | [diff] [blame] | 86 | mPipelineDesc.reset(new vk::PipelineDesc()); |
| 87 | mPipelineDesc->initDefaults(); |
| 88 | |
Jamie Madill | e09bd5d | 2016-11-29 16:20:35 -0500 | [diff] [blame] | 89 | return gl::NoError(); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 90 | } |
| 91 | |
Jamie Madill | afa02a2 | 2017-11-23 12:57:38 -0500 | [diff] [blame] | 92 | gl::Error ContextVk::flush(const gl::Context *context) |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 93 | { |
Jamie Madill | 49ac74b | 2017-12-21 14:42:33 -0500 | [diff] [blame] | 94 | // TODO(jmadill): Flush will need to insert a semaphore for the next flush to wait on. |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 95 | UNIMPLEMENTED(); |
Luc Ferron | 3314040 | 2018-03-08 13:57:52 -0500 | [diff] [blame] | 96 | |
| 97 | // dEQP tests rely on having no errors thrown at the end of the test and they always call |
| 98 | // flush at the end of the their tests. Just returning NoError until we implement flush |
| 99 | // allow us to work on enabling many tests in the meantime. |
| 100 | return gl::NoError(); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 101 | } |
| 102 | |
Jamie Madill | afa02a2 | 2017-11-23 12:57:38 -0500 | [diff] [blame] | 103 | gl::Error ContextVk::finish(const gl::Context *context) |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 104 | { |
Jamie Madill | 49ac74b | 2017-12-21 14:42:33 -0500 | [diff] [blame] | 105 | return mRenderer->finish(context); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 106 | } |
| 107 | |
Jamie Madill | b90779e | 2018-04-27 11:45:01 -0400 | [diff] [blame] | 108 | gl::Error ContextVk::initPipeline() |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 109 | { |
Jamie Madill | ffa4cbb | 2018-01-23 13:04:07 -0500 | [diff] [blame] | 110 | ASSERT(!mCurrentPipeline); |
Jamie Madill | 7210656 | 2017-03-24 14:18:50 -0400 | [diff] [blame] | 111 | |
Jamie Madill | f2f6d37 | 2018-01-10 21:37:23 -0500 | [diff] [blame] | 112 | const gl::State &state = mState.getState(); |
| 113 | VertexArrayVk *vertexArrayVk = vk::GetImpl(state.getVertexArray()); |
| 114 | FramebufferVk *framebufferVk = vk::GetImpl(state.getDrawFramebuffer()); |
| 115 | ProgramVk *programVk = vk::GetImpl(state.getProgram()); |
Luc Ferron | ceb7190 | 2018-02-05 15:18:47 -0500 | [diff] [blame] | 116 | const gl::AttributesMask activeAttribLocationsMask = |
| 117 | state.getProgram()->getActiveAttribLocationsMask(); |
Jamie Madill | f2f6d37 | 2018-01-10 21:37:23 -0500 | [diff] [blame] | 118 | |
| 119 | // Ensure the topology of the pipeline description is updated. |
| 120 | mPipelineDesc->updateTopology(mCurrentDrawMode); |
Jamie Madill | df68a6f | 2017-01-13 17:29:53 -0500 | [diff] [blame] | 121 | |
Jamie Madill | 112a3a8 | 2018-01-23 13:04:06 -0500 | [diff] [blame] | 122 | // Copy over the latest attrib and binding descriptions. |
| 123 | vertexArrayVk->getPackedInputDescriptions(mPipelineDesc.get()); |
Jamie Madill | df68a6f | 2017-01-13 17:29:53 -0500 | [diff] [blame] | 124 | |
Jamie Madill | f2f6d37 | 2018-01-10 21:37:23 -0500 | [diff] [blame] | 125 | // Ensure that the RenderPass description is updated. |
Jamie Madill | b90779e | 2018-04-27 11:45:01 -0400 | [diff] [blame] | 126 | mPipelineDesc->updateRenderPassDesc(framebufferVk->getRenderPassDesc()); |
Jamie Madill | df68a6f | 2017-01-13 17:29:53 -0500 | [diff] [blame] | 127 | |
| 128 | // TODO(jmadill): Validate with ASSERT against physical device limits/caps? |
Jamie Madill | 9aef367 | 2018-04-27 11:45:06 -0400 | [diff] [blame] | 129 | ANGLE_TRY(mRenderer->getAppPipeline(programVk, *mPipelineDesc, activeAttribLocationsMask, |
Jamie Madill | 9b168d0 | 2018-06-13 13:25:32 -0400 | [diff] [blame] | 130 | &mCurrentPipeline)); |
Jamie Madill | df68a6f | 2017-01-13 17:29:53 -0500 | [diff] [blame] | 131 | |
Jamie Madill | 7210656 | 2017-03-24 14:18:50 -0400 | [diff] [blame] | 132 | return gl::NoError(); |
| 133 | } |
| 134 | |
Luc Ferron | 9096836 | 2018-05-04 08:47:22 -0400 | [diff] [blame] | 135 | gl::Error ContextVk::setupDraw(const gl::Context *context, |
| 136 | const gl::DrawCallParams &drawCallParams, |
Jamie Madill | 316c606 | 2018-05-29 10:49:45 -0400 | [diff] [blame] | 137 | vk::CommandBuffer **commandBufferOut, |
| 138 | bool *shouldApplyVertexArrayOut) |
Jamie Madill | 7210656 | 2017-03-24 14:18:50 -0400 | [diff] [blame] | 139 | { |
Jamie Madill | 32fd63b | 2018-03-31 11:20:35 -0400 | [diff] [blame] | 140 | if (drawCallParams.mode() != mCurrentDrawMode) |
Jamie Madill | 7210656 | 2017-03-24 14:18:50 -0400 | [diff] [blame] | 141 | { |
| 142 | invalidateCurrentPipeline(); |
Jamie Madill | 32fd63b | 2018-03-31 11:20:35 -0400 | [diff] [blame] | 143 | mCurrentDrawMode = drawCallParams.mode(); |
Jamie Madill | 7210656 | 2017-03-24 14:18:50 -0400 | [diff] [blame] | 144 | } |
| 145 | |
Jamie Madill | ffa4cbb | 2018-01-23 13:04:07 -0500 | [diff] [blame] | 146 | if (!mCurrentPipeline) |
Jamie Madill | 7210656 | 2017-03-24 14:18:50 -0400 | [diff] [blame] | 147 | { |
Jamie Madill | b90779e | 2018-04-27 11:45:01 -0400 | [diff] [blame] | 148 | ANGLE_TRY(initPipeline()); |
Jamie Madill | 7210656 | 2017-03-24 14:18:50 -0400 | [diff] [blame] | 149 | } |
| 150 | |
Frank Henigman | 1744895 | 2017-01-05 15:48:26 -0500 | [diff] [blame] | 151 | const auto &state = mState.getState(); |
Jamie Madill | acf2f3a | 2017-11-21 19:22:44 -0500 | [diff] [blame] | 152 | const gl::Program *programGL = state.getProgram(); |
Frank Henigman | 1744895 | 2017-01-05 15:48:26 -0500 | [diff] [blame] | 153 | ProgramVk *programVk = vk::GetImpl(programGL); |
Jamie Madill | 316c606 | 2018-05-29 10:49:45 -0400 | [diff] [blame] | 154 | const gl::Framebuffer *framebuffer = state.getDrawFramebuffer(); |
| 155 | FramebufferVk *framebufferVk = vk::GetImpl(framebuffer); |
Luc Ferron | f8be756 | 2018-02-06 15:59:11 -0500 | [diff] [blame] | 156 | Serial queueSerial = mRenderer->getCurrentQueueSerial(); |
Jamie Madill | 7210656 | 2017-03-24 14:18:50 -0400 | [diff] [blame] | 157 | |
Jamie Madill | 316c606 | 2018-05-29 10:49:45 -0400 | [diff] [blame] | 158 | vk::RecordingMode mode = vk::RecordingMode::Start; |
| 159 | ANGLE_TRY(framebufferVk->getCommandBufferForDraw(this, commandBufferOut, &mode)); |
Jamie Madill | df68a6f | 2017-01-13 17:29:53 -0500 | [diff] [blame] | 160 | |
Jamie Madill | 316c606 | 2018-05-29 10:49:45 -0400 | [diff] [blame] | 161 | if (mode == vk::RecordingMode::Start) |
Jamie Madill | 49ac74b | 2017-12-21 14:42:33 -0500 | [diff] [blame] | 162 | { |
Jamie Madill | 316c606 | 2018-05-29 10:49:45 -0400 | [diff] [blame] | 163 | mTexturesDirty = true; |
| 164 | *shouldApplyVertexArrayOut = true; |
Jamie Madill | 49ac74b | 2017-12-21 14:42:33 -0500 | [diff] [blame] | 165 | } |
| 166 | else |
| 167 | { |
Jamie Madill | 316c606 | 2018-05-29 10:49:45 -0400 | [diff] [blame] | 168 | *shouldApplyVertexArrayOut = mVertexArrayBindingHasChanged; |
Jamie Madill | c3755fc | 2018-04-05 08:39:13 -0400 | [diff] [blame] | 169 | mVertexArrayBindingHasChanged = false; |
Jamie Madill | 49ac74b | 2017-12-21 14:42:33 -0500 | [diff] [blame] | 170 | } |
| 171 | |
| 172 | // Ensure any writes to the textures are flushed before we read from them. |
| 173 | if (mTexturesDirty) |
| 174 | { |
| 175 | mTexturesDirty = false; |
| 176 | // TODO(jmadill): Should probably merge this for loop with programVk's descriptor update. |
Luc Ferron | f6e160f | 2018-06-12 10:13:57 -0400 | [diff] [blame^] | 177 | ContextVk *contextVk = vk::GetImpl(context); |
Jamie Madill | 49ac74b | 2017-12-21 14:42:33 -0500 | [diff] [blame] | 178 | const auto &completeTextures = state.getCompleteTextureCache(); |
| 179 | for (const gl::SamplerBinding &samplerBinding : programGL->getSamplerBindings()) |
| 180 | { |
| 181 | ASSERT(!samplerBinding.unreferenced); |
| 182 | |
Jamie Madill | 4cc753e | 2018-06-13 13:25:33 -0400 | [diff] [blame] | 183 | for (GLuint textureUnit : samplerBinding.boundTextureUnits) |
Luc Ferron | 9096836 | 2018-05-04 08:47:22 -0400 | [diff] [blame] | 184 | { |
Jamie Madill | 4cc753e | 2018-06-13 13:25:33 -0400 | [diff] [blame] | 185 | gl::Texture *texture = completeTextures[textureUnit]; |
Jamie Madill | 49ac74b | 2017-12-21 14:42:33 -0500 | [diff] [blame] | 186 | |
Jamie Madill | 4cc753e | 2018-06-13 13:25:33 -0400 | [diff] [blame] | 187 | // Null textures represent incomplete textures. |
| 188 | if (texture == nullptr) |
| 189 | { |
| 190 | ANGLE_TRY(getIncompleteTexture(context, samplerBinding.textureType, &texture)); |
| 191 | } |
| 192 | |
| 193 | TextureVk *textureVk = vk::GetImpl(texture); |
Luc Ferron | f6e160f | 2018-06-12 10:13:57 -0400 | [diff] [blame^] | 194 | ANGLE_TRY(textureVk->ensureImageInitialized(contextVk)); |
Jamie Madill | 4cc753e | 2018-06-13 13:25:33 -0400 | [diff] [blame] | 195 | textureVk->addReadDependency(framebufferVk); |
| 196 | } |
Jamie Madill | 49ac74b | 2017-12-21 14:42:33 -0500 | [diff] [blame] | 197 | } |
| 198 | } |
| 199 | |
Jamie Madill | 316c606 | 2018-05-29 10:49:45 -0400 | [diff] [blame] | 200 | (*commandBufferOut)->bindPipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, mCurrentPipeline->get()); |
Jamie Madill | 49ac74b | 2017-12-21 14:42:33 -0500 | [diff] [blame] | 201 | |
| 202 | // Update the queue serial for the pipeline object. |
Jamie Madill | ffa4cbb | 2018-01-23 13:04:07 -0500 | [diff] [blame] | 203 | ASSERT(mCurrentPipeline && mCurrentPipeline->valid()); |
| 204 | mCurrentPipeline->updateSerial(queueSerial); |
Jamie Madill | df68a6f | 2017-01-13 17:29:53 -0500 | [diff] [blame] | 205 | |
Jamie Madill | 76e471e | 2017-10-21 09:56:01 -0400 | [diff] [blame] | 206 | // TODO(jmadill): Can probably use more dirty bits here. |
Jamie Madill | 49ac74b | 2017-12-21 14:42:33 -0500 | [diff] [blame] | 207 | ANGLE_TRY(programVk->updateUniforms(this)); |
Luc Ferron | 9096836 | 2018-05-04 08:47:22 -0400 | [diff] [blame] | 208 | ANGLE_TRY(programVk->updateTexturesDescriptorSet(context)); |
Jamie Madill | 76e471e | 2017-10-21 09:56:01 -0400 | [diff] [blame] | 209 | |
| 210 | // Bind the graphics descriptor sets. |
| 211 | // TODO(jmadill): Handle multiple command buffers. |
Jamie Madill | 493f957 | 2018-05-24 19:52:15 -0400 | [diff] [blame] | 212 | const auto &descriptorSets = programVk->getDescriptorSets(); |
Jamie Madill | 8c3988c | 2017-12-21 14:44:56 -0500 | [diff] [blame] | 213 | const gl::RangeUI &usedRange = programVk->getUsedDescriptorSetRange(); |
| 214 | if (!usedRange.empty()) |
Jamie Madill | 76e471e | 2017-10-21 09:56:01 -0400 | [diff] [blame] | 215 | { |
Jamie Madill | 8c3988c | 2017-12-21 14:44:56 -0500 | [diff] [blame] | 216 | ASSERT(!descriptorSets.empty()); |
Jamie Madill | 9b168d0 | 2018-06-13 13:25:32 -0400 | [diff] [blame] | 217 | const vk::PipelineLayout &pipelineLayout = programVk->getPipelineLayout(); |
Luc Ferron | 7a06ac1 | 2018-03-15 10:17:04 -0400 | [diff] [blame] | 218 | |
Jamie Madill | 316c606 | 2018-05-29 10:49:45 -0400 | [diff] [blame] | 219 | (*commandBufferOut) |
| 220 | ->bindDescriptorSets(VK_PIPELINE_BIND_POINT_GRAPHICS, pipelineLayout, usedRange.low(), |
| 221 | usedRange.length(), &descriptorSets[usedRange.low()], |
| 222 | programVk->getDynamicOffsetsCount(), |
| 223 | programVk->getDynamicOffsets()); |
Jamie Madill | 76e471e | 2017-10-21 09:56:01 -0400 | [diff] [blame] | 224 | } |
| 225 | |
Jamie Madill | df68a6f | 2017-01-13 17:29:53 -0500 | [diff] [blame] | 226 | return gl::NoError(); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 227 | } |
| 228 | |
Jamie Madill | 493f957 | 2018-05-24 19:52:15 -0400 | [diff] [blame] | 229 | gl::Error ContextVk::drawArrays(const gl::Context *context, |
| 230 | gl::PrimitiveMode mode, |
| 231 | GLint first, |
| 232 | GLsizei count) |
Jamie Madill | d03a849 | 2017-10-03 15:46:06 -0400 | [diff] [blame] | 233 | { |
Jamie Madill | 32fd63b | 2018-03-31 11:20:35 -0400 | [diff] [blame] | 234 | const gl::DrawCallParams &drawCallParams = context->getParams<gl::DrawCallParams>(); |
| 235 | |
Jamie Madill | 316c606 | 2018-05-29 10:49:45 -0400 | [diff] [blame] | 236 | vk::CommandBuffer *commandBuffer = nullptr; |
| 237 | bool shouldApplyVertexArray = false; |
| 238 | ANGLE_TRY(setupDraw(context, drawCallParams, &commandBuffer, &shouldApplyVertexArray)); |
Luc Ferron | 360098d | 2018-02-21 07:33:50 -0500 | [diff] [blame] | 239 | |
Jamie Madill | c3755fc | 2018-04-05 08:39:13 -0400 | [diff] [blame] | 240 | const gl::VertexArray *vertexArray = context->getGLState().getVertexArray(); |
| 241 | VertexArrayVk *vertexArrayVk = vk::GetImpl(vertexArray); |
Jamie Madill | 316c606 | 2018-05-29 10:49:45 -0400 | [diff] [blame] | 242 | ANGLE_TRY(vertexArrayVk->drawArrays(context, mRenderer, drawCallParams, commandBuffer, |
| 243 | shouldApplyVertexArray)); |
Luc Ferron | 360098d | 2018-02-21 07:33:50 -0500 | [diff] [blame] | 244 | |
Jamie Madill | d03a849 | 2017-10-03 15:46:06 -0400 | [diff] [blame] | 245 | return gl::NoError(); |
| 246 | } |
| 247 | |
Jamie Madill | c564c07 | 2017-06-01 12:45:42 -0400 | [diff] [blame] | 248 | gl::Error ContextVk::drawArraysInstanced(const gl::Context *context, |
Jamie Madill | 493f957 | 2018-05-24 19:52:15 -0400 | [diff] [blame] | 249 | gl::PrimitiveMode mode, |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 250 | GLint first, |
| 251 | GLsizei count, |
| 252 | GLsizei instanceCount) |
| 253 | { |
| 254 | UNIMPLEMENTED(); |
Yuly Novikov | c4d18aa | 2017-03-09 18:45:02 -0500 | [diff] [blame] | 255 | return gl::InternalError(); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 256 | } |
| 257 | |
Jamie Madill | c564c07 | 2017-06-01 12:45:42 -0400 | [diff] [blame] | 258 | gl::Error ContextVk::drawElements(const gl::Context *context, |
Jamie Madill | 493f957 | 2018-05-24 19:52:15 -0400 | [diff] [blame] | 259 | gl::PrimitiveMode mode, |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 260 | GLsizei count, |
| 261 | GLenum type, |
Qin Jiajia | 1da0065 | 2017-06-20 17:16:25 +0800 | [diff] [blame] | 262 | const void *indices) |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 263 | { |
Jamie Madill | 32fd63b | 2018-03-31 11:20:35 -0400 | [diff] [blame] | 264 | const gl::DrawCallParams &drawCallParams = context->getParams<gl::DrawCallParams>(); |
| 265 | |
Jamie Madill | 316c606 | 2018-05-29 10:49:45 -0400 | [diff] [blame] | 266 | vk::CommandBuffer *commandBuffer = nullptr; |
| 267 | bool shouldApplyVertexArray = false; |
| 268 | ANGLE_TRY(setupDraw(context, drawCallParams, &commandBuffer, &shouldApplyVertexArray)); |
Jamie Madill | d03a849 | 2017-10-03 15:46:06 -0400 | [diff] [blame] | 269 | |
Jamie Madill | c3755fc | 2018-04-05 08:39:13 -0400 | [diff] [blame] | 270 | gl::VertexArray *vao = mState.getState().getVertexArray(); |
| 271 | VertexArrayVk *vertexArrayVk = vk::GetImpl(vao); |
Jamie Madill | 316c606 | 2018-05-29 10:49:45 -0400 | [diff] [blame] | 272 | ANGLE_TRY(vertexArrayVk->drawElements(context, mRenderer, drawCallParams, commandBuffer, |
| 273 | shouldApplyVertexArray)); |
Jamie Madill | d03a849 | 2017-10-03 15:46:06 -0400 | [diff] [blame] | 274 | |
| 275 | return gl::NoError(); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 276 | } |
| 277 | |
Jamie Madill | c564c07 | 2017-06-01 12:45:42 -0400 | [diff] [blame] | 278 | gl::Error ContextVk::drawElementsInstanced(const gl::Context *context, |
Jamie Madill | 493f957 | 2018-05-24 19:52:15 -0400 | [diff] [blame] | 279 | gl::PrimitiveMode mode, |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 280 | GLsizei count, |
| 281 | GLenum type, |
Jamie Madill | 876429b | 2017-04-20 15:46:24 -0400 | [diff] [blame] | 282 | const void *indices, |
Qin Jiajia | 1da0065 | 2017-06-20 17:16:25 +0800 | [diff] [blame] | 283 | GLsizei instances) |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 284 | { |
| 285 | UNIMPLEMENTED(); |
Yuly Novikov | c4d18aa | 2017-03-09 18:45:02 -0500 | [diff] [blame] | 286 | return gl::InternalError(); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 287 | } |
| 288 | |
Jamie Madill | c564c07 | 2017-06-01 12:45:42 -0400 | [diff] [blame] | 289 | gl::Error ContextVk::drawRangeElements(const gl::Context *context, |
Jamie Madill | 493f957 | 2018-05-24 19:52:15 -0400 | [diff] [blame] | 290 | gl::PrimitiveMode mode, |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 291 | GLuint start, |
| 292 | GLuint end, |
| 293 | GLsizei count, |
| 294 | GLenum type, |
Qin Jiajia | 1da0065 | 2017-06-20 17:16:25 +0800 | [diff] [blame] | 295 | const void *indices) |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 296 | { |
Jamie Madill | 7b57b9d | 2017-01-13 09:33:38 -0500 | [diff] [blame] | 297 | return gl::NoError(); |
| 298 | } |
| 299 | |
| 300 | VkDevice ContextVk::getDevice() const |
| 301 | { |
| 302 | return mRenderer->getDevice(); |
| 303 | } |
| 304 | |
Jamie Madill | c564c07 | 2017-06-01 12:45:42 -0400 | [diff] [blame] | 305 | gl::Error ContextVk::drawArraysIndirect(const gl::Context *context, |
Jamie Madill | 493f957 | 2018-05-24 19:52:15 -0400 | [diff] [blame] | 306 | gl::PrimitiveMode mode, |
Jamie Madill | c564c07 | 2017-06-01 12:45:42 -0400 | [diff] [blame] | 307 | const void *indirect) |
Jiajia Qin | d967122 | 2016-11-29 16:30:31 +0800 | [diff] [blame] | 308 | { |
| 309 | UNIMPLEMENTED(); |
| 310 | return gl::InternalError() << "DrawArraysIndirect hasn't been implemented for vulkan backend."; |
| 311 | } |
| 312 | |
Jamie Madill | c564c07 | 2017-06-01 12:45:42 -0400 | [diff] [blame] | 313 | gl::Error ContextVk::drawElementsIndirect(const gl::Context *context, |
Jamie Madill | 493f957 | 2018-05-24 19:52:15 -0400 | [diff] [blame] | 314 | gl::PrimitiveMode mode, |
Jamie Madill | c564c07 | 2017-06-01 12:45:42 -0400 | [diff] [blame] | 315 | GLenum type, |
| 316 | const void *indirect) |
Jiajia Qin | d967122 | 2016-11-29 16:30:31 +0800 | [diff] [blame] | 317 | { |
| 318 | UNIMPLEMENTED(); |
| 319 | return gl::InternalError() |
| 320 | << "DrawElementsIndirect hasn't been implemented for vulkan backend."; |
| 321 | } |
| 322 | |
Corentin Wallez | 87fbe1c | 2016-08-03 14:41:42 -0400 | [diff] [blame] | 323 | GLenum ContextVk::getResetStatus() |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 324 | { |
| 325 | UNIMPLEMENTED(); |
Corentin Wallez | 87fbe1c | 2016-08-03 14:41:42 -0400 | [diff] [blame] | 326 | return GL_NO_ERROR; |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 327 | } |
| 328 | |
| 329 | std::string ContextVk::getVendorString() const |
| 330 | { |
| 331 | UNIMPLEMENTED(); |
| 332 | return std::string(); |
| 333 | } |
| 334 | |
| 335 | std::string ContextVk::getRendererDescription() const |
| 336 | { |
Jamie Madill | e09bd5d | 2016-11-29 16:20:35 -0500 | [diff] [blame] | 337 | return mRenderer->getRendererDescription(); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 338 | } |
| 339 | |
| 340 | void ContextVk::insertEventMarker(GLsizei length, const char *marker) |
| 341 | { |
| 342 | UNIMPLEMENTED(); |
| 343 | } |
| 344 | |
| 345 | void ContextVk::pushGroupMarker(GLsizei length, const char *marker) |
| 346 | { |
| 347 | UNIMPLEMENTED(); |
| 348 | } |
| 349 | |
| 350 | void ContextVk::popGroupMarker() |
| 351 | { |
| 352 | UNIMPLEMENTED(); |
| 353 | } |
| 354 | |
Geoff Lang | 5d5253a | 2017-11-22 14:51:12 -0500 | [diff] [blame] | 355 | void ContextVk::pushDebugGroup(GLenum source, GLuint id, GLsizei length, const char *message) |
| 356 | { |
| 357 | UNIMPLEMENTED(); |
| 358 | } |
| 359 | |
| 360 | void ContextVk::popDebugGroup() |
| 361 | { |
| 362 | UNIMPLEMENTED(); |
| 363 | } |
| 364 | |
Luc Ferron | d17bdfe | 2018-04-05 13:50:10 -0400 | [diff] [blame] | 365 | void ContextVk::updateScissor(const gl::State &glState) |
| 366 | { |
| 367 | if (glState.isScissorTestEnabled()) |
| 368 | { |
Luc Ferron | 14f4817 | 2018-04-11 08:43:28 -0400 | [diff] [blame] | 369 | mPipelineDesc->updateScissor(glState.getScissor()); |
Luc Ferron | d17bdfe | 2018-04-05 13:50:10 -0400 | [diff] [blame] | 370 | } |
| 371 | else |
| 372 | { |
Luc Ferron | 14f4817 | 2018-04-11 08:43:28 -0400 | [diff] [blame] | 373 | // If the scissor test isn't enabled, we can simply use a really big scissor that's |
| 374 | // certainly larger than the current surface using the maximum size of a 2D texture |
| 375 | // for the width and height. |
| 376 | mPipelineDesc->updateScissor(kMaxSizedScissor); |
Luc Ferron | d17bdfe | 2018-04-05 13:50:10 -0400 | [diff] [blame] | 377 | } |
| 378 | } |
| 379 | |
Jamie Madill | fe54834 | 2017-06-19 11:13:24 -0400 | [diff] [blame] | 380 | void ContextVk::syncState(const gl::Context *context, const gl::State::DirtyBits &dirtyBits) |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 381 | { |
Jamie Madill | 7210656 | 2017-03-24 14:18:50 -0400 | [diff] [blame] | 382 | if (dirtyBits.any()) |
| 383 | { |
| 384 | invalidateCurrentPipeline(); |
| 385 | } |
Jamie Madill | ebf7299 | 2017-10-13 14:09:45 -0400 | [diff] [blame] | 386 | |
| 387 | const auto &glState = context->getGLState(); |
| 388 | |
| 389 | // TODO(jmadill): Full dirty bits implementation. |
Jamie Madill | 5547b38 | 2017-10-23 18:16:01 -0400 | [diff] [blame] | 390 | bool dirtyTextures = false; |
Jamie Madill | ebf7299 | 2017-10-13 14:09:45 -0400 | [diff] [blame] | 391 | |
| 392 | for (auto dirtyBit : dirtyBits) |
| 393 | { |
| 394 | switch (dirtyBit) |
| 395 | { |
| 396 | case gl::State::DIRTY_BIT_SCISSOR_TEST_ENABLED: |
Jamie Madill | ebf7299 | 2017-10-13 14:09:45 -0400 | [diff] [blame] | 397 | case gl::State::DIRTY_BIT_SCISSOR: |
Luc Ferron | 14f4817 | 2018-04-11 08:43:28 -0400 | [diff] [blame] | 398 | updateScissor(glState); |
Jamie Madill | ebf7299 | 2017-10-13 14:09:45 -0400 | [diff] [blame] | 399 | break; |
| 400 | case gl::State::DIRTY_BIT_VIEWPORT: |
Jamie Madill | f2f6d37 | 2018-01-10 21:37:23 -0500 | [diff] [blame] | 401 | mPipelineDesc->updateViewport(glState.getViewport(), glState.getNearPlane(), |
| 402 | glState.getFarPlane()); |
Jamie Madill | ebf7299 | 2017-10-13 14:09:45 -0400 | [diff] [blame] | 403 | break; |
Jamie Madill | ebf7299 | 2017-10-13 14:09:45 -0400 | [diff] [blame] | 404 | case gl::State::DIRTY_BIT_DEPTH_RANGE: |
Luc Ferron | 0986f1c | 2018-04-16 13:47:23 -0400 | [diff] [blame] | 405 | mPipelineDesc->updateDepthRange(glState.getNearPlane(), glState.getFarPlane()); |
Jamie Madill | ebf7299 | 2017-10-13 14:09:45 -0400 | [diff] [blame] | 406 | break; |
| 407 | case gl::State::DIRTY_BIT_BLEND_ENABLED: |
Luc Ferron | f8be756 | 2018-02-06 15:59:11 -0500 | [diff] [blame] | 408 | mPipelineDesc->updateBlendEnabled(glState.isBlendEnabled()); |
Jamie Madill | ebf7299 | 2017-10-13 14:09:45 -0400 | [diff] [blame] | 409 | break; |
| 410 | case gl::State::DIRTY_BIT_BLEND_COLOR: |
Luc Ferron | f8be756 | 2018-02-06 15:59:11 -0500 | [diff] [blame] | 411 | mPipelineDesc->updateBlendColor(glState.getBlendColor()); |
Jamie Madill | ebf7299 | 2017-10-13 14:09:45 -0400 | [diff] [blame] | 412 | break; |
| 413 | case gl::State::DIRTY_BIT_BLEND_FUNCS: |
Luc Ferron | f8be756 | 2018-02-06 15:59:11 -0500 | [diff] [blame] | 414 | mPipelineDesc->updateBlendFuncs(glState.getBlendState()); |
Jamie Madill | ebf7299 | 2017-10-13 14:09:45 -0400 | [diff] [blame] | 415 | break; |
| 416 | case gl::State::DIRTY_BIT_BLEND_EQUATIONS: |
Luc Ferron | f8be756 | 2018-02-06 15:59:11 -0500 | [diff] [blame] | 417 | mPipelineDesc->updateBlendEquations(glState.getBlendState()); |
Jamie Madill | ebf7299 | 2017-10-13 14:09:45 -0400 | [diff] [blame] | 418 | break; |
| 419 | case gl::State::DIRTY_BIT_COLOR_MASK: |
Jamie Madill | 9aef367 | 2018-04-27 11:45:06 -0400 | [diff] [blame] | 420 | { |
| 421 | const gl::BlendState &blendState = glState.getBlendState(); |
| 422 | mClearColorMask = gl_vk::GetColorComponentFlags( |
| 423 | blendState.colorMaskRed, blendState.colorMaskGreen, blendState.colorMaskBlue, |
| 424 | blendState.colorMaskAlpha); |
| 425 | mPipelineDesc->updateColorWriteMask(mClearColorMask); |
Jamie Madill | ebf7299 | 2017-10-13 14:09:45 -0400 | [diff] [blame] | 426 | break; |
Jamie Madill | 9aef367 | 2018-04-27 11:45:06 -0400 | [diff] [blame] | 427 | } |
Jamie Madill | ebf7299 | 2017-10-13 14:09:45 -0400 | [diff] [blame] | 428 | case gl::State::DIRTY_BIT_SAMPLE_ALPHA_TO_COVERAGE_ENABLED: |
| 429 | WARN() << "DIRTY_BIT_SAMPLE_ALPHA_TO_COVERAGE_ENABLED unimplemented"; |
| 430 | break; |
| 431 | case gl::State::DIRTY_BIT_SAMPLE_COVERAGE_ENABLED: |
| 432 | WARN() << "DIRTY_BIT_SAMPLE_COVERAGE_ENABLED unimplemented"; |
| 433 | break; |
| 434 | case gl::State::DIRTY_BIT_SAMPLE_COVERAGE: |
| 435 | WARN() << "DIRTY_BIT_SAMPLE_COVERAGE unimplemented"; |
| 436 | break; |
| 437 | case gl::State::DIRTY_BIT_SAMPLE_MASK_ENABLED: |
| 438 | WARN() << "DIRTY_BIT_SAMPLE_MASK_ENABLED unimplemented"; |
| 439 | break; |
Jamie Madill | c67323a | 2017-11-02 23:11:41 -0400 | [diff] [blame] | 440 | case gl::State::DIRTY_BIT_SAMPLE_MASK: |
| 441 | WARN() << "DIRTY_BIT_SAMPLE_MASK unimplemented"; |
Jamie Madill | ebf7299 | 2017-10-13 14:09:45 -0400 | [diff] [blame] | 442 | break; |
| 443 | case gl::State::DIRTY_BIT_DEPTH_TEST_ENABLED: |
Jamie Madill | 0cec82a | 2018-03-14 09:21:07 -0400 | [diff] [blame] | 444 | mPipelineDesc->updateDepthTestEnabled(glState.getDepthStencilState()); |
Jamie Madill | ebf7299 | 2017-10-13 14:09:45 -0400 | [diff] [blame] | 445 | break; |
| 446 | case gl::State::DIRTY_BIT_DEPTH_FUNC: |
Jamie Madill | 0cec82a | 2018-03-14 09:21:07 -0400 | [diff] [blame] | 447 | mPipelineDesc->updateDepthFunc(glState.getDepthStencilState()); |
Jamie Madill | ebf7299 | 2017-10-13 14:09:45 -0400 | [diff] [blame] | 448 | break; |
| 449 | case gl::State::DIRTY_BIT_DEPTH_MASK: |
Luc Ferron | dd196e0 | 2018-04-04 11:41:44 -0400 | [diff] [blame] | 450 | mPipelineDesc->updateDepthWriteEnabled(glState.getDepthStencilState()); |
Jamie Madill | ebf7299 | 2017-10-13 14:09:45 -0400 | [diff] [blame] | 451 | break; |
| 452 | case gl::State::DIRTY_BIT_STENCIL_TEST_ENABLED: |
Luc Ferron | 364a955 | 2018-03-29 09:44:51 -0400 | [diff] [blame] | 453 | mPipelineDesc->updateStencilTestEnabled(glState.getDepthStencilState()); |
Jamie Madill | ebf7299 | 2017-10-13 14:09:45 -0400 | [diff] [blame] | 454 | break; |
| 455 | case gl::State::DIRTY_BIT_STENCIL_FUNCS_FRONT: |
Luc Ferron | 364a955 | 2018-03-29 09:44:51 -0400 | [diff] [blame] | 456 | mPipelineDesc->updateStencilFrontFuncs(glState.getStencilRef(), |
| 457 | glState.getDepthStencilState()); |
Jamie Madill | ebf7299 | 2017-10-13 14:09:45 -0400 | [diff] [blame] | 458 | break; |
| 459 | case gl::State::DIRTY_BIT_STENCIL_FUNCS_BACK: |
Luc Ferron | 364a955 | 2018-03-29 09:44:51 -0400 | [diff] [blame] | 460 | mPipelineDesc->updateStencilBackFuncs(glState.getStencilBackRef(), |
| 461 | glState.getDepthStencilState()); |
Jamie Madill | ebf7299 | 2017-10-13 14:09:45 -0400 | [diff] [blame] | 462 | break; |
| 463 | case gl::State::DIRTY_BIT_STENCIL_OPS_FRONT: |
Luc Ferron | 364a955 | 2018-03-29 09:44:51 -0400 | [diff] [blame] | 464 | mPipelineDesc->updateStencilFrontOps(glState.getDepthStencilState()); |
Jamie Madill | ebf7299 | 2017-10-13 14:09:45 -0400 | [diff] [blame] | 465 | break; |
| 466 | case gl::State::DIRTY_BIT_STENCIL_OPS_BACK: |
Luc Ferron | 364a955 | 2018-03-29 09:44:51 -0400 | [diff] [blame] | 467 | mPipelineDesc->updateStencilBackOps(glState.getDepthStencilState()); |
Jamie Madill | ebf7299 | 2017-10-13 14:09:45 -0400 | [diff] [blame] | 468 | break; |
| 469 | case gl::State::DIRTY_BIT_STENCIL_WRITEMASK_FRONT: |
Luc Ferron | 364a955 | 2018-03-29 09:44:51 -0400 | [diff] [blame] | 470 | mPipelineDesc->updateStencilFrontWriteMask(glState.getDepthStencilState()); |
Jamie Madill | ebf7299 | 2017-10-13 14:09:45 -0400 | [diff] [blame] | 471 | break; |
| 472 | case gl::State::DIRTY_BIT_STENCIL_WRITEMASK_BACK: |
Luc Ferron | 364a955 | 2018-03-29 09:44:51 -0400 | [diff] [blame] | 473 | mPipelineDesc->updateStencilBackWriteMask(glState.getDepthStencilState()); |
Jamie Madill | ebf7299 | 2017-10-13 14:09:45 -0400 | [diff] [blame] | 474 | break; |
| 475 | case gl::State::DIRTY_BIT_CULL_FACE_ENABLED: |
| 476 | case gl::State::DIRTY_BIT_CULL_FACE: |
Jamie Madill | f2f6d37 | 2018-01-10 21:37:23 -0500 | [diff] [blame] | 477 | mPipelineDesc->updateCullMode(glState.getRasterizerState()); |
Jamie Madill | ebf7299 | 2017-10-13 14:09:45 -0400 | [diff] [blame] | 478 | break; |
| 479 | case gl::State::DIRTY_BIT_FRONT_FACE: |
Jamie Madill | f2f6d37 | 2018-01-10 21:37:23 -0500 | [diff] [blame] | 480 | mPipelineDesc->updateFrontFace(glState.getRasterizerState()); |
Jamie Madill | ebf7299 | 2017-10-13 14:09:45 -0400 | [diff] [blame] | 481 | break; |
| 482 | case gl::State::DIRTY_BIT_POLYGON_OFFSET_FILL_ENABLED: |
| 483 | WARN() << "DIRTY_BIT_POLYGON_OFFSET_FILL_ENABLED unimplemented"; |
| 484 | break; |
| 485 | case gl::State::DIRTY_BIT_POLYGON_OFFSET: |
| 486 | WARN() << "DIRTY_BIT_POLYGON_OFFSET unimplemented"; |
| 487 | break; |
| 488 | case gl::State::DIRTY_BIT_RASTERIZER_DISCARD_ENABLED: |
| 489 | WARN() << "DIRTY_BIT_RASTERIZER_DISCARD_ENABLED unimplemented"; |
| 490 | break; |
| 491 | case gl::State::DIRTY_BIT_LINE_WIDTH: |
Jamie Madill | f2f6d37 | 2018-01-10 21:37:23 -0500 | [diff] [blame] | 492 | mPipelineDesc->updateLineWidth(glState.getLineWidth()); |
Jamie Madill | ebf7299 | 2017-10-13 14:09:45 -0400 | [diff] [blame] | 493 | break; |
| 494 | case gl::State::DIRTY_BIT_PRIMITIVE_RESTART_ENABLED: |
| 495 | WARN() << "DIRTY_BIT_PRIMITIVE_RESTART_ENABLED unimplemented"; |
| 496 | break; |
| 497 | case gl::State::DIRTY_BIT_CLEAR_COLOR: |
Jamie Madill | f4d693c | 2018-02-14 16:38:16 -0500 | [diff] [blame] | 498 | mClearColorValue.color.float32[0] = glState.getColorClearValue().red; |
| 499 | mClearColorValue.color.float32[1] = glState.getColorClearValue().green; |
| 500 | mClearColorValue.color.float32[2] = glState.getColorClearValue().blue; |
| 501 | mClearColorValue.color.float32[3] = glState.getColorClearValue().alpha; |
Jamie Madill | ebf7299 | 2017-10-13 14:09:45 -0400 | [diff] [blame] | 502 | break; |
| 503 | case gl::State::DIRTY_BIT_CLEAR_DEPTH: |
Jamie Madill | f4d693c | 2018-02-14 16:38:16 -0500 | [diff] [blame] | 504 | mClearDepthStencilValue.depthStencil.depth = glState.getDepthClearValue(); |
Jamie Madill | ebf7299 | 2017-10-13 14:09:45 -0400 | [diff] [blame] | 505 | break; |
| 506 | case gl::State::DIRTY_BIT_CLEAR_STENCIL: |
Jamie Madill | f4d693c | 2018-02-14 16:38:16 -0500 | [diff] [blame] | 507 | mClearDepthStencilValue.depthStencil.stencil = |
| 508 | static_cast<uint32_t>(glState.getStencilClearValue()); |
Jamie Madill | ebf7299 | 2017-10-13 14:09:45 -0400 | [diff] [blame] | 509 | break; |
Jamie Madill | c67323a | 2017-11-02 23:11:41 -0400 | [diff] [blame] | 510 | case gl::State::DIRTY_BIT_UNPACK_STATE: |
Luc Ferron | f9749ea | 2018-04-24 15:34:53 -0400 | [diff] [blame] | 511 | // This is a no-op, its only important to use the right unpack state when we do |
| 512 | // setImage or setSubImage in TextureVk, which is plumbed through the frontend call |
Jamie Madill | ebf7299 | 2017-10-13 14:09:45 -0400 | [diff] [blame] | 513 | break; |
Corentin Wallez | 29a2099 | 2017-11-06 18:23:16 -0500 | [diff] [blame] | 514 | case gl::State::DIRTY_BIT_UNPACK_BUFFER_BINDING: |
| 515 | WARN() << "DIRTY_BIT_UNPACK_BUFFER_BINDING unimplemented"; |
| 516 | break; |
Jamie Madill | c67323a | 2017-11-02 23:11:41 -0400 | [diff] [blame] | 517 | case gl::State::DIRTY_BIT_PACK_STATE: |
Luc Ferron | a1c7242 | 2018-05-14 15:58:28 -0400 | [diff] [blame] | 518 | // This is a no-op, its only important to use the right pack state when we do |
| 519 | // call readPixels later on. |
Jamie Madill | ebf7299 | 2017-10-13 14:09:45 -0400 | [diff] [blame] | 520 | break; |
Corentin Wallez | 29a2099 | 2017-11-06 18:23:16 -0500 | [diff] [blame] | 521 | case gl::State::DIRTY_BIT_PACK_BUFFER_BINDING: |
| 522 | WARN() << "DIRTY_BIT_PACK_BUFFER_BINDING unimplemented"; |
| 523 | break; |
Jamie Madill | ebf7299 | 2017-10-13 14:09:45 -0400 | [diff] [blame] | 524 | case gl::State::DIRTY_BIT_DITHER_ENABLED: |
| 525 | WARN() << "DIRTY_BIT_DITHER_ENABLED unimplemented"; |
| 526 | break; |
| 527 | case gl::State::DIRTY_BIT_GENERATE_MIPMAP_HINT: |
| 528 | WARN() << "DIRTY_BIT_GENERATE_MIPMAP_HINT unimplemented"; |
| 529 | break; |
| 530 | case gl::State::DIRTY_BIT_SHADER_DERIVATIVE_HINT: |
| 531 | WARN() << "DIRTY_BIT_SHADER_DERIVATIVE_HINT unimplemented"; |
| 532 | break; |
| 533 | case gl::State::DIRTY_BIT_READ_FRAMEBUFFER_BINDING: |
| 534 | WARN() << "DIRTY_BIT_READ_FRAMEBUFFER_BINDING unimplemented"; |
| 535 | break; |
| 536 | case gl::State::DIRTY_BIT_DRAW_FRAMEBUFFER_BINDING: |
| 537 | WARN() << "DIRTY_BIT_DRAW_FRAMEBUFFER_BINDING unimplemented"; |
| 538 | break; |
| 539 | case gl::State::DIRTY_BIT_RENDERBUFFER_BINDING: |
| 540 | WARN() << "DIRTY_BIT_RENDERBUFFER_BINDING unimplemented"; |
| 541 | break; |
| 542 | case gl::State::DIRTY_BIT_VERTEX_ARRAY_BINDING: |
Jamie Madill | c3755fc | 2018-04-05 08:39:13 -0400 | [diff] [blame] | 543 | invalidateCurrentPipeline(); |
| 544 | mVertexArrayBindingHasChanged = true; |
Jamie Madill | ebf7299 | 2017-10-13 14:09:45 -0400 | [diff] [blame] | 545 | break; |
| 546 | case gl::State::DIRTY_BIT_DRAW_INDIRECT_BUFFER_BINDING: |
| 547 | WARN() << "DIRTY_BIT_DRAW_INDIRECT_BUFFER_BINDING unimplemented"; |
| 548 | break; |
Qin Jiajia | a98a281 | 2017-11-30 18:12:06 +0800 | [diff] [blame] | 549 | case gl::State::DIRTY_BIT_DISPATCH_INDIRECT_BUFFER_BINDING: |
| 550 | WARN() << "DIRTY_BIT_DISPATCH_INDIRECT_BUFFER_BINDING unimplemented"; |
| 551 | break; |
Jamie Madill | ebf7299 | 2017-10-13 14:09:45 -0400 | [diff] [blame] | 552 | case gl::State::DIRTY_BIT_PROGRAM_BINDING: |
Jamie Madill | ebf7299 | 2017-10-13 14:09:45 -0400 | [diff] [blame] | 553 | break; |
| 554 | case gl::State::DIRTY_BIT_PROGRAM_EXECUTABLE: |
| 555 | { |
Jamie Madill | f2f6d37 | 2018-01-10 21:37:23 -0500 | [diff] [blame] | 556 | ProgramVk *programVk = vk::GetImpl(glState.getProgram()); |
Jamie Madill | 78feddc | 2018-04-27 11:45:05 -0400 | [diff] [blame] | 557 | mPipelineDesc->updateShaders(programVk->getVertexModuleSerial(), |
| 558 | programVk->getFragmentModuleSerial()); |
Jamie Madill | 5547b38 | 2017-10-23 18:16:01 -0400 | [diff] [blame] | 559 | dirtyTextures = true; |
Jamie Madill | ebf7299 | 2017-10-13 14:09:45 -0400 | [diff] [blame] | 560 | break; |
| 561 | } |
| 562 | case gl::State::DIRTY_BIT_TEXTURE_BINDINGS: |
Jamie Madill | 5547b38 | 2017-10-23 18:16:01 -0400 | [diff] [blame] | 563 | dirtyTextures = true; |
Jamie Madill | ebf7299 | 2017-10-13 14:09:45 -0400 | [diff] [blame] | 564 | break; |
| 565 | case gl::State::DIRTY_BIT_SAMPLER_BINDINGS: |
Jamie Madill | 5547b38 | 2017-10-23 18:16:01 -0400 | [diff] [blame] | 566 | dirtyTextures = true; |
Jamie Madill | ebf7299 | 2017-10-13 14:09:45 -0400 | [diff] [blame] | 567 | break; |
Geoff Lang | ded7923 | 2017-11-28 15:21:11 -0500 | [diff] [blame] | 568 | case gl::State::DIRTY_BIT_TRANSFORM_FEEDBACK_BINDING: |
| 569 | WARN() << "DIRTY_BIT_TRANSFORM_FEEDBACK_BINDING unimplemented"; |
| 570 | break; |
Xinghua Cao | 10a4d43 | 2017-11-28 14:46:26 +0800 | [diff] [blame] | 571 | case gl::State::DIRTY_BIT_SHADER_STORAGE_BUFFER_BINDING: |
| 572 | WARN() << "DIRTY_BIT_SHADER_STORAGE_BUFFER_BINDING unimplemented"; |
| 573 | break; |
Jamie Madill | f414121 | 2017-12-12 15:08:07 -0500 | [diff] [blame] | 574 | case gl::State::DIRTY_BIT_UNIFORM_BUFFER_BINDINGS: |
| 575 | WARN() << "DIRTY_BIT_UNIFORM_BUFFER_BINDINGS unimplemented"; |
| 576 | break; |
Jamie Madill | ebf7299 | 2017-10-13 14:09:45 -0400 | [diff] [blame] | 577 | case gl::State::DIRTY_BIT_MULTISAMPLING: |
| 578 | WARN() << "DIRTY_BIT_MULTISAMPLING unimplemented"; |
| 579 | break; |
| 580 | case gl::State::DIRTY_BIT_SAMPLE_ALPHA_TO_ONE: |
| 581 | WARN() << "DIRTY_BIT_SAMPLE_ALPHA_TO_ONE unimplemented"; |
| 582 | break; |
| 583 | case gl::State::DIRTY_BIT_COVERAGE_MODULATION: |
| 584 | WARN() << "DIRTY_BIT_COVERAGE_MODULATION unimplemented"; |
| 585 | break; |
| 586 | case gl::State::DIRTY_BIT_PATH_RENDERING_MATRIX_MV: |
| 587 | WARN() << "DIRTY_BIT_PATH_RENDERING_MATRIX_MV unimplemented"; |
| 588 | break; |
| 589 | case gl::State::DIRTY_BIT_PATH_RENDERING_MATRIX_PROJ: |
| 590 | WARN() << "DIRTY_BIT_PATH_RENDERING_MATRIX_PROJ unimplemented"; |
| 591 | break; |
| 592 | case gl::State::DIRTY_BIT_PATH_RENDERING_STENCIL_STATE: |
| 593 | WARN() << "DIRTY_BIT_PATH_RENDERING_STENCIL_STATE unimplemented"; |
| 594 | break; |
| 595 | case gl::State::DIRTY_BIT_FRAMEBUFFER_SRGB: |
| 596 | WARN() << "DIRTY_BIT_FRAMEBUFFER_SRGB unimplemented"; |
| 597 | break; |
Jamie Madill | c67323a | 2017-11-02 23:11:41 -0400 | [diff] [blame] | 598 | case gl::State::DIRTY_BIT_CURRENT_VALUES: |
| 599 | WARN() << "DIRTY_BIT_CURRENT_VALUES unimplemented"; |
| 600 | break; |
Jamie Madill | ebf7299 | 2017-10-13 14:09:45 -0400 | [diff] [blame] | 601 | default: |
Jamie Madill | c67323a | 2017-11-02 23:11:41 -0400 | [diff] [blame] | 602 | UNREACHABLE(); |
Jamie Madill | ebf7299 | 2017-10-13 14:09:45 -0400 | [diff] [blame] | 603 | break; |
| 604 | } |
| 605 | } |
Jamie Madill | 5547b38 | 2017-10-23 18:16:01 -0400 | [diff] [blame] | 606 | |
| 607 | if (dirtyTextures) |
| 608 | { |
Jamie Madill | e1f3ad4 | 2017-10-28 23:00:42 -0400 | [diff] [blame] | 609 | ProgramVk *programVk = vk::GetImpl(glState.getProgram()); |
Jamie Madill | 5547b38 | 2017-10-23 18:16:01 -0400 | [diff] [blame] | 610 | programVk->invalidateTextures(); |
Jamie Madill | 49ac74b | 2017-12-21 14:42:33 -0500 | [diff] [blame] | 611 | mTexturesDirty = true; |
Jamie Madill | 5547b38 | 2017-10-23 18:16:01 -0400 | [diff] [blame] | 612 | } |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 613 | } |
| 614 | |
| 615 | GLint ContextVk::getGPUDisjoint() |
| 616 | { |
| 617 | UNIMPLEMENTED(); |
| 618 | return GLint(); |
| 619 | } |
| 620 | |
| 621 | GLint64 ContextVk::getTimestamp() |
| 622 | { |
| 623 | UNIMPLEMENTED(); |
| 624 | return GLint64(); |
| 625 | } |
| 626 | |
Jamie Madill | 4928b7c | 2017-06-20 12:57:39 -0400 | [diff] [blame] | 627 | void ContextVk::onMakeCurrent(const gl::Context * /*context*/) |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 628 | { |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 629 | } |
| 630 | |
Jiawei Shao | d0a7d10 | 2018-05-07 12:40:20 +0800 | [diff] [blame] | 631 | gl::Caps ContextVk::getNativeCaps() const |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 632 | { |
Jamie Madill | acccc6c | 2016-05-03 17:22:10 -0400 | [diff] [blame] | 633 | return mRenderer->getNativeCaps(); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 634 | } |
| 635 | |
| 636 | const gl::TextureCapsMap &ContextVk::getNativeTextureCaps() const |
| 637 | { |
Jamie Madill | acccc6c | 2016-05-03 17:22:10 -0400 | [diff] [blame] | 638 | return mRenderer->getNativeTextureCaps(); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 639 | } |
| 640 | |
| 641 | const gl::Extensions &ContextVk::getNativeExtensions() const |
| 642 | { |
Jamie Madill | acccc6c | 2016-05-03 17:22:10 -0400 | [diff] [blame] | 643 | return mRenderer->getNativeExtensions(); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 644 | } |
| 645 | |
| 646 | const gl::Limitations &ContextVk::getNativeLimitations() const |
| 647 | { |
Jamie Madill | acccc6c | 2016-05-03 17:22:10 -0400 | [diff] [blame] | 648 | return mRenderer->getNativeLimitations(); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 649 | } |
| 650 | |
| 651 | CompilerImpl *ContextVk::createCompiler() |
| 652 | { |
Jamie Madill | acccc6c | 2016-05-03 17:22:10 -0400 | [diff] [blame] | 653 | return new CompilerVk(); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 654 | } |
| 655 | |
Jamie Madill | acccc6c | 2016-05-03 17:22:10 -0400 | [diff] [blame] | 656 | ShaderImpl *ContextVk::createShader(const gl::ShaderState &state) |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 657 | { |
Jamie Madill | acccc6c | 2016-05-03 17:22:10 -0400 | [diff] [blame] | 658 | return new ShaderVk(state); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 659 | } |
| 660 | |
Jamie Madill | acccc6c | 2016-05-03 17:22:10 -0400 | [diff] [blame] | 661 | ProgramImpl *ContextVk::createProgram(const gl::ProgramState &state) |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 662 | { |
Jamie Madill | acccc6c | 2016-05-03 17:22:10 -0400 | [diff] [blame] | 663 | return new ProgramVk(state); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 664 | } |
| 665 | |
Jamie Madill | acccc6c | 2016-05-03 17:22:10 -0400 | [diff] [blame] | 666 | FramebufferImpl *ContextVk::createFramebuffer(const gl::FramebufferState &state) |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 667 | { |
Jamie Madill | 7b57b9d | 2017-01-13 09:33:38 -0500 | [diff] [blame] | 668 | return FramebufferVk::CreateUserFBO(state); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 669 | } |
| 670 | |
| 671 | TextureImpl *ContextVk::createTexture(const gl::TextureState &state) |
| 672 | { |
Luc Ferron | a9ab0f3 | 2018-05-17 17:03:55 -0400 | [diff] [blame] | 673 | return new TextureVk(state, mRenderer); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 674 | } |
| 675 | |
Jamie Madill | e703c60 | 2018-02-20 10:21:48 -0500 | [diff] [blame] | 676 | RenderbufferImpl *ContextVk::createRenderbuffer(const gl::RenderbufferState &state) |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 677 | { |
Jamie Madill | e703c60 | 2018-02-20 10:21:48 -0500 | [diff] [blame] | 678 | return new RenderbufferVk(state); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 679 | } |
| 680 | |
Jamie Madill | 8f77560 | 2016-11-03 16:45:34 -0400 | [diff] [blame] | 681 | BufferImpl *ContextVk::createBuffer(const gl::BufferState &state) |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 682 | { |
Jamie Madill | 8f77560 | 2016-11-03 16:45:34 -0400 | [diff] [blame] | 683 | return new BufferVk(state); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 684 | } |
| 685 | |
Jamie Madill | acccc6c | 2016-05-03 17:22:10 -0400 | [diff] [blame] | 686 | VertexArrayImpl *ContextVk::createVertexArray(const gl::VertexArrayState &state) |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 687 | { |
Luc Ferron | a9ab0f3 | 2018-05-17 17:03:55 -0400 | [diff] [blame] | 688 | return new VertexArrayVk(state, mRenderer); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 689 | } |
| 690 | |
Corentin Wallez | ad3ae90 | 2018-03-09 13:40:42 -0500 | [diff] [blame] | 691 | QueryImpl *ContextVk::createQuery(gl::QueryType type) |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 692 | { |
Jamie Madill | acccc6c | 2016-05-03 17:22:10 -0400 | [diff] [blame] | 693 | return new QueryVk(type); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 694 | } |
| 695 | |
| 696 | FenceNVImpl *ContextVk::createFenceNV() |
| 697 | { |
Jamie Madill | acccc6c | 2016-05-03 17:22:10 -0400 | [diff] [blame] | 698 | return new FenceNVVk(); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 699 | } |
| 700 | |
Jamie Madill | 70b5bb0 | 2017-08-28 13:32:37 -0400 | [diff] [blame] | 701 | SyncImpl *ContextVk::createSync() |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 702 | { |
Jamie Madill | 70b5bb0 | 2017-08-28 13:32:37 -0400 | [diff] [blame] | 703 | return new SyncVk(); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 704 | } |
| 705 | |
Geoff Lang | 73bd218 | 2016-07-15 13:01:24 -0400 | [diff] [blame] | 706 | TransformFeedbackImpl *ContextVk::createTransformFeedback(const gl::TransformFeedbackState &state) |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 707 | { |
Geoff Lang | 73bd218 | 2016-07-15 13:01:24 -0400 | [diff] [blame] | 708 | return new TransformFeedbackVk(state); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 709 | } |
| 710 | |
Jamie Madill | 06ef36b | 2017-09-09 23:32:46 -0400 | [diff] [blame] | 711 | SamplerImpl *ContextVk::createSampler(const gl::SamplerState &state) |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 712 | { |
Jamie Madill | 06ef36b | 2017-09-09 23:32:46 -0400 | [diff] [blame] | 713 | return new SamplerVk(state); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 714 | } |
| 715 | |
Yunchao He | a336b90 | 2017-08-02 16:05:21 +0800 | [diff] [blame] | 716 | ProgramPipelineImpl *ContextVk::createProgramPipeline(const gl::ProgramPipelineState &state) |
| 717 | { |
| 718 | return new ProgramPipelineVk(state); |
| 719 | } |
| 720 | |
Sami Väisänen | e45e53b | 2016-05-25 10:36:04 +0300 | [diff] [blame] | 721 | std::vector<PathImpl *> ContextVk::createPaths(GLsizei) |
| 722 | { |
| 723 | return std::vector<PathImpl *>(); |
| 724 | } |
| 725 | |
Jamie Madill | 7210656 | 2017-03-24 14:18:50 -0400 | [diff] [blame] | 726 | void ContextVk::invalidateCurrentPipeline() |
| 727 | { |
Jamie Madill | ffa4cbb | 2018-01-23 13:04:07 -0500 | [diff] [blame] | 728 | mCurrentPipeline = nullptr; |
Jamie Madill | 7210656 | 2017-03-24 14:18:50 -0400 | [diff] [blame] | 729 | } |
| 730 | |
Jamie Madill | fe54834 | 2017-06-19 11:13:24 -0400 | [diff] [blame] | 731 | gl::Error ContextVk::dispatchCompute(const gl::Context *context, |
| 732 | GLuint numGroupsX, |
| 733 | GLuint numGroupsY, |
| 734 | GLuint numGroupsZ) |
Xinghua Cao | 2b39659 | 2017-03-29 15:36:04 +0800 | [diff] [blame] | 735 | { |
| 736 | UNIMPLEMENTED(); |
Yuly Novikov | c4d18aa | 2017-03-09 18:45:02 -0500 | [diff] [blame] | 737 | return gl::InternalError(); |
Xinghua Cao | 2b39659 | 2017-03-29 15:36:04 +0800 | [diff] [blame] | 738 | } |
| 739 | |
Qin Jiajia | 62fcf62 | 2017-11-30 16:16:12 +0800 | [diff] [blame] | 740 | gl::Error ContextVk::dispatchComputeIndirect(const gl::Context *context, GLintptr indirect) |
| 741 | { |
| 742 | UNIMPLEMENTED(); |
| 743 | return gl::InternalError(); |
| 744 | } |
| 745 | |
Xinghua Cao | 89c422a | 2017-11-29 18:24:20 +0800 | [diff] [blame] | 746 | gl::Error ContextVk::memoryBarrier(const gl::Context *context, GLbitfield barriers) |
| 747 | { |
| 748 | UNIMPLEMENTED(); |
| 749 | return gl::InternalError(); |
| 750 | } |
| 751 | |
| 752 | gl::Error ContextVk::memoryBarrierByRegion(const gl::Context *context, GLbitfield barriers) |
| 753 | { |
| 754 | UNIMPLEMENTED(); |
| 755 | return gl::InternalError(); |
| 756 | } |
| 757 | |
Jamie Madill | 6c7ab7f | 2018-03-31 14:19:15 -0400 | [diff] [blame] | 758 | vk::DynamicDescriptorPool *ContextVk::getDynamicDescriptorPool() |
Jamie Madill | 76e471e | 2017-10-21 09:56:01 -0400 | [diff] [blame] | 759 | { |
Luc Ferron | daedf4d | 2018-03-16 09:28:53 -0400 | [diff] [blame] | 760 | return &mDynamicDescriptorPool; |
Jamie Madill | 76e471e | 2017-10-21 09:56:01 -0400 | [diff] [blame] | 761 | } |
| 762 | |
Jamie Madill | f4d693c | 2018-02-14 16:38:16 -0500 | [diff] [blame] | 763 | const VkClearValue &ContextVk::getClearColorValue() const |
| 764 | { |
| 765 | return mClearColorValue; |
| 766 | } |
| 767 | |
| 768 | const VkClearValue &ContextVk::getClearDepthStencilValue() const |
| 769 | { |
| 770 | return mClearDepthStencilValue; |
| 771 | } |
| 772 | |
Jamie Madill | 9aef367 | 2018-04-27 11:45:06 -0400 | [diff] [blame] | 773 | VkColorComponentFlags ContextVk::getClearColorMask() const |
| 774 | { |
| 775 | return mClearColorMask; |
| 776 | } |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 777 | } // namespace rx |