blob: 821d40e983a8fcb499426321e2d3337bfb8d09a5 [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();
Jiawei-Shao2597fb62016-12-09 16:38:02 +080071 const auto &bindings = vao->getVertexBindings();
Jamie Madilldf68a6f2017-01-13 17:29:53 -050072 const auto &programVk = GetImplAs<ProgramVk>(programGL);
73 const auto *drawFBO = state.getDrawFramebuffer();
74 FramebufferVk *vkFBO = GetImplAs<FramebufferVk>(drawFBO);
75
76 // { vertex, fragment }
77 VkPipelineShaderStageCreateInfo shaderStages[2];
78
79 shaderStages[0].sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO;
80 shaderStages[0].pNext = nullptr;
81 shaderStages[0].flags = 0;
82 shaderStages[0].stage = VK_SHADER_STAGE_VERTEX_BIT;
83 shaderStages[0].module = programVk->getLinkedVertexModule().getHandle();
84 shaderStages[0].pName = "main";
85 shaderStages[0].pSpecializationInfo = nullptr;
86
87 shaderStages[1].sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO;
88 shaderStages[1].pNext = nullptr;
89 shaderStages[1].flags = 0;
90 shaderStages[1].stage = VK_SHADER_STAGE_FRAGMENT_BIT;
91 shaderStages[1].module = programVk->getLinkedFragmentModule().getHandle();
92 shaderStages[1].pName = "main";
93 shaderStages[1].pSpecializationInfo = nullptr;
94
95 // Process vertex attributes
96 // TODO(jmadill): Caching with dirty bits.
97 std::vector<VkVertexInputBindingDescription> vertexBindings;
98 std::vector<VkVertexInputAttributeDescription> vertexAttribs;
99 std::vector<VkBuffer> vertexHandles;
100 std::vector<VkDeviceSize> vertexOffsets;
101
102 for (auto attribIndex : angle::IterateBitSet(programGL->getActiveAttribLocationsMask()))
103 {
104 const auto &attrib = attribs[attribIndex];
Jiawei-Shao2597fb62016-12-09 16:38:02 +0800105 const auto &binding = bindings[attrib.bindingIndex];
Jamie Madilldf68a6f2017-01-13 17:29:53 -0500106 if (attrib.enabled)
107 {
108 VkVertexInputBindingDescription bindingDesc;
109 bindingDesc.binding = static_cast<uint32_t>(vertexBindings.size());
110 bindingDesc.stride = static_cast<uint32_t>(gl::ComputeVertexAttributeTypeSize(attrib));
111 bindingDesc.inputRate =
Jiawei-Shao2597fb62016-12-09 16:38:02 +0800112 (binding.divisor > 0 ? VK_VERTEX_INPUT_RATE_INSTANCE : VK_VERTEX_INPUT_RATE_VERTEX);
Jamie Madilldf68a6f2017-01-13 17:29:53 -0500113
114 gl::VertexFormatType vertexFormatType = gl::GetVertexFormatType(attrib);
115
116 VkVertexInputAttributeDescription attribDesc;
117 attribDesc.binding = bindingDesc.binding;
118 attribDesc.format = vk::GetNativeVertexFormat(vertexFormatType);
119 attribDesc.location = static_cast<uint32_t>(attribIndex);
Jiawei-Shao2597fb62016-12-09 16:38:02 +0800120 attribDesc.offset =
121 static_cast<uint32_t>(ComputeVertexAttributeOffset(attrib, binding));
Jamie Madilldf68a6f2017-01-13 17:29:53 -0500122
123 vertexBindings.push_back(bindingDesc);
124 vertexAttribs.push_back(attribDesc);
125
126 // TODO(jmadill): Offset handling.
Jiawei-Shao2597fb62016-12-09 16:38:02 +0800127 gl::Buffer *bufferGL = binding.buffer.get();
Jamie Madilldf68a6f2017-01-13 17:29:53 -0500128 ASSERT(bufferGL);
129 BufferVk *bufferVk = GetImplAs<BufferVk>(bufferGL);
130 vertexHandles.push_back(bufferVk->getVkBuffer().getHandle());
131 vertexOffsets.push_back(0);
132 }
133 else
134 {
135 UNIMPLEMENTED();
136 }
137 }
138
139 // TODO(jmadill): Validate with ASSERT against physical device limits/caps?
140 VkPipelineVertexInputStateCreateInfo vertexInputState;
141 vertexInputState.sType = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO;
142 vertexInputState.pNext = nullptr;
143 vertexInputState.flags = 0;
144 vertexInputState.vertexBindingDescriptionCount = static_cast<uint32_t>(vertexBindings.size());
145 vertexInputState.pVertexBindingDescriptions = vertexBindings.data();
146 vertexInputState.vertexAttributeDescriptionCount = static_cast<uint32_t>(vertexAttribs.size());
147 vertexInputState.pVertexAttributeDescriptions = vertexAttribs.data();
148
149 VkPipelineInputAssemblyStateCreateInfo inputAssemblyState;
150 inputAssemblyState.sType = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO;
151 inputAssemblyState.pNext = nullptr;
152 inputAssemblyState.flags = 0;
153 inputAssemblyState.topology = gl_vk::GetPrimitiveTopology(mode);
154 inputAssemblyState.primitiveRestartEnable = VK_FALSE;
155
156 const gl::Rectangle &viewportGL = state.getViewport();
157 VkViewport viewportVk;
158 viewportVk.x = static_cast<float>(viewportGL.x);
159 viewportVk.y = static_cast<float>(viewportGL.y);
160 viewportVk.width = static_cast<float>(viewportGL.width);
161 viewportVk.height = static_cast<float>(viewportGL.height);
162 viewportVk.minDepth = state.getNearPlane();
163 viewportVk.maxDepth = state.getFarPlane();
164
165 // TODO(jmadill): Scissor.
166 VkRect2D scissorVk;
167 scissorVk.offset.x = viewportGL.x;
168 scissorVk.offset.y = viewportGL.y;
169 scissorVk.extent.width = viewportGL.width;
170 scissorVk.extent.height = viewportGL.height;
171
172 VkPipelineViewportStateCreateInfo viewportState;
173 viewportState.sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO;
174 viewportState.pNext = nullptr;
175 viewportState.flags = 0;
176 viewportState.viewportCount = 1;
177 viewportState.pViewports = &viewportVk;
178 viewportState.scissorCount = 1;
179 viewportState.pScissors = &scissorVk;
180
181 // TODO(jmadill): Extra rasterizer state features.
182 VkPipelineRasterizationStateCreateInfo rasterState;
183 rasterState.sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO;
184 rasterState.pNext = nullptr;
185 rasterState.flags = 0;
186 rasterState.depthClampEnable = VK_FALSE;
187 rasterState.rasterizerDiscardEnable = VK_FALSE;
188 rasterState.polygonMode = VK_POLYGON_MODE_FILL;
189 rasterState.cullMode = gl_vk::GetCullMode(state.getRasterizerState());
190 rasterState.frontFace = gl_vk::GetFrontFace(state.getRasterizerState().frontFace);
191 rasterState.depthBiasEnable = VK_FALSE;
192 rasterState.depthBiasConstantFactor = 0.0f;
193 rasterState.depthBiasClamp = 0.0f;
194 rasterState.depthBiasSlopeFactor = 0.0f;
195 rasterState.lineWidth = state.getLineWidth();
196
197 // TODO(jmadill): Multisample state.
198 VkPipelineMultisampleStateCreateInfo multisampleState;
199 multisampleState.sType = VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO;
200 multisampleState.pNext = nullptr;
201 multisampleState.flags = 0;
202 multisampleState.rasterizationSamples = VK_SAMPLE_COUNT_1_BIT;
203 multisampleState.sampleShadingEnable = VK_FALSE;
204 multisampleState.minSampleShading = 0.0f;
205 multisampleState.pSampleMask = nullptr;
206 multisampleState.alphaToCoverageEnable = VK_FALSE;
207 multisampleState.alphaToOneEnable = VK_FALSE;
208
209 // TODO(jmadill): Depth/stencil state.
210
211 // TODO(jmadill): Blend state/MRT.
212 VkPipelineColorBlendAttachmentState blendAttachmentState;
213 blendAttachmentState.blendEnable = VK_FALSE;
214 blendAttachmentState.srcColorBlendFactor = VK_BLEND_FACTOR_ONE;
215 blendAttachmentState.dstColorBlendFactor = VK_BLEND_FACTOR_ONE;
216 blendAttachmentState.colorBlendOp = VK_BLEND_OP_ADD;
217 blendAttachmentState.srcAlphaBlendFactor = VK_BLEND_FACTOR_ONE;
218 blendAttachmentState.dstAlphaBlendFactor = VK_BLEND_FACTOR_ONE;
219 blendAttachmentState.alphaBlendOp = VK_BLEND_OP_ADD;
220 blendAttachmentState.colorWriteMask = (VK_COLOR_COMPONENT_R_BIT | VK_COLOR_COMPONENT_G_BIT |
221 VK_COLOR_COMPONENT_B_BIT | VK_COLOR_COMPONENT_A_BIT);
222
223 VkPipelineColorBlendStateCreateInfo blendState;
224 blendState.sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO;
225 blendState.pNext = 0;
226 blendState.flags = 0;
227 blendState.logicOpEnable = VK_FALSE;
228 blendState.logicOp = VK_LOGIC_OP_CLEAR;
229 blendState.attachmentCount = 1;
230 blendState.pAttachments = &blendAttachmentState;
231 blendState.blendConstants[0] = 0.0f;
232 blendState.blendConstants[1] = 0.0f;
233 blendState.blendConstants[2] = 0.0f;
234 blendState.blendConstants[3] = 0.0f;
235
236 // TODO(jmadill): Dynamic state.
237 vk::RenderPass *renderPass = nullptr;
238 ANGLE_TRY_RESULT(vkFBO->getRenderPass(device), renderPass);
239 ASSERT(renderPass && renderPass->valid());
240
241 vk::PipelineLayout *pipelineLayout = nullptr;
242 ANGLE_TRY_RESULT(programVk->getPipelineLayout(device), pipelineLayout);
243 ASSERT(pipelineLayout && pipelineLayout->valid());
244
245 VkGraphicsPipelineCreateInfo pipelineInfo;
246 pipelineInfo.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO;
247 pipelineInfo.pNext = nullptr;
248 pipelineInfo.flags = 0;
249 pipelineInfo.stageCount = 2;
250 pipelineInfo.pStages = shaderStages;
251 pipelineInfo.pVertexInputState = &vertexInputState;
252 pipelineInfo.pInputAssemblyState = &inputAssemblyState;
253 pipelineInfo.pTessellationState = nullptr;
254 pipelineInfo.pViewportState = &viewportState;
255 pipelineInfo.pRasterizationState = &rasterState;
256 pipelineInfo.pMultisampleState = &multisampleState;
257 pipelineInfo.pDepthStencilState = nullptr;
258 pipelineInfo.pColorBlendState = &blendState;
259 pipelineInfo.pDynamicState = nullptr;
260 pipelineInfo.layout = pipelineLayout->getHandle();
261 pipelineInfo.renderPass = renderPass->getHandle();
262 pipelineInfo.subpass = 0;
263 pipelineInfo.basePipelineHandle = VK_NULL_HANDLE;
264 pipelineInfo.basePipelineIndex = 0;
265
Jamie Madill5deea722017-02-16 10:44:46 -0500266 vk::Pipeline newPipeline;
267 ANGLE_TRY(newPipeline.initGraphics(device, pipelineInfo));
Jamie Madilldf68a6f2017-01-13 17:29:53 -0500268
Jamie Madill5deea722017-02-16 10:44:46 -0500269 mCurrentPipeline.retain(device, std::move(newPipeline));
Jamie Madilldf68a6f2017-01-13 17:29:53 -0500270
271 vk::CommandBuffer *commandBuffer = mRenderer->getCommandBuffer();
272 ANGLE_TRY(vkFBO->beginRenderPass(device, commandBuffer, state));
273
274 commandBuffer->bindPipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, mCurrentPipeline);
275 commandBuffer->bindVertexBuffers(0, vertexHandles, vertexOffsets);
276 commandBuffer->draw(count, 1, first, 0);
277 commandBuffer->endRenderPass();
278 ANGLE_TRY(commandBuffer->end());
279
280 ANGLE_TRY(mRenderer->submitAndFinishCommandBuffer(*commandBuffer));
281
282 return gl::NoError();
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400283}
284
285gl::Error ContextVk::drawArraysInstanced(GLenum mode,
286 GLint first,
287 GLsizei count,
288 GLsizei instanceCount)
289{
290 UNIMPLEMENTED();
291 return gl::Error(GL_INVALID_OPERATION);
292}
293
294gl::Error ContextVk::drawElements(GLenum mode,
295 GLsizei count,
296 GLenum type,
297 const GLvoid *indices,
298 const gl::IndexRange &indexRange)
299{
300 UNIMPLEMENTED();
301 return gl::Error(GL_INVALID_OPERATION);
302}
303
304gl::Error ContextVk::drawElementsInstanced(GLenum mode,
305 GLsizei count,
306 GLenum type,
307 const GLvoid *indices,
308 GLsizei instances,
309 const gl::IndexRange &indexRange)
310{
311 UNIMPLEMENTED();
312 return gl::Error(GL_INVALID_OPERATION);
313}
314
315gl::Error ContextVk::drawRangeElements(GLenum mode,
316 GLuint start,
317 GLuint end,
318 GLsizei count,
319 GLenum type,
320 const GLvoid *indices,
321 const gl::IndexRange &indexRange)
322{
Jamie Madill7b57b9d2017-01-13 09:33:38 -0500323 return gl::NoError();
324}
325
326VkDevice ContextVk::getDevice() const
327{
328 return mRenderer->getDevice();
329}
330
331vk::CommandBuffer *ContextVk::getCommandBuffer()
332{
333 return mRenderer->getCommandBuffer();
334}
335
336vk::Error ContextVk::submitCommands(const vk::CommandBuffer &commandBuffer)
337{
338 // TODO(jmadill): Command queuing.
339 ANGLE_TRY(mRenderer->submitAndFinishCommandBuffer(commandBuffer));
340 return vk::NoError();
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400341}
342
Jiajia Qind9671222016-11-29 16:30:31 +0800343gl::Error ContextVk::drawArraysIndirect(GLenum mode, const GLvoid *indirect)
344{
345 UNIMPLEMENTED();
346 return gl::InternalError() << "DrawArraysIndirect hasn't been implemented for vulkan backend.";
347}
348
349gl::Error ContextVk::drawElementsIndirect(GLenum mode, GLenum type, const GLvoid *indirect)
350{
351 UNIMPLEMENTED();
352 return gl::InternalError()
353 << "DrawElementsIndirect hasn't been implemented for vulkan backend.";
354}
355
Corentin Wallez87fbe1c2016-08-03 14:41:42 -0400356GLenum ContextVk::getResetStatus()
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400357{
358 UNIMPLEMENTED();
Corentin Wallez87fbe1c2016-08-03 14:41:42 -0400359 return GL_NO_ERROR;
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400360}
361
362std::string ContextVk::getVendorString() const
363{
364 UNIMPLEMENTED();
365 return std::string();
366}
367
368std::string ContextVk::getRendererDescription() const
369{
Jamie Madille09bd5d2016-11-29 16:20:35 -0500370 return mRenderer->getRendererDescription();
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400371}
372
373void ContextVk::insertEventMarker(GLsizei length, const char *marker)
374{
375 UNIMPLEMENTED();
376}
377
378void ContextVk::pushGroupMarker(GLsizei length, const char *marker)
379{
380 UNIMPLEMENTED();
381}
382
383void ContextVk::popGroupMarker()
384{
385 UNIMPLEMENTED();
386}
387
Frank Henigman5a53d542017-02-16 21:24:10 -0500388void ContextVk::syncState(const gl::State::DirtyBits & /*dirtyBits*/)
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400389{
Jamie Madill7b57b9d2017-01-13 09:33:38 -0500390 // TODO(jmadill): Vulkan dirty bits.
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400391}
392
393GLint ContextVk::getGPUDisjoint()
394{
395 UNIMPLEMENTED();
396 return GLint();
397}
398
399GLint64 ContextVk::getTimestamp()
400{
401 UNIMPLEMENTED();
402 return GLint64();
403}
404
Jamie Madille09bd5d2016-11-29 16:20:35 -0500405void ContextVk::onMakeCurrent(const gl::ContextState & /*data*/)
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400406{
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400407}
408
409const gl::Caps &ContextVk::getNativeCaps() const
410{
Jamie Madillacccc6c2016-05-03 17:22:10 -0400411 return mRenderer->getNativeCaps();
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400412}
413
414const gl::TextureCapsMap &ContextVk::getNativeTextureCaps() const
415{
Jamie Madillacccc6c2016-05-03 17:22:10 -0400416 return mRenderer->getNativeTextureCaps();
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400417}
418
419const gl::Extensions &ContextVk::getNativeExtensions() const
420{
Jamie Madillacccc6c2016-05-03 17:22:10 -0400421 return mRenderer->getNativeExtensions();
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400422}
423
424const gl::Limitations &ContextVk::getNativeLimitations() const
425{
Jamie Madillacccc6c2016-05-03 17:22:10 -0400426 return mRenderer->getNativeLimitations();
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400427}
428
429CompilerImpl *ContextVk::createCompiler()
430{
Jamie Madillacccc6c2016-05-03 17:22:10 -0400431 return new CompilerVk();
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400432}
433
Jamie Madillacccc6c2016-05-03 17:22:10 -0400434ShaderImpl *ContextVk::createShader(const gl::ShaderState &state)
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400435{
Jamie Madillacccc6c2016-05-03 17:22:10 -0400436 return new ShaderVk(state);
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400437}
438
Jamie Madillacccc6c2016-05-03 17:22:10 -0400439ProgramImpl *ContextVk::createProgram(const gl::ProgramState &state)
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400440{
Jamie Madillacccc6c2016-05-03 17:22:10 -0400441 return new ProgramVk(state);
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400442}
443
Jamie Madillacccc6c2016-05-03 17:22:10 -0400444FramebufferImpl *ContextVk::createFramebuffer(const gl::FramebufferState &state)
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400445{
Jamie Madill7b57b9d2017-01-13 09:33:38 -0500446 return FramebufferVk::CreateUserFBO(state);
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400447}
448
449TextureImpl *ContextVk::createTexture(const gl::TextureState &state)
450{
Jamie Madillacccc6c2016-05-03 17:22:10 -0400451 return new TextureVk(state);
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400452}
453
454RenderbufferImpl *ContextVk::createRenderbuffer()
455{
Jamie Madillacccc6c2016-05-03 17:22:10 -0400456 return new RenderbufferVk();
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400457}
458
Jamie Madill8f775602016-11-03 16:45:34 -0400459BufferImpl *ContextVk::createBuffer(const gl::BufferState &state)
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400460{
Jamie Madill8f775602016-11-03 16:45:34 -0400461 return new BufferVk(state);
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400462}
463
Jamie Madillacccc6c2016-05-03 17:22:10 -0400464VertexArrayImpl *ContextVk::createVertexArray(const gl::VertexArrayState &state)
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400465{
Jamie Madillacccc6c2016-05-03 17:22:10 -0400466 return new VertexArrayVk(state);
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400467}
468
469QueryImpl *ContextVk::createQuery(GLenum type)
470{
Jamie Madillacccc6c2016-05-03 17:22:10 -0400471 return new QueryVk(type);
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400472}
473
474FenceNVImpl *ContextVk::createFenceNV()
475{
Jamie Madillacccc6c2016-05-03 17:22:10 -0400476 return new FenceNVVk();
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400477}
478
479FenceSyncImpl *ContextVk::createFenceSync()
480{
Jamie Madillacccc6c2016-05-03 17:22:10 -0400481 return new FenceSyncVk();
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400482}
483
Geoff Lang73bd2182016-07-15 13:01:24 -0400484TransformFeedbackImpl *ContextVk::createTransformFeedback(const gl::TransformFeedbackState &state)
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400485{
Geoff Lang73bd2182016-07-15 13:01:24 -0400486 return new TransformFeedbackVk(state);
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400487}
488
489SamplerImpl *ContextVk::createSampler()
490{
Jamie Madillacccc6c2016-05-03 17:22:10 -0400491 return new SamplerVk();
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400492}
493
Sami Väisänene45e53b2016-05-25 10:36:04 +0300494std::vector<PathImpl *> ContextVk::createPaths(GLsizei)
495{
496 return std::vector<PathImpl *>();
497}
498
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400499} // namespace rx