blob: 8206c160f2cb1f3ae429ea574758367377ddb1e4 [file] [log] [blame]
Jamie Madill9e54b5a2016-05-25 12:57:39 -04001//
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 Madilldf68a6f2017-01-13 17:29:53 -050012#include "common/BitSetIterator.h"
Jamie Madill9e54b5a2016-05-25 12:57:39 -040013#include "common/debug.h"
Jamie Madilldf68a6f2017-01-13 17:29:53 -050014#include "libANGLE/Program.h"
Jamie Madillacccc6c2016-05-03 17:22:10 -040015#include "libANGLE/renderer/vulkan/BufferVk.h"
16#include "libANGLE/renderer/vulkan/CompilerVk.h"
17#include "libANGLE/renderer/vulkan/ContextVk.h"
18#include "libANGLE/renderer/vulkan/DeviceVk.h"
19#include "libANGLE/renderer/vulkan/FenceNVVk.h"
20#include "libANGLE/renderer/vulkan/FenceSyncVk.h"
21#include "libANGLE/renderer/vulkan/FramebufferVk.h"
22#include "libANGLE/renderer/vulkan/ImageVk.h"
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"
29#include "libANGLE/renderer/vulkan/TextureVk.h"
30#include "libANGLE/renderer/vulkan/TransformFeedbackVk.h"
31#include "libANGLE/renderer/vulkan/VertexArrayVk.h"
Jamie Madilldf68a6f2017-01-13 17:29:53 -050032#include "libANGLE/renderer/vulkan/formatutilsvk.h"
Jamie Madill9e54b5a2016-05-25 12:57:39 -040033
34namespace rx
35{
36
Jamie Madillacccc6c2016-05-03 17:22:10 -040037ContextVk::ContextVk(const gl::ContextState &state, RendererVk *renderer)
38 : ContextImpl(state), mRenderer(renderer)
Jamie Madill9e54b5a2016-05-25 12:57:39 -040039{
40}
41
42ContextVk::~ContextVk()
43{
Jamie Madill5deea722017-02-16 10:44:46 -050044 mCurrentPipeline.destroy(getDevice());
Jamie Madill9e54b5a2016-05-25 12:57:39 -040045}
46
47gl::Error ContextVk::initialize()
48{
Jamie Madille09bd5d2016-11-29 16:20:35 -050049 return gl::NoError();
Jamie Madill9e54b5a2016-05-25 12:57:39 -040050}
51
52gl::Error ContextVk::flush()
53{
54 UNIMPLEMENTED();
55 return gl::Error(GL_INVALID_OPERATION);
56}
57
58gl::Error ContextVk::finish()
59{
60 UNIMPLEMENTED();
61 return gl::Error(GL_INVALID_OPERATION);
62}
63
64gl::Error ContextVk::drawArrays(GLenum mode, GLint first, GLsizei count)
65{
Jamie Madilldf68a6f2017-01-13 17:29:53 -050066 VkDevice device = mRenderer->getDevice();
67 const auto &state = mState.getState();
68 const auto &programGL = state.getProgram();
69 const auto &vao = state.getVertexArray();
70 const auto &attribs = vao->getVertexAttributes();
71 const auto &programVk = GetImplAs<ProgramVk>(programGL);
72 const auto *drawFBO = state.getDrawFramebuffer();
73 FramebufferVk *vkFBO = GetImplAs<FramebufferVk>(drawFBO);
74
75 // { vertex, fragment }
76 VkPipelineShaderStageCreateInfo shaderStages[2];
77
78 shaderStages[0].sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO;
79 shaderStages[0].pNext = nullptr;
80 shaderStages[0].flags = 0;
81 shaderStages[0].stage = VK_SHADER_STAGE_VERTEX_BIT;
82 shaderStages[0].module = programVk->getLinkedVertexModule().getHandle();
83 shaderStages[0].pName = "main";
84 shaderStages[0].pSpecializationInfo = nullptr;
85
86 shaderStages[1].sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO;
87 shaderStages[1].pNext = nullptr;
88 shaderStages[1].flags = 0;
89 shaderStages[1].stage = VK_SHADER_STAGE_FRAGMENT_BIT;
90 shaderStages[1].module = programVk->getLinkedFragmentModule().getHandle();
91 shaderStages[1].pName = "main";
92 shaderStages[1].pSpecializationInfo = nullptr;
93
94 // Process vertex attributes
95 // TODO(jmadill): Caching with dirty bits.
96 std::vector<VkVertexInputBindingDescription> vertexBindings;
97 std::vector<VkVertexInputAttributeDescription> vertexAttribs;
98 std::vector<VkBuffer> vertexHandles;
99 std::vector<VkDeviceSize> vertexOffsets;
100
101 for (auto attribIndex : angle::IterateBitSet(programGL->getActiveAttribLocationsMask()))
102 {
103 const auto &attrib = attribs[attribIndex];
104 if (attrib.enabled)
105 {
106 VkVertexInputBindingDescription bindingDesc;
107 bindingDesc.binding = static_cast<uint32_t>(vertexBindings.size());
108 bindingDesc.stride = static_cast<uint32_t>(gl::ComputeVertexAttributeTypeSize(attrib));
109 bindingDesc.inputRate =
110 (attrib.divisor > 0 ? VK_VERTEX_INPUT_RATE_INSTANCE : VK_VERTEX_INPUT_RATE_VERTEX);
111
112 gl::VertexFormatType vertexFormatType = gl::GetVertexFormatType(attrib);
113
114 VkVertexInputAttributeDescription attribDesc;
115 attribDesc.binding = bindingDesc.binding;
116 attribDesc.format = vk::GetNativeVertexFormat(vertexFormatType);
117 attribDesc.location = static_cast<uint32_t>(attribIndex);
118 attribDesc.offset = static_cast<uint32_t>(attrib.offset);
119
120 vertexBindings.push_back(bindingDesc);
121 vertexAttribs.push_back(attribDesc);
122
123 // TODO(jmadill): Offset handling.
124 gl::Buffer *bufferGL = attrib.buffer.get();
125 ASSERT(bufferGL);
126 BufferVk *bufferVk = GetImplAs<BufferVk>(bufferGL);
127 vertexHandles.push_back(bufferVk->getVkBuffer().getHandle());
128 vertexOffsets.push_back(0);
129 }
130 else
131 {
132 UNIMPLEMENTED();
133 }
134 }
135
136 // TODO(jmadill): Validate with ASSERT against physical device limits/caps?
137 VkPipelineVertexInputStateCreateInfo vertexInputState;
138 vertexInputState.sType = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO;
139 vertexInputState.pNext = nullptr;
140 vertexInputState.flags = 0;
141 vertexInputState.vertexBindingDescriptionCount = static_cast<uint32_t>(vertexBindings.size());
142 vertexInputState.pVertexBindingDescriptions = vertexBindings.data();
143 vertexInputState.vertexAttributeDescriptionCount = static_cast<uint32_t>(vertexAttribs.size());
144 vertexInputState.pVertexAttributeDescriptions = vertexAttribs.data();
145
146 VkPipelineInputAssemblyStateCreateInfo inputAssemblyState;
147 inputAssemblyState.sType = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO;
148 inputAssemblyState.pNext = nullptr;
149 inputAssemblyState.flags = 0;
150 inputAssemblyState.topology = gl_vk::GetPrimitiveTopology(mode);
151 inputAssemblyState.primitiveRestartEnable = VK_FALSE;
152
153 const gl::Rectangle &viewportGL = state.getViewport();
154 VkViewport viewportVk;
155 viewportVk.x = static_cast<float>(viewportGL.x);
156 viewportVk.y = static_cast<float>(viewportGL.y);
157 viewportVk.width = static_cast<float>(viewportGL.width);
158 viewportVk.height = static_cast<float>(viewportGL.height);
159 viewportVk.minDepth = state.getNearPlane();
160 viewportVk.maxDepth = state.getFarPlane();
161
162 // TODO(jmadill): Scissor.
163 VkRect2D scissorVk;
164 scissorVk.offset.x = viewportGL.x;
165 scissorVk.offset.y = viewportGL.y;
166 scissorVk.extent.width = viewportGL.width;
167 scissorVk.extent.height = viewportGL.height;
168
169 VkPipelineViewportStateCreateInfo viewportState;
170 viewportState.sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO;
171 viewportState.pNext = nullptr;
172 viewportState.flags = 0;
173 viewportState.viewportCount = 1;
174 viewportState.pViewports = &viewportVk;
175 viewportState.scissorCount = 1;
176 viewportState.pScissors = &scissorVk;
177
178 // TODO(jmadill): Extra rasterizer state features.
179 VkPipelineRasterizationStateCreateInfo rasterState;
180 rasterState.sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO;
181 rasterState.pNext = nullptr;
182 rasterState.flags = 0;
183 rasterState.depthClampEnable = VK_FALSE;
184 rasterState.rasterizerDiscardEnable = VK_FALSE;
185 rasterState.polygonMode = VK_POLYGON_MODE_FILL;
186 rasterState.cullMode = gl_vk::GetCullMode(state.getRasterizerState());
187 rasterState.frontFace = gl_vk::GetFrontFace(state.getRasterizerState().frontFace);
188 rasterState.depthBiasEnable = VK_FALSE;
189 rasterState.depthBiasConstantFactor = 0.0f;
190 rasterState.depthBiasClamp = 0.0f;
191 rasterState.depthBiasSlopeFactor = 0.0f;
192 rasterState.lineWidth = state.getLineWidth();
193
194 // TODO(jmadill): Multisample state.
195 VkPipelineMultisampleStateCreateInfo multisampleState;
196 multisampleState.sType = VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO;
197 multisampleState.pNext = nullptr;
198 multisampleState.flags = 0;
199 multisampleState.rasterizationSamples = VK_SAMPLE_COUNT_1_BIT;
200 multisampleState.sampleShadingEnable = VK_FALSE;
201 multisampleState.minSampleShading = 0.0f;
202 multisampleState.pSampleMask = nullptr;
203 multisampleState.alphaToCoverageEnable = VK_FALSE;
204 multisampleState.alphaToOneEnable = VK_FALSE;
205
206 // TODO(jmadill): Depth/stencil state.
207
208 // TODO(jmadill): Blend state/MRT.
209 VkPipelineColorBlendAttachmentState blendAttachmentState;
210 blendAttachmentState.blendEnable = VK_FALSE;
211 blendAttachmentState.srcColorBlendFactor = VK_BLEND_FACTOR_ONE;
212 blendAttachmentState.dstColorBlendFactor = VK_BLEND_FACTOR_ONE;
213 blendAttachmentState.colorBlendOp = VK_BLEND_OP_ADD;
214 blendAttachmentState.srcAlphaBlendFactor = VK_BLEND_FACTOR_ONE;
215 blendAttachmentState.dstAlphaBlendFactor = VK_BLEND_FACTOR_ONE;
216 blendAttachmentState.alphaBlendOp = VK_BLEND_OP_ADD;
217 blendAttachmentState.colorWriteMask = (VK_COLOR_COMPONENT_R_BIT | VK_COLOR_COMPONENT_G_BIT |
218 VK_COLOR_COMPONENT_B_BIT | VK_COLOR_COMPONENT_A_BIT);
219
220 VkPipelineColorBlendStateCreateInfo blendState;
221 blendState.sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO;
222 blendState.pNext = 0;
223 blendState.flags = 0;
224 blendState.logicOpEnable = VK_FALSE;
225 blendState.logicOp = VK_LOGIC_OP_CLEAR;
226 blendState.attachmentCount = 1;
227 blendState.pAttachments = &blendAttachmentState;
228 blendState.blendConstants[0] = 0.0f;
229 blendState.blendConstants[1] = 0.0f;
230 blendState.blendConstants[2] = 0.0f;
231 blendState.blendConstants[3] = 0.0f;
232
233 // TODO(jmadill): Dynamic state.
234 vk::RenderPass *renderPass = nullptr;
235 ANGLE_TRY_RESULT(vkFBO->getRenderPass(device), renderPass);
236 ASSERT(renderPass && renderPass->valid());
237
238 vk::PipelineLayout *pipelineLayout = nullptr;
239 ANGLE_TRY_RESULT(programVk->getPipelineLayout(device), pipelineLayout);
240 ASSERT(pipelineLayout && pipelineLayout->valid());
241
242 VkGraphicsPipelineCreateInfo pipelineInfo;
243 pipelineInfo.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO;
244 pipelineInfo.pNext = nullptr;
245 pipelineInfo.flags = 0;
246 pipelineInfo.stageCount = 2;
247 pipelineInfo.pStages = shaderStages;
248 pipelineInfo.pVertexInputState = &vertexInputState;
249 pipelineInfo.pInputAssemblyState = &inputAssemblyState;
250 pipelineInfo.pTessellationState = nullptr;
251 pipelineInfo.pViewportState = &viewportState;
252 pipelineInfo.pRasterizationState = &rasterState;
253 pipelineInfo.pMultisampleState = &multisampleState;
254 pipelineInfo.pDepthStencilState = nullptr;
255 pipelineInfo.pColorBlendState = &blendState;
256 pipelineInfo.pDynamicState = nullptr;
257 pipelineInfo.layout = pipelineLayout->getHandle();
258 pipelineInfo.renderPass = renderPass->getHandle();
259 pipelineInfo.subpass = 0;
260 pipelineInfo.basePipelineHandle = VK_NULL_HANDLE;
261 pipelineInfo.basePipelineIndex = 0;
262
Jamie Madill5deea722017-02-16 10:44:46 -0500263 vk::Pipeline newPipeline;
264 ANGLE_TRY(newPipeline.initGraphics(device, pipelineInfo));
Jamie Madilldf68a6f2017-01-13 17:29:53 -0500265
Jamie Madill5deea722017-02-16 10:44:46 -0500266 mCurrentPipeline.retain(device, std::move(newPipeline));
Jamie Madilldf68a6f2017-01-13 17:29:53 -0500267
268 vk::CommandBuffer *commandBuffer = mRenderer->getCommandBuffer();
269 ANGLE_TRY(vkFBO->beginRenderPass(device, commandBuffer, state));
270
271 commandBuffer->bindPipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, mCurrentPipeline);
272 commandBuffer->bindVertexBuffers(0, vertexHandles, vertexOffsets);
273 commandBuffer->draw(count, 1, first, 0);
274 commandBuffer->endRenderPass();
275 ANGLE_TRY(commandBuffer->end());
276
277 ANGLE_TRY(mRenderer->submitAndFinishCommandBuffer(*commandBuffer));
278
279 return gl::NoError();
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400280}
281
282gl::Error ContextVk::drawArraysInstanced(GLenum mode,
283 GLint first,
284 GLsizei count,
285 GLsizei instanceCount)
286{
287 UNIMPLEMENTED();
288 return gl::Error(GL_INVALID_OPERATION);
289}
290
291gl::Error ContextVk::drawElements(GLenum mode,
292 GLsizei count,
293 GLenum type,
294 const GLvoid *indices,
295 const gl::IndexRange &indexRange)
296{
297 UNIMPLEMENTED();
298 return gl::Error(GL_INVALID_OPERATION);
299}
300
301gl::Error ContextVk::drawElementsInstanced(GLenum mode,
302 GLsizei count,
303 GLenum type,
304 const GLvoid *indices,
305 GLsizei instances,
306 const gl::IndexRange &indexRange)
307{
308 UNIMPLEMENTED();
309 return gl::Error(GL_INVALID_OPERATION);
310}
311
312gl::Error ContextVk::drawRangeElements(GLenum mode,
313 GLuint start,
314 GLuint end,
315 GLsizei count,
316 GLenum type,
317 const GLvoid *indices,
318 const gl::IndexRange &indexRange)
319{
Jamie Madill7b57b9d2017-01-13 09:33:38 -0500320 return gl::NoError();
321}
322
323VkDevice ContextVk::getDevice() const
324{
325 return mRenderer->getDevice();
326}
327
328vk::CommandBuffer *ContextVk::getCommandBuffer()
329{
330 return mRenderer->getCommandBuffer();
331}
332
333vk::Error ContextVk::submitCommands(const vk::CommandBuffer &commandBuffer)
334{
335 // TODO(jmadill): Command queuing.
336 ANGLE_TRY(mRenderer->submitAndFinishCommandBuffer(commandBuffer));
337 return vk::NoError();
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400338}
339
Jiajia Qind9671222016-11-29 16:30:31 +0800340gl::Error ContextVk::drawArraysIndirect(GLenum mode, const GLvoid *indirect)
341{
342 UNIMPLEMENTED();
343 return gl::InternalError() << "DrawArraysIndirect hasn't been implemented for vulkan backend.";
344}
345
346gl::Error ContextVk::drawElementsIndirect(GLenum mode, GLenum type, const GLvoid *indirect)
347{
348 UNIMPLEMENTED();
349 return gl::InternalError()
350 << "DrawElementsIndirect hasn't been implemented for vulkan backend.";
351}
352
Corentin Wallez87fbe1c2016-08-03 14:41:42 -0400353GLenum ContextVk::getResetStatus()
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400354{
355 UNIMPLEMENTED();
Corentin Wallez87fbe1c2016-08-03 14:41:42 -0400356 return GL_NO_ERROR;
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400357}
358
359std::string ContextVk::getVendorString() const
360{
361 UNIMPLEMENTED();
362 return std::string();
363}
364
365std::string ContextVk::getRendererDescription() const
366{
Jamie Madille09bd5d2016-11-29 16:20:35 -0500367 return mRenderer->getRendererDescription();
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400368}
369
370void ContextVk::insertEventMarker(GLsizei length, const char *marker)
371{
372 UNIMPLEMENTED();
373}
374
375void ContextVk::pushGroupMarker(GLsizei length, const char *marker)
376{
377 UNIMPLEMENTED();
378}
379
380void ContextVk::popGroupMarker()
381{
382 UNIMPLEMENTED();
383}
384
Frank Henigman5a53d542017-02-16 21:24:10 -0500385void ContextVk::syncState(const gl::State::DirtyBits & /*dirtyBits*/)
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400386{
Jamie Madill7b57b9d2017-01-13 09:33:38 -0500387 // TODO(jmadill): Vulkan dirty bits.
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400388}
389
390GLint ContextVk::getGPUDisjoint()
391{
392 UNIMPLEMENTED();
393 return GLint();
394}
395
396GLint64 ContextVk::getTimestamp()
397{
398 UNIMPLEMENTED();
399 return GLint64();
400}
401
Jamie Madille09bd5d2016-11-29 16:20:35 -0500402void ContextVk::onMakeCurrent(const gl::ContextState & /*data*/)
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400403{
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400404}
405
406const gl::Caps &ContextVk::getNativeCaps() const
407{
Jamie Madillacccc6c2016-05-03 17:22:10 -0400408 return mRenderer->getNativeCaps();
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400409}
410
411const gl::TextureCapsMap &ContextVk::getNativeTextureCaps() const
412{
Jamie Madillacccc6c2016-05-03 17:22:10 -0400413 return mRenderer->getNativeTextureCaps();
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400414}
415
416const gl::Extensions &ContextVk::getNativeExtensions() const
417{
Jamie Madillacccc6c2016-05-03 17:22:10 -0400418 return mRenderer->getNativeExtensions();
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400419}
420
421const gl::Limitations &ContextVk::getNativeLimitations() const
422{
Jamie Madillacccc6c2016-05-03 17:22:10 -0400423 return mRenderer->getNativeLimitations();
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400424}
425
426CompilerImpl *ContextVk::createCompiler()
427{
Jamie Madillacccc6c2016-05-03 17:22:10 -0400428 return new CompilerVk();
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400429}
430
Jamie Madillacccc6c2016-05-03 17:22:10 -0400431ShaderImpl *ContextVk::createShader(const gl::ShaderState &state)
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400432{
Jamie Madillacccc6c2016-05-03 17:22:10 -0400433 return new ShaderVk(state);
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400434}
435
Jamie Madillacccc6c2016-05-03 17:22:10 -0400436ProgramImpl *ContextVk::createProgram(const gl::ProgramState &state)
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400437{
Jamie Madillacccc6c2016-05-03 17:22:10 -0400438 return new ProgramVk(state);
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400439}
440
Jamie Madillacccc6c2016-05-03 17:22:10 -0400441FramebufferImpl *ContextVk::createFramebuffer(const gl::FramebufferState &state)
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400442{
Jamie Madill7b57b9d2017-01-13 09:33:38 -0500443 return FramebufferVk::CreateUserFBO(state);
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400444}
445
446TextureImpl *ContextVk::createTexture(const gl::TextureState &state)
447{
Jamie Madillacccc6c2016-05-03 17:22:10 -0400448 return new TextureVk(state);
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400449}
450
451RenderbufferImpl *ContextVk::createRenderbuffer()
452{
Jamie Madillacccc6c2016-05-03 17:22:10 -0400453 return new RenderbufferVk();
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400454}
455
Jamie Madill8f775602016-11-03 16:45:34 -0400456BufferImpl *ContextVk::createBuffer(const gl::BufferState &state)
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400457{
Jamie Madill8f775602016-11-03 16:45:34 -0400458 return new BufferVk(state);
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400459}
460
Jamie Madillacccc6c2016-05-03 17:22:10 -0400461VertexArrayImpl *ContextVk::createVertexArray(const gl::VertexArrayState &state)
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400462{
Jamie Madillacccc6c2016-05-03 17:22:10 -0400463 return new VertexArrayVk(state);
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400464}
465
466QueryImpl *ContextVk::createQuery(GLenum type)
467{
Jamie Madillacccc6c2016-05-03 17:22:10 -0400468 return new QueryVk(type);
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400469}
470
471FenceNVImpl *ContextVk::createFenceNV()
472{
Jamie Madillacccc6c2016-05-03 17:22:10 -0400473 return new FenceNVVk();
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400474}
475
476FenceSyncImpl *ContextVk::createFenceSync()
477{
Jamie Madillacccc6c2016-05-03 17:22:10 -0400478 return new FenceSyncVk();
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400479}
480
Geoff Lang73bd2182016-07-15 13:01:24 -0400481TransformFeedbackImpl *ContextVk::createTransformFeedback(const gl::TransformFeedbackState &state)
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400482{
Geoff Lang73bd2182016-07-15 13:01:24 -0400483 return new TransformFeedbackVk(state);
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400484}
485
486SamplerImpl *ContextVk::createSampler()
487{
Jamie Madillacccc6c2016-05-03 17:22:10 -0400488 return new SamplerVk();
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400489}
490
Sami Väisänene45e53b2016-05-25 10:36:04 +0300491std::vector<PathImpl *> ContextVk::createPaths(GLsizei)
492{
493 return std::vector<PathImpl *>();
494}
495
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400496} // namespace rx