blob: 77fa0ab24fa16e23fc65abcf904412a1c0c2b50f [file] [log] [blame]
Geoff Langd08f3b32016-09-23 15:56:30 -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// 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 Lang76cdbd52016-09-23 16:51:04 -040014#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"
18#include "libANGLE/renderer/null/FenceSyncNULL.h"
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"
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"
27#include "libANGLE/renderer/null/TextureNULL.h"
28#include "libANGLE/renderer/null/TransformFeedbackNULL.h"
29#include "libANGLE/renderer/null/VertexArrayNULL.h"
30
Geoff Langd08f3b32016-09-23 15:56:30 -040031namespace rx
32{
33
34ContextNULL::ContextNULL(const gl::ContextState &state) : ContextImpl(state)
35{
Geoff Lang76cdbd52016-09-23 16:51:04 -040036 const gl::Version maxClientVersion(3, 1);
37 mCaps = GenerateMinimumCaps(maxClientVersion);
38 mExtensions = gl::Extensions();
39 mTextureCaps = GenerateMinimumTextureCapsMap(maxClientVersion, mExtensions);
Geoff Langd08f3b32016-09-23 15:56:30 -040040}
41
42ContextNULL::~ContextNULL()
43{
44}
45
46gl::Error ContextNULL::initialize()
47{
Geoff Lang76cdbd52016-09-23 16:51:04 -040048 return gl::NoError();
Geoff Langd08f3b32016-09-23 15:56:30 -040049}
50
51gl::Error ContextNULL::flush()
52{
Geoff Lang76cdbd52016-09-23 16:51:04 -040053 return gl::NoError();
Geoff Langd08f3b32016-09-23 15:56:30 -040054}
55
56gl::Error ContextNULL::finish()
57{
Geoff Lang76cdbd52016-09-23 16:51:04 -040058 return gl::NoError();
Geoff Langd08f3b32016-09-23 15:56:30 -040059}
60
61gl::Error ContextNULL::drawArrays(GLenum mode, GLint first, GLsizei count)
62{
Geoff Lang76cdbd52016-09-23 16:51:04 -040063 return gl::NoError();
Geoff Langd08f3b32016-09-23 15:56:30 -040064}
65
66gl::Error ContextNULL::drawArraysInstanced(GLenum mode,
67 GLint first,
68 GLsizei count,
69 GLsizei instanceCount)
70{
Geoff Lang76cdbd52016-09-23 16:51:04 -040071 return gl::NoError();
Geoff Langd08f3b32016-09-23 15:56:30 -040072}
73
74gl::Error ContextNULL::drawElements(GLenum mode,
75 GLsizei count,
76 GLenum type,
77 const GLvoid *indices,
78 const gl::IndexRange &indexRange)
79{
Geoff Lang76cdbd52016-09-23 16:51:04 -040080 return gl::NoError();
Geoff Langd08f3b32016-09-23 15:56:30 -040081}
82
83gl::Error ContextNULL::drawElementsInstanced(GLenum mode,
84 GLsizei count,
85 GLenum type,
86 const GLvoid *indices,
87 GLsizei instances,
88 const gl::IndexRange &indexRange)
89{
Geoff Lang76cdbd52016-09-23 16:51:04 -040090 return gl::NoError();
Geoff Langd08f3b32016-09-23 15:56:30 -040091}
92
93gl::Error ContextNULL::drawRangeElements(GLenum mode,
94 GLuint start,
95 GLuint end,
96 GLsizei count,
97 GLenum type,
98 const GLvoid *indices,
99 const gl::IndexRange &indexRange)
100{
Geoff Lang76cdbd52016-09-23 16:51:04 -0400101 return gl::NoError();
102}
103
104void ContextNULL::stencilFillPath(const gl::Path *path, GLenum fillMode, GLuint mask)
105{
106}
107
108void ContextNULL::stencilStrokePath(const gl::Path *path, GLint reference, GLuint mask)
109{
110}
111
112void ContextNULL::coverFillPath(const gl::Path *path, GLenum coverMode)
113{
114}
115
116void ContextNULL::coverStrokePath(const gl::Path *path, GLenum coverMode)
117{
118}
119
120void ContextNULL::stencilThenCoverFillPath(const gl::Path *path,
121 GLenum fillMode,
122 GLuint mask,
123 GLenum coverMode)
124{
125}
126
127void ContextNULL::stencilThenCoverStrokePath(const gl::Path *path,
128 GLint reference,
129 GLuint mask,
130 GLenum coverMode)
131{
132}
133
134void ContextNULL::coverFillPathInstanced(const std::vector<gl::Path *> &paths,
135 GLenum coverMode,
136 GLenum transformType,
137 const GLfloat *transformValues)
138{
139}
140
141void ContextNULL::coverStrokePathInstanced(const std::vector<gl::Path *> &paths,
142 GLenum coverMode,
143 GLenum transformType,
144 const GLfloat *transformValues)
145{
146}
147
148void ContextNULL::stencilFillPathInstanced(const std::vector<gl::Path *> &paths,
149 GLenum fillMode,
150 GLuint mask,
151 GLenum transformType,
152 const GLfloat *transformValues)
153{
154}
155
156void ContextNULL::stencilStrokePathInstanced(const std::vector<gl::Path *> &paths,
157 GLint reference,
158 GLuint mask,
159 GLenum transformType,
160 const GLfloat *transformValues)
161{
162}
163
164void ContextNULL::stencilThenCoverFillPathInstanced(const std::vector<gl::Path *> &paths,
165 GLenum coverMode,
166 GLenum fillMode,
167 GLuint mask,
168 GLenum transformType,
169 const GLfloat *transformValues)
170{
171}
172
173void ContextNULL::stencilThenCoverStrokePathInstanced(const std::vector<gl::Path *> &paths,
174 GLenum coverMode,
175 GLint reference,
176 GLuint mask,
177 GLenum transformType,
178 const GLfloat *transformValues)
179{
180}
181
182GLenum ContextNULL::getResetStatus()
183{
184 return GL_NO_ERROR;
185}
186
187std::string ContextNULL::getVendorString() const
188{
189 return "NULL";
190}
191
192std::string ContextNULL::getRendererDescription() const
193{
194 return "NULL";
195}
196
197void ContextNULL::insertEventMarker(GLsizei length, const char *marker)
198{
199}
200
201void ContextNULL::pushGroupMarker(GLsizei length, const char *marker)
202{
203}
204
205void ContextNULL::popGroupMarker()
206{
207}
208
209void ContextNULL::syncState(const gl::State &state, const gl::State::DirtyBits &dirtyBits)
210{
211}
212
213GLint ContextNULL::getGPUDisjoint()
214{
215 return 0;
216}
217
218GLint64 ContextNULL::getTimestamp()
219{
220 return 0;
221}
222
223void ContextNULL::onMakeCurrent(const gl::ContextState &data)
224{
225}
226
227const gl::Caps &ContextNULL::getNativeCaps() const
228{
229 return mCaps;
230}
231
232const gl::TextureCapsMap &ContextNULL::getNativeTextureCaps() const
233{
234 return mTextureCaps;
235}
236
237const gl::Extensions &ContextNULL::getNativeExtensions() const
238{
239 return mExtensions;
240}
241
242const gl::Limitations &ContextNULL::getNativeLimitations() const
243{
244 return mLimitations;
Geoff Langd08f3b32016-09-23 15:56:30 -0400245}
246
247CompilerImpl *ContextNULL::createCompiler()
248{
Geoff Lang76cdbd52016-09-23 16:51:04 -0400249 return new CompilerNULL();
Geoff Langd08f3b32016-09-23 15:56:30 -0400250}
251
252ShaderImpl *ContextNULL::createShader(const gl::ShaderState &data)
253{
Geoff Lang76cdbd52016-09-23 16:51:04 -0400254 return new ShaderNULL(data);
Geoff Langd08f3b32016-09-23 15:56:30 -0400255}
256
257ProgramImpl *ContextNULL::createProgram(const gl::ProgramState &data)
258{
Geoff Lang76cdbd52016-09-23 16:51:04 -0400259 return new ProgramNULL(data);
Geoff Langd08f3b32016-09-23 15:56:30 -0400260}
261
262FramebufferImpl *ContextNULL::createFramebuffer(const gl::FramebufferState &data)
263{
Geoff Lang76cdbd52016-09-23 16:51:04 -0400264 return new FramebufferNULL(data);
Geoff Langd08f3b32016-09-23 15:56:30 -0400265}
266
267TextureImpl *ContextNULL::createTexture(const gl::TextureState &state)
268{
Geoff Lang76cdbd52016-09-23 16:51:04 -0400269 return new TextureNULL(state);
Geoff Langd08f3b32016-09-23 15:56:30 -0400270}
271
272RenderbufferImpl *ContextNULL::createRenderbuffer()
273{
Geoff Lang76cdbd52016-09-23 16:51:04 -0400274 return new RenderbufferNULL();
Geoff Langd08f3b32016-09-23 15:56:30 -0400275}
276
Jamie Madill8f775602016-11-03 16:45:34 -0400277BufferImpl *ContextNULL::createBuffer(const gl::BufferState &state)
Geoff Langd08f3b32016-09-23 15:56:30 -0400278{
Geoff Lang76cdbd52016-09-23 16:51:04 -0400279 return new BufferNULL(state);
Geoff Langd08f3b32016-09-23 15:56:30 -0400280}
281
282VertexArrayImpl *ContextNULL::createVertexArray(const gl::VertexArrayState &data)
283{
Geoff Lang76cdbd52016-09-23 16:51:04 -0400284 return new VertexArrayNULL(data);
Geoff Langd08f3b32016-09-23 15:56:30 -0400285}
286
287QueryImpl *ContextNULL::createQuery(GLenum type)
288{
Geoff Lang76cdbd52016-09-23 16:51:04 -0400289 return new QueryNULL(type);
Geoff Langd08f3b32016-09-23 15:56:30 -0400290}
291
292FenceNVImpl *ContextNULL::createFenceNV()
293{
Geoff Lang76cdbd52016-09-23 16:51:04 -0400294 return new FenceNVNULL();
Geoff Langd08f3b32016-09-23 15:56:30 -0400295}
296
297FenceSyncImpl *ContextNULL::createFenceSync()
298{
Geoff Lang76cdbd52016-09-23 16:51:04 -0400299 return new FenceSyncNULL();
Geoff Langd08f3b32016-09-23 15:56:30 -0400300}
301
302TransformFeedbackImpl *ContextNULL::createTransformFeedback(const gl::TransformFeedbackState &state)
303{
Geoff Lang76cdbd52016-09-23 16:51:04 -0400304 return new TransformFeedbackNULL(state);
Geoff Langd08f3b32016-09-23 15:56:30 -0400305}
306
307SamplerImpl *ContextNULL::createSampler()
308{
Geoff Lang76cdbd52016-09-23 16:51:04 -0400309 return new SamplerNULL();
Geoff Langd08f3b32016-09-23 15:56:30 -0400310}
311
312std::vector<PathImpl *> ContextNULL::createPaths(GLsizei range)
313{
Geoff Lang76cdbd52016-09-23 16:51:04 -0400314 std::vector<PathImpl *> result(range);
315 for (GLsizei idx = 0; idx < range; idx++)
316 {
317 result[idx] = new PathNULL();
318 }
319 return result;
Geoff Langd08f3b32016-09-23 15:56:30 -0400320}
321
322} // namespace rx