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) |
Jamie Madill | b980c56 | 2018-11-27 11:34:27 -0500 | [diff] [blame] | 38 | {} |
Geoff Lang | 1b60d8d | 2017-02-10 14:56:55 -0500 | [diff] [blame] | 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 | |
Jamie Madill | b980c56 | 2018-11-27 11:34:27 -0500 | [diff] [blame] | 104 | ContextNULL::~ContextNULL() {} |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 105 | |
Jamie Madill | 32643ce | 2018-10-19 11:38:03 -0400 | [diff] [blame] | 106 | angle::Result ContextNULL::initialize() |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 107 | { |
Jamie Madill | 32643ce | 2018-10-19 11:38:03 -0400 | [diff] [blame] | 108 | return angle::Result::Continue(); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 109 | } |
| 110 | |
Jamie Madill | 32643ce | 2018-10-19 11:38:03 -0400 | [diff] [blame] | 111 | angle::Result ContextNULL::flush(const gl::Context *context) |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 112 | { |
Jamie Madill | 32643ce | 2018-10-19 11:38:03 -0400 | [diff] [blame] | 113 | return angle::Result::Continue(); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 114 | } |
| 115 | |
Jamie Madill | 32643ce | 2018-10-19 11:38:03 -0400 | [diff] [blame] | 116 | angle::Result ContextNULL::finish(const gl::Context *context) |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 117 | { |
Jamie Madill | 32643ce | 2018-10-19 11:38:03 -0400 | [diff] [blame] | 118 | return angle::Result::Continue(); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 119 | } |
| 120 | |
Jamie Madill | 6f755b2 | 2018-10-09 12:48:54 -0400 | [diff] [blame] | 121 | angle::Result ContextNULL::drawArrays(const gl::Context *context, |
| 122 | gl::PrimitiveMode mode, |
| 123 | GLint first, |
| 124 | GLsizei count) |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 125 | { |
Jamie Madill | 6f755b2 | 2018-10-09 12:48:54 -0400 | [diff] [blame] | 126 | return angle::Result::Continue(); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 127 | } |
| 128 | |
Jamie Madill | 32643ce | 2018-10-19 11:38:03 -0400 | [diff] [blame] | 129 | angle::Result ContextNULL::drawArraysInstanced(const gl::Context *context, |
| 130 | gl::PrimitiveMode mode, |
| 131 | GLint first, |
| 132 | GLsizei count, |
| 133 | GLsizei instanceCount) |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 134 | { |
Jamie Madill | 32643ce | 2018-10-19 11:38:03 -0400 | [diff] [blame] | 135 | return angle::Result::Continue(); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 136 | } |
| 137 | |
Jamie Madill | 32643ce | 2018-10-19 11:38:03 -0400 | [diff] [blame] | 138 | angle::Result ContextNULL::drawElements(const gl::Context *context, |
| 139 | gl::PrimitiveMode mode, |
| 140 | GLsizei count, |
Jamie Madill | 8dc27f9 | 2018-11-29 11:45:44 -0500 | [diff] [blame^] | 141 | gl::DrawElementsType type, |
Jamie Madill | 32643ce | 2018-10-19 11:38:03 -0400 | [diff] [blame] | 142 | const void *indices) |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 143 | { |
Jamie Madill | 32643ce | 2018-10-19 11:38:03 -0400 | [diff] [blame] | 144 | return angle::Result::Continue(); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 145 | } |
| 146 | |
Jamie Madill | 32643ce | 2018-10-19 11:38:03 -0400 | [diff] [blame] | 147 | angle::Result ContextNULL::drawElementsInstanced(const gl::Context *context, |
| 148 | gl::PrimitiveMode mode, |
| 149 | GLsizei count, |
Jamie Madill | 8dc27f9 | 2018-11-29 11:45:44 -0500 | [diff] [blame^] | 150 | gl::DrawElementsType type, |
Jamie Madill | 32643ce | 2018-10-19 11:38:03 -0400 | [diff] [blame] | 151 | const void *indices, |
| 152 | GLsizei instances) |
| 153 | { |
| 154 | return angle::Result::Continue(); |
| 155 | } |
| 156 | |
| 157 | angle::Result ContextNULL::drawRangeElements(const gl::Context *context, |
Jamie Madill | 493f957 | 2018-05-24 19:52:15 -0400 | [diff] [blame] | 158 | gl::PrimitiveMode mode, |
Jamie Madill | 32643ce | 2018-10-19 11:38:03 -0400 | [diff] [blame] | 159 | GLuint start, |
| 160 | GLuint end, |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 161 | GLsizei count, |
Jamie Madill | 8dc27f9 | 2018-11-29 11:45:44 -0500 | [diff] [blame^] | 162 | gl::DrawElementsType type, |
Jamie Madill | 32643ce | 2018-10-19 11:38:03 -0400 | [diff] [blame] | 163 | const void *indices) |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 164 | { |
Jamie Madill | 32643ce | 2018-10-19 11:38:03 -0400 | [diff] [blame] | 165 | return angle::Result::Continue(); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 166 | } |
| 167 | |
Jamie Madill | 32643ce | 2018-10-19 11:38:03 -0400 | [diff] [blame] | 168 | angle::Result ContextNULL::drawArraysIndirect(const gl::Context *context, |
| 169 | gl::PrimitiveMode mode, |
| 170 | const void *indirect) |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 171 | { |
Jamie Madill | 32643ce | 2018-10-19 11:38:03 -0400 | [diff] [blame] | 172 | return angle::Result::Continue(); |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 173 | } |
| 174 | |
Jamie Madill | 32643ce | 2018-10-19 11:38:03 -0400 | [diff] [blame] | 175 | angle::Result ContextNULL::drawElementsIndirect(const gl::Context *context, |
| 176 | gl::PrimitiveMode mode, |
Jamie Madill | 8dc27f9 | 2018-11-29 11:45:44 -0500 | [diff] [blame^] | 177 | gl::DrawElementsType type, |
Jamie Madill | 32643ce | 2018-10-19 11:38:03 -0400 | [diff] [blame] | 178 | const void *indirect) |
Jiajia Qin | d967122 | 2016-11-29 16:30:31 +0800 | [diff] [blame] | 179 | { |
Jamie Madill | 32643ce | 2018-10-19 11:38:03 -0400 | [diff] [blame] | 180 | return angle::Result::Continue(); |
Jiajia Qin | d967122 | 2016-11-29 16:30:31 +0800 | [diff] [blame] | 181 | } |
| 182 | |
Jamie Madill | b980c56 | 2018-11-27 11:34:27 -0500 | [diff] [blame] | 183 | void ContextNULL::stencilFillPath(const gl::Path *path, GLenum fillMode, GLuint mask) {} |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 184 | |
Jamie Madill | b980c56 | 2018-11-27 11:34:27 -0500 | [diff] [blame] | 185 | void ContextNULL::stencilStrokePath(const gl::Path *path, GLint reference, GLuint mask) {} |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 186 | |
Jamie Madill | b980c56 | 2018-11-27 11:34:27 -0500 | [diff] [blame] | 187 | void ContextNULL::coverFillPath(const gl::Path *path, GLenum coverMode) {} |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 188 | |
Jamie Madill | b980c56 | 2018-11-27 11:34:27 -0500 | [diff] [blame] | 189 | void ContextNULL::coverStrokePath(const gl::Path *path, GLenum coverMode) {} |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 190 | |
| 191 | void ContextNULL::stencilThenCoverFillPath(const gl::Path *path, |
| 192 | GLenum fillMode, |
| 193 | GLuint mask, |
| 194 | GLenum coverMode) |
Jamie Madill | b980c56 | 2018-11-27 11:34:27 -0500 | [diff] [blame] | 195 | {} |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 196 | |
| 197 | void ContextNULL::stencilThenCoverStrokePath(const gl::Path *path, |
| 198 | GLint reference, |
| 199 | GLuint mask, |
| 200 | GLenum coverMode) |
Jamie Madill | b980c56 | 2018-11-27 11:34:27 -0500 | [diff] [blame] | 201 | {} |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 202 | |
| 203 | void ContextNULL::coverFillPathInstanced(const std::vector<gl::Path *> &paths, |
| 204 | GLenum coverMode, |
| 205 | GLenum transformType, |
| 206 | const GLfloat *transformValues) |
Jamie Madill | b980c56 | 2018-11-27 11:34:27 -0500 | [diff] [blame] | 207 | {} |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 208 | |
| 209 | void ContextNULL::coverStrokePathInstanced(const std::vector<gl::Path *> &paths, |
| 210 | GLenum coverMode, |
| 211 | GLenum transformType, |
| 212 | const GLfloat *transformValues) |
Jamie Madill | b980c56 | 2018-11-27 11:34:27 -0500 | [diff] [blame] | 213 | {} |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 214 | |
| 215 | void ContextNULL::stencilFillPathInstanced(const std::vector<gl::Path *> &paths, |
| 216 | GLenum fillMode, |
| 217 | GLuint mask, |
| 218 | GLenum transformType, |
| 219 | const GLfloat *transformValues) |
Jamie Madill | b980c56 | 2018-11-27 11:34:27 -0500 | [diff] [blame] | 220 | {} |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 221 | |
| 222 | void ContextNULL::stencilStrokePathInstanced(const std::vector<gl::Path *> &paths, |
| 223 | GLint reference, |
| 224 | GLuint mask, |
| 225 | GLenum transformType, |
| 226 | const GLfloat *transformValues) |
Jamie Madill | b980c56 | 2018-11-27 11:34:27 -0500 | [diff] [blame] | 227 | {} |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 228 | |
| 229 | void ContextNULL::stencilThenCoverFillPathInstanced(const std::vector<gl::Path *> &paths, |
| 230 | GLenum coverMode, |
| 231 | GLenum fillMode, |
| 232 | GLuint mask, |
| 233 | GLenum transformType, |
| 234 | const GLfloat *transformValues) |
Jamie Madill | b980c56 | 2018-11-27 11:34:27 -0500 | [diff] [blame] | 235 | {} |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 236 | |
| 237 | void ContextNULL::stencilThenCoverStrokePathInstanced(const std::vector<gl::Path *> &paths, |
| 238 | GLenum coverMode, |
| 239 | GLint reference, |
| 240 | GLuint mask, |
| 241 | GLenum transformType, |
| 242 | const GLfloat *transformValues) |
Jamie Madill | b980c56 | 2018-11-27 11:34:27 -0500 | [diff] [blame] | 243 | {} |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 244 | |
| 245 | GLenum ContextNULL::getResetStatus() |
| 246 | { |
| 247 | return GL_NO_ERROR; |
| 248 | } |
| 249 | |
| 250 | std::string ContextNULL::getVendorString() const |
| 251 | { |
| 252 | return "NULL"; |
| 253 | } |
| 254 | |
| 255 | std::string ContextNULL::getRendererDescription() const |
| 256 | { |
| 257 | return "NULL"; |
| 258 | } |
| 259 | |
Jamie Madill | b980c56 | 2018-11-27 11:34:27 -0500 | [diff] [blame] | 260 | void ContextNULL::insertEventMarker(GLsizei length, const char *marker) {} |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 261 | |
Jamie Madill | b980c56 | 2018-11-27 11:34:27 -0500 | [diff] [blame] | 262 | void ContextNULL::pushGroupMarker(GLsizei length, const char *marker) {} |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 263 | |
Jamie Madill | b980c56 | 2018-11-27 11:34:27 -0500 | [diff] [blame] | 264 | void ContextNULL::popGroupMarker() {} |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 265 | |
Jamie Madill | b980c56 | 2018-11-27 11:34:27 -0500 | [diff] [blame] | 266 | void ContextNULL::pushDebugGroup(GLenum source, GLuint id, GLsizei length, const char *message) {} |
Geoff Lang | 5d5253a | 2017-11-22 14:51:12 -0500 | [diff] [blame] | 267 | |
Jamie Madill | b980c56 | 2018-11-27 11:34:27 -0500 | [diff] [blame] | 268 | void ContextNULL::popDebugGroup() {} |
Geoff Lang | 5d5253a | 2017-11-22 14:51:12 -0500 | [diff] [blame] | 269 | |
Jamie Madill | 6f755b2 | 2018-10-09 12:48:54 -0400 | [diff] [blame] | 270 | angle::Result ContextNULL::syncState(const gl::Context *context, |
Jamie Madill | 9d0bb3d | 2018-10-09 20:29:13 -0400 | [diff] [blame] | 271 | const gl::State::DirtyBits &dirtyBits, |
| 272 | const gl::State::DirtyBits &bitMask) |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 273 | { |
Jamie Madill | 6f755b2 | 2018-10-09 12:48:54 -0400 | [diff] [blame] | 274 | return angle::Result::Continue(); |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 275 | } |
| 276 | |
| 277 | GLint ContextNULL::getGPUDisjoint() |
| 278 | { |
| 279 | return 0; |
| 280 | } |
| 281 | |
| 282 | GLint64 ContextNULL::getTimestamp() |
| 283 | { |
| 284 | return 0; |
| 285 | } |
| 286 | |
Jamie Madill | 32643ce | 2018-10-19 11:38:03 -0400 | [diff] [blame] | 287 | angle::Result ContextNULL::onMakeCurrent(const gl::Context *context) |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 288 | { |
Jamie Madill | 32643ce | 2018-10-19 11:38:03 -0400 | [diff] [blame] | 289 | return angle::Result::Continue(); |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 290 | } |
| 291 | |
Jiawei Shao | d0a7d10 | 2018-05-07 12:40:20 +0800 | [diff] [blame] | 292 | gl::Caps ContextNULL::getNativeCaps() const |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 293 | { |
| 294 | return mCaps; |
| 295 | } |
| 296 | |
| 297 | const gl::TextureCapsMap &ContextNULL::getNativeTextureCaps() const |
| 298 | { |
| 299 | return mTextureCaps; |
| 300 | } |
| 301 | |
| 302 | const gl::Extensions &ContextNULL::getNativeExtensions() const |
| 303 | { |
| 304 | return mExtensions; |
| 305 | } |
| 306 | |
| 307 | const gl::Limitations &ContextNULL::getNativeLimitations() const |
| 308 | { |
| 309 | return mLimitations; |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 310 | } |
| 311 | |
| 312 | CompilerImpl *ContextNULL::createCompiler() |
| 313 | { |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 314 | return new CompilerNULL(); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 315 | } |
| 316 | |
| 317 | ShaderImpl *ContextNULL::createShader(const gl::ShaderState &data) |
| 318 | { |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 319 | return new ShaderNULL(data); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 320 | } |
| 321 | |
| 322 | ProgramImpl *ContextNULL::createProgram(const gl::ProgramState &data) |
| 323 | { |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 324 | return new ProgramNULL(data); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 325 | } |
| 326 | |
| 327 | FramebufferImpl *ContextNULL::createFramebuffer(const gl::FramebufferState &data) |
| 328 | { |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 329 | return new FramebufferNULL(data); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 330 | } |
| 331 | |
| 332 | TextureImpl *ContextNULL::createTexture(const gl::TextureState &state) |
| 333 | { |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 334 | return new TextureNULL(state); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 335 | } |
| 336 | |
Jamie Madill | e703c60 | 2018-02-20 10:21:48 -0500 | [diff] [blame] | 337 | RenderbufferImpl *ContextNULL::createRenderbuffer(const gl::RenderbufferState &state) |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 338 | { |
Jamie Madill | e703c60 | 2018-02-20 10:21:48 -0500 | [diff] [blame] | 339 | return new RenderbufferNULL(state); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 340 | } |
| 341 | |
Jamie Madill | 8f77560 | 2016-11-03 16:45:34 -0400 | [diff] [blame] | 342 | BufferImpl *ContextNULL::createBuffer(const gl::BufferState &state) |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 343 | { |
Geoff Lang | 1b60d8d | 2017-02-10 14:56:55 -0500 | [diff] [blame] | 344 | return new BufferNULL(state, mAllocationTracker); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 345 | } |
| 346 | |
| 347 | VertexArrayImpl *ContextNULL::createVertexArray(const gl::VertexArrayState &data) |
| 348 | { |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 349 | return new VertexArrayNULL(data); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 350 | } |
| 351 | |
Corentin Wallez | ad3ae90 | 2018-03-09 13:40:42 -0500 | [diff] [blame] | 352 | QueryImpl *ContextNULL::createQuery(gl::QueryType type) |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 353 | { |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 354 | return new QueryNULL(type); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 355 | } |
| 356 | |
| 357 | FenceNVImpl *ContextNULL::createFenceNV() |
| 358 | { |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 359 | return new FenceNVNULL(); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 360 | } |
| 361 | |
Jamie Madill | 70b5bb0 | 2017-08-28 13:32:37 -0400 | [diff] [blame] | 362 | SyncImpl *ContextNULL::createSync() |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 363 | { |
Jamie Madill | 70b5bb0 | 2017-08-28 13:32:37 -0400 | [diff] [blame] | 364 | return new SyncNULL(); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 365 | } |
| 366 | |
| 367 | TransformFeedbackImpl *ContextNULL::createTransformFeedback(const gl::TransformFeedbackState &state) |
| 368 | { |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 369 | return new TransformFeedbackNULL(state); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 370 | } |
| 371 | |
Jamie Madill | 06ef36b | 2017-09-09 23:32:46 -0400 | [diff] [blame] | 372 | SamplerImpl *ContextNULL::createSampler(const gl::SamplerState &state) |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 373 | { |
Jamie Madill | 06ef36b | 2017-09-09 23:32:46 -0400 | [diff] [blame] | 374 | return new SamplerNULL(state); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 375 | } |
| 376 | |
Yunchao He | a336b90 | 2017-08-02 16:05:21 +0800 | [diff] [blame] | 377 | ProgramPipelineImpl *ContextNULL::createProgramPipeline(const gl::ProgramPipelineState &state) |
| 378 | { |
| 379 | return new ProgramPipelineNULL(state); |
| 380 | } |
| 381 | |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 382 | std::vector<PathImpl *> ContextNULL::createPaths(GLsizei range) |
| 383 | { |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 384 | std::vector<PathImpl *> result(range); |
| 385 | for (GLsizei idx = 0; idx < range; idx++) |
| 386 | { |
| 387 | result[idx] = new PathNULL(); |
| 388 | } |
| 389 | return result; |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 390 | } |
| 391 | |
Jamie Madill | 32643ce | 2018-10-19 11:38:03 -0400 | [diff] [blame] | 392 | angle::Result ContextNULL::dispatchCompute(const gl::Context *context, |
| 393 | GLuint numGroupsX, |
| 394 | GLuint numGroupsY, |
| 395 | GLuint numGroupsZ) |
Xinghua Cao | 2b39659 | 2017-03-29 15:36:04 +0800 | [diff] [blame] | 396 | { |
Jamie Madill | 32643ce | 2018-10-19 11:38:03 -0400 | [diff] [blame] | 397 | return angle::Result::Continue(); |
Xinghua Cao | 2b39659 | 2017-03-29 15:36:04 +0800 | [diff] [blame] | 398 | } |
| 399 | |
Jamie Madill | 32643ce | 2018-10-19 11:38:03 -0400 | [diff] [blame] | 400 | angle::Result ContextNULL::dispatchComputeIndirect(const gl::Context *context, GLintptr indirect) |
Qin Jiajia | 62fcf62 | 2017-11-30 16:16:12 +0800 | [diff] [blame] | 401 | { |
Jamie Madill | 32643ce | 2018-10-19 11:38:03 -0400 | [diff] [blame] | 402 | return angle::Result::Continue(); |
Qin Jiajia | 62fcf62 | 2017-11-30 16:16:12 +0800 | [diff] [blame] | 403 | } |
| 404 | |
Jamie Madill | 32643ce | 2018-10-19 11:38:03 -0400 | [diff] [blame] | 405 | angle::Result ContextNULL::memoryBarrier(const gl::Context *context, GLbitfield barriers) |
Xinghua Cao | 89c422a | 2017-11-29 18:24:20 +0800 | [diff] [blame] | 406 | { |
Jamie Madill | 32643ce | 2018-10-19 11:38:03 -0400 | [diff] [blame] | 407 | return angle::Result::Continue(); |
Xinghua Cao | 89c422a | 2017-11-29 18:24:20 +0800 | [diff] [blame] | 408 | } |
| 409 | |
Jamie Madill | 32643ce | 2018-10-19 11:38:03 -0400 | [diff] [blame] | 410 | angle::Result ContextNULL::memoryBarrierByRegion(const gl::Context *context, GLbitfield barriers) |
Xinghua Cao | 89c422a | 2017-11-29 18:24:20 +0800 | [diff] [blame] | 411 | { |
Jamie Madill | 32643ce | 2018-10-19 11:38:03 -0400 | [diff] [blame] | 412 | return angle::Result::Continue(); |
Xinghua Cao | 89c422a | 2017-11-29 18:24:20 +0800 | [diff] [blame] | 413 | } |
| 414 | |
Jamie Madill | abfbc0f | 2018-10-09 12:48:52 -0400 | [diff] [blame] | 415 | void ContextNULL::handleError(GLenum errorCode, |
| 416 | const char *message, |
| 417 | const char *file, |
| 418 | const char *function, |
| 419 | unsigned int line) |
| 420 | { |
| 421 | std::stringstream errorStream; |
Jamie Madill | 4f6592f | 2018-11-27 16:37:45 -0500 | [diff] [blame] | 422 | errorStream << "Internal NULL back-end error: " << message << "."; |
| 423 | mErrors->handleError(errorCode, errorStream.str().c_str(), file, function, line); |
Jamie Madill | abfbc0f | 2018-10-09 12:48:52 -0400 | [diff] [blame] | 424 | } |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 425 | } // namespace rx |