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 | |
| 12 | #include "common/debug.h" |
Jamie Madill | acccc6c | 2016-05-03 17:22:10 -0400 | [diff] [blame] | 13 | #include "libANGLE/renderer/vulkan/BufferVk.h" |
| 14 | #include "libANGLE/renderer/vulkan/CompilerVk.h" |
| 15 | #include "libANGLE/renderer/vulkan/ContextVk.h" |
| 16 | #include "libANGLE/renderer/vulkan/DeviceVk.h" |
| 17 | #include "libANGLE/renderer/vulkan/FenceNVVk.h" |
| 18 | #include "libANGLE/renderer/vulkan/FenceSyncVk.h" |
| 19 | #include "libANGLE/renderer/vulkan/FramebufferVk.h" |
| 20 | #include "libANGLE/renderer/vulkan/ImageVk.h" |
| 21 | #include "libANGLE/renderer/vulkan/ProgramVk.h" |
| 22 | #include "libANGLE/renderer/vulkan/QueryVk.h" |
| 23 | #include "libANGLE/renderer/vulkan/RenderbufferVk.h" |
| 24 | #include "libANGLE/renderer/vulkan/RendererVk.h" |
| 25 | #include "libANGLE/renderer/vulkan/SamplerVk.h" |
| 26 | #include "libANGLE/renderer/vulkan/ShaderVk.h" |
| 27 | #include "libANGLE/renderer/vulkan/TextureVk.h" |
| 28 | #include "libANGLE/renderer/vulkan/TransformFeedbackVk.h" |
| 29 | #include "libANGLE/renderer/vulkan/VertexArrayVk.h" |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 30 | |
| 31 | namespace rx |
| 32 | { |
| 33 | |
Jamie Madill | acccc6c | 2016-05-03 17:22:10 -0400 | [diff] [blame] | 34 | ContextVk::ContextVk(const gl::ContextState &state, RendererVk *renderer) |
| 35 | : ContextImpl(state), mRenderer(renderer) |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 36 | { |
| 37 | } |
| 38 | |
| 39 | ContextVk::~ContextVk() |
| 40 | { |
| 41 | } |
| 42 | |
| 43 | gl::Error ContextVk::initialize() |
| 44 | { |
| 45 | UNIMPLEMENTED(); |
| 46 | return gl::Error(GL_INVALID_OPERATION); |
| 47 | } |
| 48 | |
| 49 | gl::Error ContextVk::flush() |
| 50 | { |
| 51 | UNIMPLEMENTED(); |
| 52 | return gl::Error(GL_INVALID_OPERATION); |
| 53 | } |
| 54 | |
| 55 | gl::Error ContextVk::finish() |
| 56 | { |
| 57 | UNIMPLEMENTED(); |
| 58 | return gl::Error(GL_INVALID_OPERATION); |
| 59 | } |
| 60 | |
| 61 | gl::Error ContextVk::drawArrays(GLenum mode, GLint first, GLsizei count) |
| 62 | { |
| 63 | UNIMPLEMENTED(); |
| 64 | return gl::Error(GL_INVALID_OPERATION); |
| 65 | } |
| 66 | |
| 67 | gl::Error ContextVk::drawArraysInstanced(GLenum mode, |
| 68 | GLint first, |
| 69 | GLsizei count, |
| 70 | GLsizei instanceCount) |
| 71 | { |
| 72 | UNIMPLEMENTED(); |
| 73 | return gl::Error(GL_INVALID_OPERATION); |
| 74 | } |
| 75 | |
| 76 | gl::Error ContextVk::drawElements(GLenum mode, |
| 77 | GLsizei count, |
| 78 | GLenum type, |
| 79 | const GLvoid *indices, |
| 80 | const gl::IndexRange &indexRange) |
| 81 | { |
| 82 | UNIMPLEMENTED(); |
| 83 | return gl::Error(GL_INVALID_OPERATION); |
| 84 | } |
| 85 | |
| 86 | gl::Error ContextVk::drawElementsInstanced(GLenum mode, |
| 87 | GLsizei count, |
| 88 | GLenum type, |
| 89 | const GLvoid *indices, |
| 90 | GLsizei instances, |
| 91 | const gl::IndexRange &indexRange) |
| 92 | { |
| 93 | UNIMPLEMENTED(); |
| 94 | return gl::Error(GL_INVALID_OPERATION); |
| 95 | } |
| 96 | |
| 97 | gl::Error ContextVk::drawRangeElements(GLenum mode, |
| 98 | GLuint start, |
| 99 | GLuint end, |
| 100 | GLsizei count, |
| 101 | GLenum type, |
| 102 | const GLvoid *indices, |
| 103 | const gl::IndexRange &indexRange) |
| 104 | { |
| 105 | UNIMPLEMENTED(); |
| 106 | return gl::Error(GL_INVALID_OPERATION); |
| 107 | } |
| 108 | |
| 109 | void ContextVk::notifyDeviceLost() |
| 110 | { |
| 111 | UNIMPLEMENTED(); |
| 112 | } |
| 113 | |
| 114 | bool ContextVk::isDeviceLost() const |
| 115 | { |
| 116 | UNIMPLEMENTED(); |
| 117 | return bool(); |
| 118 | } |
| 119 | |
| 120 | bool ContextVk::testDeviceLost() |
| 121 | { |
| 122 | UNIMPLEMENTED(); |
| 123 | return bool(); |
| 124 | } |
| 125 | |
| 126 | bool ContextVk::testDeviceResettable() |
| 127 | { |
| 128 | UNIMPLEMENTED(); |
| 129 | return bool(); |
| 130 | } |
| 131 | |
| 132 | std::string ContextVk::getVendorString() const |
| 133 | { |
| 134 | UNIMPLEMENTED(); |
| 135 | return std::string(); |
| 136 | } |
| 137 | |
| 138 | std::string ContextVk::getRendererDescription() const |
| 139 | { |
| 140 | UNIMPLEMENTED(); |
| 141 | return std::string(); |
| 142 | } |
| 143 | |
| 144 | void ContextVk::insertEventMarker(GLsizei length, const char *marker) |
| 145 | { |
| 146 | UNIMPLEMENTED(); |
| 147 | } |
| 148 | |
| 149 | void ContextVk::pushGroupMarker(GLsizei length, const char *marker) |
| 150 | { |
| 151 | UNIMPLEMENTED(); |
| 152 | } |
| 153 | |
| 154 | void ContextVk::popGroupMarker() |
| 155 | { |
| 156 | UNIMPLEMENTED(); |
| 157 | } |
| 158 | |
| 159 | void ContextVk::syncState(const gl::State &state, const gl::State::DirtyBits &dirtyBits) |
| 160 | { |
| 161 | UNIMPLEMENTED(); |
| 162 | } |
| 163 | |
| 164 | GLint ContextVk::getGPUDisjoint() |
| 165 | { |
| 166 | UNIMPLEMENTED(); |
| 167 | return GLint(); |
| 168 | } |
| 169 | |
| 170 | GLint64 ContextVk::getTimestamp() |
| 171 | { |
| 172 | UNIMPLEMENTED(); |
| 173 | return GLint64(); |
| 174 | } |
| 175 | |
| 176 | void ContextVk::onMakeCurrent(const gl::ContextState &data) |
| 177 | { |
| 178 | UNIMPLEMENTED(); |
| 179 | } |
| 180 | |
| 181 | const gl::Caps &ContextVk::getNativeCaps() const |
| 182 | { |
Jamie Madill | acccc6c | 2016-05-03 17:22:10 -0400 | [diff] [blame] | 183 | return mRenderer->getNativeCaps(); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 184 | } |
| 185 | |
| 186 | const gl::TextureCapsMap &ContextVk::getNativeTextureCaps() const |
| 187 | { |
Jamie Madill | acccc6c | 2016-05-03 17:22:10 -0400 | [diff] [blame] | 188 | return mRenderer->getNativeTextureCaps(); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 189 | } |
| 190 | |
| 191 | const gl::Extensions &ContextVk::getNativeExtensions() const |
| 192 | { |
Jamie Madill | acccc6c | 2016-05-03 17:22:10 -0400 | [diff] [blame] | 193 | return mRenderer->getNativeExtensions(); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 194 | } |
| 195 | |
| 196 | const gl::Limitations &ContextVk::getNativeLimitations() const |
| 197 | { |
Jamie Madill | acccc6c | 2016-05-03 17:22:10 -0400 | [diff] [blame] | 198 | return mRenderer->getNativeLimitations(); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 199 | } |
| 200 | |
| 201 | CompilerImpl *ContextVk::createCompiler() |
| 202 | { |
Jamie Madill | acccc6c | 2016-05-03 17:22:10 -0400 | [diff] [blame] | 203 | return new CompilerVk(); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 204 | } |
| 205 | |
Jamie Madill | acccc6c | 2016-05-03 17:22:10 -0400 | [diff] [blame] | 206 | ShaderImpl *ContextVk::createShader(const gl::ShaderState &state) |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 207 | { |
Jamie Madill | acccc6c | 2016-05-03 17:22:10 -0400 | [diff] [blame] | 208 | return new ShaderVk(state); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 209 | } |
| 210 | |
Jamie Madill | acccc6c | 2016-05-03 17:22:10 -0400 | [diff] [blame] | 211 | ProgramImpl *ContextVk::createProgram(const gl::ProgramState &state) |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 212 | { |
Jamie Madill | acccc6c | 2016-05-03 17:22:10 -0400 | [diff] [blame] | 213 | return new ProgramVk(state); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 214 | } |
| 215 | |
Jamie Madill | acccc6c | 2016-05-03 17:22:10 -0400 | [diff] [blame] | 216 | FramebufferImpl *ContextVk::createFramebuffer(const gl::FramebufferState &state) |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 217 | { |
Jamie Madill | acccc6c | 2016-05-03 17:22:10 -0400 | [diff] [blame] | 218 | return new FramebufferVk(state); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 219 | } |
| 220 | |
| 221 | TextureImpl *ContextVk::createTexture(const gl::TextureState &state) |
| 222 | { |
Jamie Madill | acccc6c | 2016-05-03 17:22:10 -0400 | [diff] [blame] | 223 | return new TextureVk(state); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 224 | } |
| 225 | |
| 226 | RenderbufferImpl *ContextVk::createRenderbuffer() |
| 227 | { |
Jamie Madill | acccc6c | 2016-05-03 17:22:10 -0400 | [diff] [blame] | 228 | return new RenderbufferVk(); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 229 | } |
| 230 | |
| 231 | BufferImpl *ContextVk::createBuffer() |
| 232 | { |
Jamie Madill | acccc6c | 2016-05-03 17:22:10 -0400 | [diff] [blame] | 233 | return new BufferVk(); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 234 | } |
| 235 | |
Jamie Madill | acccc6c | 2016-05-03 17:22:10 -0400 | [diff] [blame] | 236 | VertexArrayImpl *ContextVk::createVertexArray(const gl::VertexArrayState &state) |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 237 | { |
Jamie Madill | acccc6c | 2016-05-03 17:22:10 -0400 | [diff] [blame] | 238 | return new VertexArrayVk(state); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 239 | } |
| 240 | |
| 241 | QueryImpl *ContextVk::createQuery(GLenum type) |
| 242 | { |
Jamie Madill | acccc6c | 2016-05-03 17:22:10 -0400 | [diff] [blame] | 243 | return new QueryVk(type); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 244 | } |
| 245 | |
| 246 | FenceNVImpl *ContextVk::createFenceNV() |
| 247 | { |
Jamie Madill | acccc6c | 2016-05-03 17:22:10 -0400 | [diff] [blame] | 248 | return new FenceNVVk(); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 249 | } |
| 250 | |
| 251 | FenceSyncImpl *ContextVk::createFenceSync() |
| 252 | { |
Jamie Madill | acccc6c | 2016-05-03 17:22:10 -0400 | [diff] [blame] | 253 | return new FenceSyncVk(); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 254 | } |
| 255 | |
| 256 | TransformFeedbackImpl *ContextVk::createTransformFeedback() |
| 257 | { |
Jamie Madill | acccc6c | 2016-05-03 17:22:10 -0400 | [diff] [blame] | 258 | return new TransformFeedbackVk(); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 259 | } |
| 260 | |
| 261 | SamplerImpl *ContextVk::createSampler() |
| 262 | { |
Jamie Madill | acccc6c | 2016-05-03 17:22:10 -0400 | [diff] [blame] | 263 | return new SamplerVk(); |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 264 | } |
| 265 | |
Sami Väisänen | e45e53b | 2016-05-25 10:36:04 +0300 | [diff] [blame^] | 266 | std::vector<PathImpl *> ContextVk::createPaths(GLsizei) |
| 267 | { |
| 268 | return std::vector<PathImpl *>(); |
| 269 | } |
| 270 | |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 271 | } // namespace rx |