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