1 // SwiftShader Software Renderer
\r
3 // Copyright(c) 2005-2013 TransGaming Inc.
\r
5 // All rights reserved. No part of this software may be copied, distributed, transmitted,
\r
6 // transcribed, stored in a retrieval system, translated into any human or computer
\r
7 // language by any means, or disclosed to third parties without the explicit written
\r
8 // agreement of TransGaming Inc. Without such an agreement, no rights or licenses, express
\r
9 // or implied, including but not limited to any patent rights, are granted to you.
\r
12 // Context.h: Defines the Context class, managing all GL state and performing
\r
13 // rendering operations. It is the GLES2 specific implementation of EGLContext.
\r
15 #ifndef LIBGLESV2_CONTEXT_H_
\r
16 #define LIBGLESV2_CONTEXT_H_
\r
18 #include "libEGL/Context.hpp"
\r
19 #include "ResourceManager.h"
\r
20 #include "common/NameSpace.hpp"
\r
21 #include "common/Object.hpp"
\r
22 #include "Image.hpp"
\r
23 #include "Renderer/Sampler.hpp"
\r
24 #include "TransformFeedback.h"
\r
27 #include <GLES2/gl2.h>
\r
28 #include <GLES2/gl2ext.h>
\r
29 #include <GLES3/gl3.h>
\r
31 #include <EGL/egl.h>
\r
45 struct TranslatedAttribute;
\r
46 struct TranslatedIndexData;
\r
55 class TextureCubeMap;
\r
56 class TextureExternal;
\r
59 class RenderbufferStorage;
\r
62 class StreamingIndexBuffer;
\r
63 class Stencilbuffer;
\r
64 class DepthStencilbuffer;
\r
65 class VertexDataManager;
\r
66 class IndexDataManager;
\r
74 MAX_VERTEX_ATTRIBS = 16,
\r
75 MAX_UNIFORM_VECTORS = 256, // Device limit
\r
76 MAX_VERTEX_UNIFORM_VECTORS = VERTEX_UNIFORM_VECTORS - 3, // Reserve space for gl_DepthRange
\r
77 MAX_VARYING_VECTORS = 10,
\r
78 MAX_TEXTURE_IMAGE_UNITS = TEXTURE_IMAGE_UNITS,
\r
79 MAX_VERTEX_TEXTURE_IMAGE_UNITS = VERTEX_TEXTURE_IMAGE_UNITS,
\r
80 MAX_COMBINED_TEXTURE_IMAGE_UNITS = MAX_TEXTURE_IMAGE_UNITS + MAX_VERTEX_TEXTURE_IMAGE_UNITS,
\r
81 MAX_FRAGMENT_UNIFORM_VECTORS = FRAGMENT_UNIFORM_VECTORS - 3, // Reserve space for gl_DepthRange
\r
82 MAX_DRAW_BUFFERS = 1,
\r
85 const GLenum compressedTextureFormats[] =
\r
89 GL_COMPRESSED_RGB_S3TC_DXT1_EXT,
\r
90 GL_COMPRESSED_RGBA_S3TC_DXT1_EXT,
\r
91 GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE,
\r
92 GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE,
\r
94 #if (GL_ES_VERSION_3_0)
\r
95 GL_COMPRESSED_R11_EAC,
\r
96 GL_COMPRESSED_SIGNED_R11_EAC,
\r
97 GL_COMPRESSED_RG11_EAC,
\r
98 GL_COMPRESSED_SIGNED_RG11_EAC,
\r
99 GL_COMPRESSED_RGB8_ETC2,
\r
100 GL_COMPRESSED_SRGB8_ETC2,
\r
101 GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,
\r
102 GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,
\r
103 GL_COMPRESSED_RGBA8_ETC2_EAC,
\r
104 GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,
\r
108 const GLint NUM_COMPRESSED_TEXTURE_FORMATS = sizeof(compressedTextureFormats) / sizeof(compressedTextureFormats[0]);
\r
110 const float ALIASED_LINE_WIDTH_RANGE_MIN = 1.0f;
\r
111 const float ALIASED_LINE_WIDTH_RANGE_MAX = 1.0f;
\r
112 const float ALIASED_POINT_SIZE_RANGE_MIN = 0.125f;
\r
113 const float ALIASED_POINT_SIZE_RANGE_MAX = 8192.0f;
\r
114 const float MAX_TEXTURE_MAX_ANISOTROPY = 16.0f;
\r
118 QUERY_ANY_SAMPLES_PASSED,
\r
119 QUERY_ANY_SAMPLES_PASSED_CONSERVATIVE,
\r
132 // Helper structure describing a single vertex attribute
\r
133 class VertexAttribute
\r
136 VertexAttribute() : mType(GL_FLOAT), mSize(0), mNormalized(false), mStride(0), mDivisor(0), mPointer(NULL), mArrayEnabled(false)
\r
138 mCurrentValue[0].f = 0.0f;
\r
139 mCurrentValue[1].f = 0.0f;
\r
140 mCurrentValue[2].f = 0.0f;
\r
141 mCurrentValue[3].f = 1.0f;
\r
142 mCurrentValueType = ValueUnion::FloatType;
\r
145 int typeSize() const
\r
149 case GL_BYTE: return mSize * sizeof(GLbyte);
\r
150 case GL_UNSIGNED_BYTE: return mSize * sizeof(GLubyte);
\r
151 case GL_SHORT: return mSize * sizeof(GLshort);
\r
152 case GL_UNSIGNED_SHORT: return mSize * sizeof(GLushort);
\r
153 case GL_FIXED: return mSize * sizeof(GLfixed);
\r
154 case GL_FLOAT: return mSize * sizeof(GLfloat);
\r
155 default: UNREACHABLE(); return mSize * sizeof(GLfloat);
\r
159 GLsizei stride() const
\r
161 return mStride ? mStride : typeSize();
\r
164 inline float getCurrentValue(int i) const
\r
166 switch(mCurrentValueType)
\r
168 case ValueUnion::FloatType: return mCurrentValue[i].f;
\r
169 case ValueUnion::IntType: return static_cast<float>(mCurrentValue[i].i);
\r
170 case ValueUnion::UIntType: return static_cast<float>(mCurrentValue[i].ui);
\r
171 default: UNREACHABLE(); return mCurrentValue[i].f;
\r
175 inline GLint getCurrentValueI(int i) const
\r
177 switch(mCurrentValueType)
\r
179 case ValueUnion::FloatType: return static_cast<GLint>(mCurrentValue[i].f);
\r
180 case ValueUnion::IntType: return mCurrentValue[i].i;
\r
181 case ValueUnion::UIntType: return static_cast<GLint>(mCurrentValue[i].ui);
\r
182 default: UNREACHABLE(); return mCurrentValue[i].i;
\r
186 inline GLuint getCurrentValueUI(int i) const
\r
188 switch(mCurrentValueType)
\r
190 case ValueUnion::FloatType: return static_cast<GLuint>(mCurrentValue[i].f);
\r
191 case ValueUnion::IntType: return static_cast<GLuint>(mCurrentValue[i].i);
\r
192 case ValueUnion::UIntType: return mCurrentValue[i].ui;
\r
193 default: UNREACHABLE(); return mCurrentValue[i].ui;
\r
197 inline void setCurrentValue(const GLfloat *values)
\r
199 mCurrentValue[0].f = values[0];
\r
200 mCurrentValue[1].f = values[1];
\r
201 mCurrentValue[2].f = values[2];
\r
202 mCurrentValue[3].f = values[3];
\r
203 mCurrentValueType = ValueUnion::FloatType;
\r
206 inline void setCurrentValue(const GLint *values)
\r
208 mCurrentValue[0].i = values[0];
\r
209 mCurrentValue[1].i = values[1];
\r
210 mCurrentValue[2].i = values[2];
\r
211 mCurrentValue[3].i = values[3];
\r
212 mCurrentValueType = ValueUnion::IntType;
\r
215 inline void setCurrentValue(const GLuint *values)
\r
217 mCurrentValue[0].ui = values[0];
\r
218 mCurrentValue[1].ui = values[1];
\r
219 mCurrentValue[2].ui = values[2];
\r
220 mCurrentValue[3].ui = values[3];
\r
221 mCurrentValueType = ValueUnion::UIntType;
\r
224 // From glVertexAttribPointer
\r
228 GLsizei mStride; // 0 means natural stride
\r
229 GLuint mDivisor; // From glVertexAttribDivisor
\r
233 const void *mPointer;
\r
237 gl::BindingPointer<Buffer> mBoundBuffer; // Captured when glVertexAttribPointer is called.
\r
239 bool mArrayEnabled; // From glEnable/DisableVertexAttribArray
\r
243 enum Type { FloatType, IntType, UIntType };
\r
249 ValueUnion mCurrentValue[4]; // From glVertexAttrib
\r
250 ValueUnion::Type mCurrentValueType;
\r
253 typedef VertexAttribute VertexAttributeArray[MAX_VERTEX_ATTRIBS];
\r
255 // Helper structure to store all raw state
\r
258 Color colorClearValue;
\r
259 GLclampf depthClearValue;
\r
260 int stencilClearValue;
\r
268 GLenum sourceBlendRGB;
\r
269 GLenum destBlendRGB;
\r
270 GLenum sourceBlendAlpha;
\r
271 GLenum destBlendAlpha;
\r
272 GLenum blendEquationRGB;
\r
273 GLenum blendEquationAlpha;
\r
276 GLenum stencilFunc;
\r
278 GLuint stencilMask;
\r
279 GLenum stencilFail;
\r
280 GLenum stencilPassDepthFail;
\r
281 GLenum stencilPassDepthPass;
\r
282 GLuint stencilWritemask;
\r
283 GLenum stencilBackFunc;
\r
284 GLint stencilBackRef;
\r
285 GLuint stencilBackMask;
\r
286 GLenum stencilBackFail;
\r
287 GLenum stencilBackPassDepthFail;
\r
288 GLenum stencilBackPassDepthPass;
\r
289 GLuint stencilBackWritemask;
\r
290 bool polygonOffsetFill;
\r
291 GLfloat polygonOffsetFactor;
\r
292 GLfloat polygonOffsetUnits;
\r
293 bool sampleAlphaToCoverage;
\r
294 bool sampleCoverage;
\r
295 GLclampf sampleCoverageValue;
\r
296 bool sampleCoverageInvert;
\r
299 bool primitiveRestartFixedIndex;
\r
300 bool rasterizerDiscard;
\r
304 GLenum generateMipmapHint;
\r
305 GLenum fragmentShaderDerivativeHint;
\r
309 GLsizei viewportWidth;
\r
310 GLsizei viewportHeight;
\r
316 GLsizei scissorWidth;
\r
317 GLsizei scissorHeight;
\r
320 bool colorMaskGreen;
\r
321 bool colorMaskBlue;
\r
322 bool colorMaskAlpha;
\r
325 unsigned int activeSampler; // Active texture unit selector - GL_TEXTURE0
\r
326 gl::BindingPointer<Buffer> arrayBuffer;
\r
327 gl::BindingPointer<Buffer> elementArrayBuffer;
\r
328 GLuint readFramebuffer;
\r
329 GLuint drawFramebuffer;
\r
330 gl::BindingPointer<Renderbuffer> renderbuffer;
\r
331 GLuint currentProgram;
\r
332 gl::BindingPointer<VertexArray> vertexArray;
\r
333 GLuint transformFeedback;
\r
334 gl::BindingPointer<Sampler> sampler[MAX_COMBINED_TEXTURE_IMAGE_UNITS];
\r
336 VertexAttribute vertexAttribute[MAX_VERTEX_ATTRIBS];
\r
337 gl::BindingPointer<Texture> samplerTexture[TEXTURE_TYPE_COUNT][MAX_COMBINED_TEXTURE_IMAGE_UNITS];
\r
338 gl::BindingPointer<Query> activeQuery[QUERY_TYPE_COUNT];
\r
340 GLint unpackAlignment;
\r
341 GLint packAlignment;
\r
344 class Context : public egl::Context
\r
347 Context(const egl::Config *config, const Context *shareContext, EGLint clientVersion);
\r
349 virtual void makeCurrent(egl::Surface *surface);
\r
350 virtual EGLint getClientVersion();
\r
352 void markAllStateDirty();
\r
354 // State manipulation
\r
355 void setClearColor(float red, float green, float blue, float alpha);
\r
356 void setClearDepth(float depth);
\r
357 void setClearStencil(int stencil);
\r
359 void setCullFace(bool enabled);
\r
360 bool isCullFaceEnabled() const;
\r
361 void setCullMode(GLenum mode);
\r
362 void setFrontFace(GLenum front);
\r
364 void setDepthTest(bool enabled);
\r
365 bool isDepthTestEnabled() const;
\r
366 void setDepthFunc(GLenum depthFunc);
\r
367 void setDepthRange(float zNear, float zFar);
\r
369 void setBlend(bool enabled);
\r
370 bool isBlendEnabled() const;
\r
371 void setBlendFactors(GLenum sourceRGB, GLenum destRGB, GLenum sourceAlpha, GLenum destAlpha);
\r
372 void setBlendColor(float red, float green, float blue, float alpha);
\r
373 void setBlendEquation(GLenum rgbEquation, GLenum alphaEquation);
\r
375 void setStencilTest(bool enabled);
\r
376 bool isStencilTestEnabled() const;
\r
377 void setStencilParams(GLenum stencilFunc, GLint stencilRef, GLuint stencilMask);
\r
378 void setStencilBackParams(GLenum stencilBackFunc, GLint stencilBackRef, GLuint stencilBackMask);
\r
379 void setStencilWritemask(GLuint stencilWritemask);
\r
380 void setStencilBackWritemask(GLuint stencilBackWritemask);
\r
381 void setStencilOperations(GLenum stencilFail, GLenum stencilPassDepthFail, GLenum stencilPassDepthPass);
\r
382 void setStencilBackOperations(GLenum stencilBackFail, GLenum stencilBackPassDepthFail, GLenum stencilBackPassDepthPass);
\r
384 void setPolygonOffsetFill(bool enabled);
\r
385 bool isPolygonOffsetFillEnabled() const;
\r
386 void setPolygonOffsetParams(GLfloat factor, GLfloat units);
\r
388 void setSampleAlphaToCoverage(bool enabled);
\r
389 bool isSampleAlphaToCoverageEnabled() const;
\r
390 void setSampleCoverage(bool enabled);
\r
391 bool isSampleCoverageEnabled() const;
\r
392 void setSampleCoverageParams(GLclampf value, bool invert);
\r
394 void setDither(bool enabled);
\r
395 bool isDitherEnabled() const;
\r
397 void setPrimitiveRestartFixedIndex(bool enabled);
\r
398 bool isPrimitiveRestartFixedIndexEnabled() const;
\r
400 void setRasterizerDiscard(bool enabled);
\r
401 bool isRasterizerDiscardEnabled() const;
\r
403 void setLineWidth(GLfloat width);
\r
405 void setGenerateMipmapHint(GLenum hint);
\r
406 void setFragmentShaderDerivativeHint(GLenum hint);
\r
408 void setViewportParams(GLint x, GLint y, GLsizei width, GLsizei height);
\r
410 void setScissorTest(bool enabled);
\r
411 bool isScissorTestEnabled() const;
\r
412 void setScissorParams(GLint x, GLint y, GLsizei width, GLsizei height);
\r
414 void setColorMask(bool red, bool green, bool blue, bool alpha);
\r
415 void setDepthMask(bool mask);
\r
417 void setActiveSampler(unsigned int active);
\r
419 GLuint getReadFramebufferName() const;
\r
420 GLuint getDrawFramebufferName() const;
\r
421 GLuint getRenderbufferName() const;
\r
423 GLuint getActiveQuery(GLenum target) const;
\r
425 GLuint getArrayBufferName() const;
\r
427 void setEnableVertexAttribArray(unsigned int attribNum, bool enabled);
\r
428 void setVertexAttribDivisor(unsigned int attribNum, GLuint divisor);
\r
429 const VertexAttribute &getVertexAttribState(unsigned int attribNum);
\r
430 void setVertexAttribState(unsigned int attribNum, Buffer *boundBuffer, GLint size, GLenum type,
\r
431 bool normalized, GLsizei stride, const void *pointer);
\r
432 const void *getVertexAttribPointer(unsigned int attribNum) const;
\r
434 const VertexAttributeArray &getVertexAttributes();
\r
436 void setUnpackAlignment(GLint alignment);
\r
437 GLint getUnpackAlignment() const;
\r
439 void setPackAlignment(GLint alignment);
\r
440 GLint getPackAlignment() const;
\r
442 // These create and destroy methods are merely pass-throughs to
\r
443 // ResourceManager, which owns these object types
\r
444 GLuint createBuffer();
\r
445 GLuint createShader(GLenum type);
\r
446 GLuint createProgram();
\r
447 GLuint createTexture();
\r
448 GLuint createRenderbuffer();
\r
450 void deleteBuffer(GLuint buffer);
\r
451 void deleteShader(GLuint shader);
\r
452 void deleteProgram(GLuint program);
\r
453 void deleteTexture(GLuint texture);
\r
454 void deleteRenderbuffer(GLuint renderbuffer);
\r
456 // Framebuffers are owned by the Context, so these methods do not pass through
\r
457 GLuint createFramebuffer();
\r
458 void deleteFramebuffer(GLuint framebuffer);
\r
460 // Fences are owned by the Context
\r
461 GLuint createFence();
\r
462 void deleteFence(GLuint fence);
\r
464 // Queries are owned by the Context
\r
465 GLuint createQuery();
\r
466 void deleteQuery(GLuint query);
\r
468 // Vertex arrays are owned by the Context
\r
469 GLuint createVertexArray();
\r
470 void deleteVertexArray(GLuint array);
\r
472 // Transform feedbacks are owned by the Context
\r
473 GLuint createTransformFeedback();
\r
474 void deleteTransformFeedback(GLuint transformFeedback);
\r
476 // Samplers are owned by the Context
\r
477 GLuint createSampler();
\r
478 void deleteSampler(GLuint sampler);
\r
480 void bindArrayBuffer(GLuint buffer);
\r
481 void bindElementArrayBuffer(GLuint buffer);
\r
482 void bindTexture2D(GLuint texture);
\r
483 void bindTextureCubeMap(GLuint texture);
\r
484 void bindTextureExternal(GLuint texture);
\r
485 void bindTexture3D(GLuint texture);
\r
486 void bindReadFramebuffer(GLuint framebuffer);
\r
487 void bindDrawFramebuffer(GLuint framebuffer);
\r
488 void bindRenderbuffer(GLuint renderbuffer);
\r
489 bool bindVertexArray(GLuint array);
\r
490 bool bindTransformFeedback(GLuint transformFeedback);
\r
491 bool bindSampler(GLuint unit, GLuint sampler);
\r
492 void useProgram(GLuint program);
\r
494 void beginQuery(GLenum target, GLuint query);
\r
495 void endQuery(GLenum target);
\r
497 void setFramebufferZero(Framebuffer *framebuffer);
\r
499 void setRenderbufferStorage(RenderbufferStorage *renderbuffer);
\r
501 void setVertexAttrib(GLuint index, const GLfloat *values);
\r
502 void setVertexAttrib(GLuint index, const GLint *values);
\r
503 void setVertexAttrib(GLuint index, const GLuint *values);
\r
505 Buffer *getBuffer(GLuint handle);
\r
506 Fence *getFence(GLuint handle);
\r
507 Shader *getShader(GLuint handle);
\r
508 Program *getProgram(GLuint handle);
\r
509 virtual Texture *getTexture(GLuint handle);
\r
510 Framebuffer *getFramebuffer(GLuint handle);
\r
511 virtual Renderbuffer *getRenderbuffer(GLuint handle);
\r
512 Query *getQuery(GLuint handle, bool create, GLenum type);
\r
513 VertexArray *getVertexArray(GLuint array);
\r
514 TransformFeedback *getTransformFeedback(GLuint transformFeedback);
\r
515 TransformFeedback *getTransformFeedback();
\r
516 Sampler *getSampler(GLuint sampler);
\r
518 Buffer *getArrayBuffer();
\r
519 Buffer *getElementArrayBuffer();
\r
520 Program *getCurrentProgram();
\r
521 Texture2D *getTexture2D();
\r
522 Texture3D *getTexture3D();
\r
523 TextureCubeMap *getTextureCubeMap();
\r
524 TextureExternal *getTextureExternal();
\r
525 Texture *getSamplerTexture(unsigned int sampler, TextureType type);
\r
526 Framebuffer *getReadFramebuffer();
\r
527 Framebuffer *getDrawFramebuffer();
\r
529 bool getFloatv(GLenum pname, GLfloat *params);
\r
530 bool getIntegerv(GLenum pname, GLint *params);
\r
531 bool getBooleanv(GLenum pname, GLboolean *params);
\r
532 bool getTransformFeedbackiv(GLuint xfb, GLenum pname, GLint *param);
\r
534 bool getQueryParameterInfo(GLenum pname, GLenum *type, unsigned int *numParams);
\r
536 void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei *bufSize, void* pixels);
\r
537 void clear(GLbitfield mask);
\r
538 void drawArrays(GLenum mode, GLint first, GLsizei count);
\r
539 void drawElements(GLenum mode, GLsizei count, GLenum type, const void *indices);
\r
543 void recordInvalidEnum();
\r
544 void recordInvalidValue();
\r
545 void recordInvalidOperation();
\r
546 void recordOutOfMemory();
\r
547 void recordInvalidFramebufferOperation();
\r
551 static int getSupportedMultiSampleDepth(sw::Format format, int requested);
\r
553 void blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
\r
554 GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
\r
557 virtual void bindTexImage(egl::Surface *surface);
\r
558 virtual EGLenum validateSharedImage(EGLenum target, GLuint name, GLuint textureLevel);
\r
559 virtual egl::Image *createSharedImage(EGLenum target, GLuint name, GLuint textureLevel);
\r
561 Device *getDevice();
\r
563 const GLubyte* getExtensions(GLuint index, GLuint* numExt = nullptr);
\r
566 virtual ~Context();
\r
568 bool applyRenderTarget();
\r
569 void applyState(GLenum drawMode);
\r
570 GLenum applyVertexBuffer(GLint base, GLint first, GLsizei count);
\r
571 GLenum applyIndexBuffer(const void *indices, GLsizei count, GLenum mode, GLenum type, TranslatedIndexData *indexInfo);
\r
572 void applyShaders();
\r
573 void applyTextures();
\r
574 void applyTextures(sw::SamplerType type);
\r
575 void applyTexture(sw::SamplerType type, int sampler, Texture *texture);
\r
577 void detachBuffer(GLuint buffer);
\r
578 void detachTexture(GLuint texture);
\r
579 void detachFramebuffer(GLuint framebuffer);
\r
580 void detachRenderbuffer(GLuint renderbuffer);
\r
582 bool cullSkipsDraw(GLenum drawMode);
\r
583 bool isTriangleMode(GLenum drawMode);
\r
585 const EGLint clientVersion;
\r
586 const egl::Config *const mConfig;
\r
590 gl::BindingPointer<Texture2D> mTexture2DZero;
\r
591 gl::BindingPointer<Texture3D> mTexture3DZero;
\r
592 gl::BindingPointer<TextureCubeMap> mTextureCubeMapZero;
\r
593 gl::BindingPointer<TextureExternal> mTextureExternalZero;
\r
595 typedef std::map<GLint, Framebuffer*> FramebufferMap;
\r
596 FramebufferMap mFramebufferMap;
\r
597 gl::NameSpace mFramebufferNameSpace;
\r
599 typedef std::map<GLint, Fence*> FenceMap;
\r
600 FenceMap mFenceMap;
\r
601 gl::NameSpace mFenceNameSpace;
\r
603 typedef std::map<GLint, Query*> QueryMap;
\r
604 QueryMap mQueryMap;
\r
605 gl::NameSpace mQueryNameSpace;
\r
607 typedef std::map<GLint, VertexArray*> VertexArrayMap;
\r
608 VertexArrayMap mVertexArrayMap;
\r
609 gl::NameSpace mVertexArrayNameSpace;
\r
611 typedef std::map<GLint, TransformFeedback*> TransformFeedbackMap;
\r
612 TransformFeedbackMap mTransformFeedbackMap;
\r
613 gl::NameSpace mTransformFeedbackNameSpace;
\r
615 typedef std::map<GLint, Sampler*> SamplerMap;
\r
616 SamplerMap mSamplerMap;
\r
617 gl::NameSpace mSamplerNameSpace;
\r
619 VertexDataManager *mVertexDataManager;
\r
620 IndexDataManager *mIndexDataManager;
\r
624 bool mInvalidValue;
\r
625 bool mInvalidOperation;
\r
627 bool mInvalidFramebufferOperation;
\r
629 bool mHasBeenCurrent;
\r
631 unsigned int mAppliedProgramSerial;
\r
633 // state caching flags
\r
634 bool mDepthStateDirty;
\r
635 bool mMaskStateDirty;
\r
636 bool mPixelPackingStateDirty;
\r
637 bool mBlendStateDirty;
\r
638 bool mStencilStateDirty;
\r
639 bool mPolygonOffsetStateDirty;
\r
640 bool mSampleStateDirty;
\r
641 bool mFrontFaceDirty;
\r
642 bool mDitherStateDirty;
\r
645 ResourceManager *mResourceManager;
\r
649 #endif // INCLUDE_CONTEXT_H_
\r