Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -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 | // ContextNULL.cpp: |
| 7 | // Implements the class methods for ContextNULL. |
| 8 | // |
| 9 | |
| 10 | #include "libANGLE/renderer/null/ContextNULL.h" |
| 11 | |
| 12 | #include "common/debug.h" |
| 13 | |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 14 | #include "libANGLE/renderer/null/BufferNULL.h" |
| 15 | #include "libANGLE/renderer/null/CompilerNULL.h" |
| 16 | #include "libANGLE/renderer/null/DisplayNULL.h" |
| 17 | #include "libANGLE/renderer/null/FenceNVNULL.h" |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 18 | #include "libANGLE/renderer/null/FramebufferNULL.h" |
| 19 | #include "libANGLE/renderer/null/ImageNULL.h" |
| 20 | #include "libANGLE/renderer/null/PathNULL.h" |
| 21 | #include "libANGLE/renderer/null/ProgramNULL.h" |
Yunchao He | a336b90 | 2017-08-02 16:05:21 +0800 | [diff] [blame] | 22 | #include "libANGLE/renderer/null/ProgramPipelineNULL.h" |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 23 | #include "libANGLE/renderer/null/QueryNULL.h" |
| 24 | #include "libANGLE/renderer/null/RenderbufferNULL.h" |
| 25 | #include "libANGLE/renderer/null/SamplerNULL.h" |
| 26 | #include "libANGLE/renderer/null/ShaderNULL.h" |
Jamie Madill | 70b5bb0 | 2017-08-28 13:32:37 -0400 | [diff] [blame] | 27 | #include "libANGLE/renderer/null/SyncNULL.h" |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 28 | #include "libANGLE/renderer/null/TextureNULL.h" |
| 29 | #include "libANGLE/renderer/null/TransformFeedbackNULL.h" |
| 30 | #include "libANGLE/renderer/null/VertexArrayNULL.h" |
| 31 | |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 32 | namespace rx |
| 33 | { |
| 34 | |
Geoff Lang | 1b60d8d | 2017-02-10 14:56:55 -0500 | [diff] [blame] | 35 | AllocationTrackerNULL::AllocationTrackerNULL(size_t maxTotalAllocationSize) |
| 36 | : mAllocatedBytes(0), mMaxBytes(maxTotalAllocationSize) |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 37 | { |
Geoff Lang | 1b60d8d | 2017-02-10 14:56:55 -0500 | [diff] [blame] | 38 | } |
| 39 | |
| 40 | AllocationTrackerNULL::~AllocationTrackerNULL() |
| 41 | { |
| 42 | // ASSERT that all objects with the NULL renderer clean up after themselves |
| 43 | ASSERT(mAllocatedBytes == 0); |
| 44 | } |
| 45 | |
| 46 | bool AllocationTrackerNULL::updateMemoryAllocation(size_t oldSize, size_t newSize) |
| 47 | { |
| 48 | ASSERT(mAllocatedBytes >= oldSize); |
| 49 | |
| 50 | size_t sizeAfterRelease = mAllocatedBytes - oldSize; |
| 51 | size_t sizeAfterReallocate = sizeAfterRelease + newSize; |
| 52 | if (sizeAfterReallocate < sizeAfterRelease || sizeAfterReallocate > mMaxBytes) |
| 53 | { |
| 54 | // Overflow or allocation would be too large |
| 55 | return false; |
| 56 | } |
| 57 | |
| 58 | mAllocatedBytes = sizeAfterReallocate; |
| 59 | return true; |
| 60 | } |
| 61 | |
| 62 | ContextNULL::ContextNULL(const gl::ContextState &state, AllocationTrackerNULL *allocationTracker) |
| 63 | : ContextImpl(state), mAllocationTracker(allocationTracker) |
| 64 | { |
| 65 | ASSERT(mAllocationTracker != nullptr); |
| 66 | |
Jamie Madill | 493f957 | 2018-05-24 19:52:15 -0400 | [diff] [blame] | 67 | mExtensions = gl::Extensions(); |
| 68 | mExtensions.fence = true; |
| 69 | mExtensions.instancedArrays = true; |
| 70 | mExtensions.pixelBufferObject = true; |
| 71 | mExtensions.mapBuffer = true; |
| 72 | mExtensions.mapBufferRange = true; |
| 73 | mExtensions.copyTexture = true; |
| 74 | mExtensions.copyCompressedTexture = true; |
| 75 | mExtensions.textureRectangle = true; |
Geoff Lang | 73dcc60 | 2017-11-08 16:41:52 -0500 | [diff] [blame] | 76 | mExtensions.textureUsage = true; |
| 77 | mExtensions.vertexArrayObject = true; |
| 78 | mExtensions.debugMarker = true; |
| 79 | mExtensions.translatedShaderSource = true; |
Geoff Lang | 1e031b2 | 2017-02-10 15:01:28 -0500 | [diff] [blame] | 80 | |
Geoff Lang | d54d304 | 2017-11-07 14:56:07 -0500 | [diff] [blame] | 81 | mExtensions.textureStorage = true; |
Jamie Madill | 493f957 | 2018-05-24 19:52:15 -0400 | [diff] [blame] | 82 | mExtensions.rgb8rgba8 = true; |
Geoff Lang | 86f8116 | 2017-10-30 15:10:45 -0400 | [diff] [blame] | 83 | mExtensions.textureCompressionDXT1 = true; |
| 84 | mExtensions.textureCompressionDXT3 = true; |
| 85 | mExtensions.textureCompressionDXT5 = true; |
| 86 | mExtensions.textureCompressionS3TCsRGB = true; |
| 87 | mExtensions.textureCompressionASTCHDR = true; |
| 88 | mExtensions.textureCompressionASTCLDR = true; |
| 89 | mExtensions.compressedETC1RGB8Texture = true; |
| 90 | mExtensions.lossyETCDecode = true; |
Jiawei Shao | 361df07 | 2017-11-22 09:33:59 +0800 | [diff] [blame] | 91 | mExtensions.geometryShader = true; |
Geoff Lang | d84a00b | 2017-10-27 17:27:26 -0400 | [diff] [blame] | 92 | |
Geoff Lang | 025aafd | 2017-10-30 15:16:37 -0400 | [diff] [blame] | 93 | mExtensions.eglImage = true; |
| 94 | mExtensions.eglImageExternal = true; |
| 95 | mExtensions.eglImageExternalEssl3 = true; |
| 96 | mExtensions.eglStreamConsumerExternal = true; |
| 97 | |
Geoff Lang | 4751aab | 2017-10-30 15:14:52 -0400 | [diff] [blame] | 98 | const gl::Version maxClientVersion(3, 1); |
| 99 | mCaps = GenerateMinimumCaps(maxClientVersion, mExtensions); |
| 100 | |
Jamie Madill | 7b62cf9 | 2017-11-02 15:20:49 -0400 | [diff] [blame] | 101 | InitMinimumTextureCapsMap(maxClientVersion, mExtensions, &mTextureCaps); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 102 | } |
| 103 | |
| 104 | ContextNULL::~ContextNULL() |
| 105 | { |
| 106 | } |
| 107 | |
| 108 | gl::Error ContextNULL::initialize() |
| 109 | { |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 110 | return gl::NoError(); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 111 | } |
| 112 | |
Jamie Madill | afa02a2 | 2017-11-23 12:57:38 -0500 | [diff] [blame] | 113 | gl::Error ContextNULL::flush(const gl::Context *context) |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 114 | { |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 115 | return gl::NoError(); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 116 | } |
| 117 | |
Jamie Madill | afa02a2 | 2017-11-23 12:57:38 -0500 | [diff] [blame] | 118 | gl::Error ContextNULL::finish(const gl::Context *context) |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 119 | { |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 120 | return gl::NoError(); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 121 | } |
| 122 | |
Jamie Madill | c564c07 | 2017-06-01 12:45:42 -0400 | [diff] [blame] | 123 | gl::Error ContextNULL::drawArrays(const gl::Context *context, |
Jamie Madill | 493f957 | 2018-05-24 19:52:15 -0400 | [diff] [blame] | 124 | gl::PrimitiveMode mode, |
Jamie Madill | c564c07 | 2017-06-01 12:45:42 -0400 | [diff] [blame] | 125 | GLint first, |
| 126 | GLsizei count) |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 127 | { |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 128 | return gl::NoError(); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 129 | } |
| 130 | |
Jamie Madill | c564c07 | 2017-06-01 12:45:42 -0400 | [diff] [blame] | 131 | gl::Error ContextNULL::drawArraysInstanced(const gl::Context *context, |
Jamie Madill | 493f957 | 2018-05-24 19:52:15 -0400 | [diff] [blame] | 132 | gl::PrimitiveMode mode, |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 133 | GLint first, |
| 134 | GLsizei count, |
| 135 | GLsizei instanceCount) |
| 136 | { |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 137 | return gl::NoError(); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 138 | } |
| 139 | |
Jamie Madill | c564c07 | 2017-06-01 12:45:42 -0400 | [diff] [blame] | 140 | gl::Error ContextNULL::drawElements(const gl::Context *context, |
Jamie Madill | 493f957 | 2018-05-24 19:52:15 -0400 | [diff] [blame] | 141 | gl::PrimitiveMode mode, |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 142 | GLsizei count, |
| 143 | GLenum type, |
Qin Jiajia | 1da0065 | 2017-06-20 17:16:25 +0800 | [diff] [blame] | 144 | const void *indices) |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 145 | { |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 146 | return gl::NoError(); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 147 | } |
| 148 | |
Jamie Madill | c564c07 | 2017-06-01 12:45:42 -0400 | [diff] [blame] | 149 | gl::Error ContextNULL::drawElementsInstanced(const gl::Context *context, |
Jamie Madill | 493f957 | 2018-05-24 19:52:15 -0400 | [diff] [blame] | 150 | gl::PrimitiveMode mode, |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 151 | GLsizei count, |
| 152 | GLenum type, |
Jamie Madill | 876429b | 2017-04-20 15:46:24 -0400 | [diff] [blame] | 153 | const void *indices, |
Qin Jiajia | 1da0065 | 2017-06-20 17:16:25 +0800 | [diff] [blame] | 154 | GLsizei instances) |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 155 | { |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 156 | return gl::NoError(); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 157 | } |
| 158 | |
Jamie Madill | c564c07 | 2017-06-01 12:45:42 -0400 | [diff] [blame] | 159 | gl::Error ContextNULL::drawRangeElements(const gl::Context *context, |
Jamie Madill | 493f957 | 2018-05-24 19:52:15 -0400 | [diff] [blame] | 160 | gl::PrimitiveMode mode, |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 161 | GLuint start, |
| 162 | GLuint end, |
| 163 | GLsizei count, |
| 164 | GLenum type, |
Qin Jiajia | 1da0065 | 2017-06-20 17:16:25 +0800 | [diff] [blame] | 165 | const void *indices) |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 166 | { |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 167 | return gl::NoError(); |
| 168 | } |
| 169 | |
Jamie Madill | c564c07 | 2017-06-01 12:45:42 -0400 | [diff] [blame] | 170 | gl::Error ContextNULL::drawArraysIndirect(const gl::Context *context, |
Jamie Madill | 493f957 | 2018-05-24 19:52:15 -0400 | [diff] [blame] | 171 | gl::PrimitiveMode mode, |
Jamie Madill | c564c07 | 2017-06-01 12:45:42 -0400 | [diff] [blame] | 172 | const void *indirect) |
Jiajia Qin | d967122 | 2016-11-29 16:30:31 +0800 | [diff] [blame] | 173 | { |
| 174 | return gl::NoError(); |
| 175 | } |
| 176 | |
Jamie Madill | c564c07 | 2017-06-01 12:45:42 -0400 | [diff] [blame] | 177 | gl::Error ContextNULL::drawElementsIndirect(const gl::Context *context, |
Jamie Madill | 493f957 | 2018-05-24 19:52:15 -0400 | [diff] [blame] | 178 | gl::PrimitiveMode mode, |
Jamie Madill | c564c07 | 2017-06-01 12:45:42 -0400 | [diff] [blame] | 179 | GLenum type, |
| 180 | const void *indirect) |
Jiajia Qin | d967122 | 2016-11-29 16:30:31 +0800 | [diff] [blame] | 181 | { |
| 182 | return gl::NoError(); |
| 183 | } |
| 184 | |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 185 | void ContextNULL::stencilFillPath(const gl::Path *path, GLenum fillMode, GLuint mask) |
| 186 | { |
| 187 | } |
| 188 | |
| 189 | void ContextNULL::stencilStrokePath(const gl::Path *path, GLint reference, GLuint mask) |
| 190 | { |
| 191 | } |
| 192 | |
| 193 | void ContextNULL::coverFillPath(const gl::Path *path, GLenum coverMode) |
| 194 | { |
| 195 | } |
| 196 | |
| 197 | void ContextNULL::coverStrokePath(const gl::Path *path, GLenum coverMode) |
| 198 | { |
| 199 | } |
| 200 | |
| 201 | void ContextNULL::stencilThenCoverFillPath(const gl::Path *path, |
| 202 | GLenum fillMode, |
| 203 | GLuint mask, |
| 204 | GLenum coverMode) |
| 205 | { |
| 206 | } |
| 207 | |
| 208 | void ContextNULL::stencilThenCoverStrokePath(const gl::Path *path, |
| 209 | GLint reference, |
| 210 | GLuint mask, |
| 211 | GLenum coverMode) |
| 212 | { |
| 213 | } |
| 214 | |
| 215 | void ContextNULL::coverFillPathInstanced(const std::vector<gl::Path *> &paths, |
| 216 | GLenum coverMode, |
| 217 | GLenum transformType, |
| 218 | const GLfloat *transformValues) |
| 219 | { |
| 220 | } |
| 221 | |
| 222 | void ContextNULL::coverStrokePathInstanced(const std::vector<gl::Path *> &paths, |
| 223 | GLenum coverMode, |
| 224 | GLenum transformType, |
| 225 | const GLfloat *transformValues) |
| 226 | { |
| 227 | } |
| 228 | |
| 229 | void ContextNULL::stencilFillPathInstanced(const std::vector<gl::Path *> &paths, |
| 230 | GLenum fillMode, |
| 231 | GLuint mask, |
| 232 | GLenum transformType, |
| 233 | const GLfloat *transformValues) |
| 234 | { |
| 235 | } |
| 236 | |
| 237 | void ContextNULL::stencilStrokePathInstanced(const std::vector<gl::Path *> &paths, |
| 238 | GLint reference, |
| 239 | GLuint mask, |
| 240 | GLenum transformType, |
| 241 | const GLfloat *transformValues) |
| 242 | { |
| 243 | } |
| 244 | |
| 245 | void ContextNULL::stencilThenCoverFillPathInstanced(const std::vector<gl::Path *> &paths, |
| 246 | GLenum coverMode, |
| 247 | GLenum fillMode, |
| 248 | GLuint mask, |
| 249 | GLenum transformType, |
| 250 | const GLfloat *transformValues) |
| 251 | { |
| 252 | } |
| 253 | |
| 254 | void ContextNULL::stencilThenCoverStrokePathInstanced(const std::vector<gl::Path *> &paths, |
| 255 | GLenum coverMode, |
| 256 | GLint reference, |
| 257 | GLuint mask, |
| 258 | GLenum transformType, |
| 259 | const GLfloat *transformValues) |
| 260 | { |
| 261 | } |
| 262 | |
| 263 | GLenum ContextNULL::getResetStatus() |
| 264 | { |
| 265 | return GL_NO_ERROR; |
| 266 | } |
| 267 | |
| 268 | std::string ContextNULL::getVendorString() const |
| 269 | { |
| 270 | return "NULL"; |
| 271 | } |
| 272 | |
| 273 | std::string ContextNULL::getRendererDescription() const |
| 274 | { |
| 275 | return "NULL"; |
| 276 | } |
| 277 | |
| 278 | void ContextNULL::insertEventMarker(GLsizei length, const char *marker) |
| 279 | { |
| 280 | } |
| 281 | |
| 282 | void ContextNULL::pushGroupMarker(GLsizei length, const char *marker) |
| 283 | { |
| 284 | } |
| 285 | |
| 286 | void ContextNULL::popGroupMarker() |
| 287 | { |
| 288 | } |
| 289 | |
Geoff Lang | 5d5253a | 2017-11-22 14:51:12 -0500 | [diff] [blame] | 290 | void ContextNULL::pushDebugGroup(GLenum source, GLuint id, GLsizei length, const char *message) |
| 291 | { |
| 292 | } |
| 293 | |
| 294 | void ContextNULL::popDebugGroup() |
| 295 | { |
| 296 | } |
| 297 | |
Jamie Madill | 189ad87 | 2018-07-09 13:32:37 -0400 | [diff] [blame^] | 298 | gl::Error ContextNULL::syncState(const gl::Context *context, const gl::State::DirtyBits &dirtyBits) |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 299 | { |
Jamie Madill | 189ad87 | 2018-07-09 13:32:37 -0400 | [diff] [blame^] | 300 | return gl::NoError(); |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 301 | } |
| 302 | |
| 303 | GLint ContextNULL::getGPUDisjoint() |
| 304 | { |
| 305 | return 0; |
| 306 | } |
| 307 | |
| 308 | GLint64 ContextNULL::getTimestamp() |
| 309 | { |
| 310 | return 0; |
| 311 | } |
| 312 | |
Jamie Madill | 4928b7c | 2017-06-20 12:57:39 -0400 | [diff] [blame] | 313 | void ContextNULL::onMakeCurrent(const gl::Context *context) |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 314 | { |
| 315 | } |
| 316 | |
Jiawei Shao | d0a7d10 | 2018-05-07 12:40:20 +0800 | [diff] [blame] | 317 | gl::Caps ContextNULL::getNativeCaps() const |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 318 | { |
| 319 | return mCaps; |
| 320 | } |
| 321 | |
| 322 | const gl::TextureCapsMap &ContextNULL::getNativeTextureCaps() const |
| 323 | { |
| 324 | return mTextureCaps; |
| 325 | } |
| 326 | |
| 327 | const gl::Extensions &ContextNULL::getNativeExtensions() const |
| 328 | { |
| 329 | return mExtensions; |
| 330 | } |
| 331 | |
| 332 | const gl::Limitations &ContextNULL::getNativeLimitations() const |
| 333 | { |
| 334 | return mLimitations; |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 335 | } |
| 336 | |
| 337 | CompilerImpl *ContextNULL::createCompiler() |
| 338 | { |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 339 | return new CompilerNULL(); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 340 | } |
| 341 | |
| 342 | ShaderImpl *ContextNULL::createShader(const gl::ShaderState &data) |
| 343 | { |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 344 | return new ShaderNULL(data); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 345 | } |
| 346 | |
| 347 | ProgramImpl *ContextNULL::createProgram(const gl::ProgramState &data) |
| 348 | { |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 349 | return new ProgramNULL(data); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 350 | } |
| 351 | |
| 352 | FramebufferImpl *ContextNULL::createFramebuffer(const gl::FramebufferState &data) |
| 353 | { |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 354 | return new FramebufferNULL(data); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 355 | } |
| 356 | |
| 357 | TextureImpl *ContextNULL::createTexture(const gl::TextureState &state) |
| 358 | { |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 359 | return new TextureNULL(state); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 360 | } |
| 361 | |
Jamie Madill | e703c60 | 2018-02-20 10:21:48 -0500 | [diff] [blame] | 362 | RenderbufferImpl *ContextNULL::createRenderbuffer(const gl::RenderbufferState &state) |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 363 | { |
Jamie Madill | e703c60 | 2018-02-20 10:21:48 -0500 | [diff] [blame] | 364 | return new RenderbufferNULL(state); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 365 | } |
| 366 | |
Jamie Madill | 8f77560 | 2016-11-03 16:45:34 -0400 | [diff] [blame] | 367 | BufferImpl *ContextNULL::createBuffer(const gl::BufferState &state) |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 368 | { |
Geoff Lang | 1b60d8d | 2017-02-10 14:56:55 -0500 | [diff] [blame] | 369 | return new BufferNULL(state, mAllocationTracker); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 370 | } |
| 371 | |
| 372 | VertexArrayImpl *ContextNULL::createVertexArray(const gl::VertexArrayState &data) |
| 373 | { |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 374 | return new VertexArrayNULL(data); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 375 | } |
| 376 | |
Corentin Wallez | ad3ae90 | 2018-03-09 13:40:42 -0500 | [diff] [blame] | 377 | QueryImpl *ContextNULL::createQuery(gl::QueryType type) |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 378 | { |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 379 | return new QueryNULL(type); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 380 | } |
| 381 | |
| 382 | FenceNVImpl *ContextNULL::createFenceNV() |
| 383 | { |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 384 | return new FenceNVNULL(); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 385 | } |
| 386 | |
Jamie Madill | 70b5bb0 | 2017-08-28 13:32:37 -0400 | [diff] [blame] | 387 | SyncImpl *ContextNULL::createSync() |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 388 | { |
Jamie Madill | 70b5bb0 | 2017-08-28 13:32:37 -0400 | [diff] [blame] | 389 | return new SyncNULL(); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 390 | } |
| 391 | |
| 392 | TransformFeedbackImpl *ContextNULL::createTransformFeedback(const gl::TransformFeedbackState &state) |
| 393 | { |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 394 | return new TransformFeedbackNULL(state); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 395 | } |
| 396 | |
Jamie Madill | 06ef36b | 2017-09-09 23:32:46 -0400 | [diff] [blame] | 397 | SamplerImpl *ContextNULL::createSampler(const gl::SamplerState &state) |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 398 | { |
Jamie Madill | 06ef36b | 2017-09-09 23:32:46 -0400 | [diff] [blame] | 399 | return new SamplerNULL(state); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 400 | } |
| 401 | |
Yunchao He | a336b90 | 2017-08-02 16:05:21 +0800 | [diff] [blame] | 402 | ProgramPipelineImpl *ContextNULL::createProgramPipeline(const gl::ProgramPipelineState &state) |
| 403 | { |
| 404 | return new ProgramPipelineNULL(state); |
| 405 | } |
| 406 | |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 407 | std::vector<PathImpl *> ContextNULL::createPaths(GLsizei range) |
| 408 | { |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 409 | std::vector<PathImpl *> result(range); |
| 410 | for (GLsizei idx = 0; idx < range; idx++) |
| 411 | { |
| 412 | result[idx] = new PathNULL(); |
| 413 | } |
| 414 | return result; |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 415 | } |
| 416 | |
Jamie Madill | fe54834 | 2017-06-19 11:13:24 -0400 | [diff] [blame] | 417 | gl::Error ContextNULL::dispatchCompute(const gl::Context *context, |
| 418 | GLuint numGroupsX, |
| 419 | GLuint numGroupsY, |
| 420 | GLuint numGroupsZ) |
Xinghua Cao | 2b39659 | 2017-03-29 15:36:04 +0800 | [diff] [blame] | 421 | { |
| 422 | return gl::NoError(); |
| 423 | } |
| 424 | |
Qin Jiajia | 62fcf62 | 2017-11-30 16:16:12 +0800 | [diff] [blame] | 425 | gl::Error ContextNULL::dispatchComputeIndirect(const gl::Context *context, GLintptr indirect) |
| 426 | { |
| 427 | return gl::NoError(); |
| 428 | } |
| 429 | |
Xinghua Cao | 89c422a | 2017-11-29 18:24:20 +0800 | [diff] [blame] | 430 | gl::Error ContextNULL::memoryBarrier(const gl::Context *context, GLbitfield barriers) |
| 431 | { |
| 432 | return gl::NoError(); |
| 433 | } |
| 434 | |
| 435 | gl::Error ContextNULL::memoryBarrierByRegion(const gl::Context *context, GLbitfield barriers) |
| 436 | { |
| 437 | return gl::NoError(); |
| 438 | } |
| 439 | |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 440 | } // namespace rx |