summaryrefslogtreecommitdiffstats
path: root/gfx/angle/src/libANGLE/ContextState.h
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-07-11 18:11:13 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-07-11 18:11:13 +0200
commit4f2ecd53a9daaf88bb7d075745eefb6e2e4741e0 (patch)
treef000dd831240707a03b8c806db292c2a15cde3ce /gfx/angle/src/libANGLE/ContextState.h
parent3b7ffb477eec078c7036c92c6a51bb5de6de4f28 (diff)
downloadUXP-4f2ecd53a9daaf88bb7d075745eefb6e2e4741e0.tar
UXP-4f2ecd53a9daaf88bb7d075745eefb6e2e4741e0.tar.gz
UXP-4f2ecd53a9daaf88bb7d075745eefb6e2e4741e0.tar.lz
UXP-4f2ecd53a9daaf88bb7d075745eefb6e2e4741e0.tar.xz
UXP-4f2ecd53a9daaf88bb7d075745eefb6e2e4741e0.zip
Roll back to ANGLE/2845
Diffstat (limited to 'gfx/angle/src/libANGLE/ContextState.h')
-rwxr-xr-xgfx/angle/src/libANGLE/ContextState.h57
1 files changed, 32 insertions, 25 deletions
diff --git a/gfx/angle/src/libANGLE/ContextState.h b/gfx/angle/src/libANGLE/ContextState.h
index 494c1a3da..ecb3759f4 100755
--- a/gfx/angle/src/libANGLE/ContextState.h
+++ b/gfx/angle/src/libANGLE/ContextState.h
@@ -11,35 +11,51 @@
#include "common/angleutils.h"
#include "libANGLE/State.h"
-#include "libANGLE/Version.h"
namespace gl
{
class ValidationContext;
class ContextState;
-static constexpr Version ES_2_0 = Version(2, 0);
-static constexpr Version ES_3_0 = Version(3, 0);
-static constexpr Version ES_3_1 = Version(3, 1);
+class GLVersion final : angle::NonCopyable
+{
+ public:
+ GLVersion(GLint clientMajorVersion, GLint clientMinorVersion)
+ : mClientMajorVersion(clientMajorVersion), mClientMinorVersion(clientMinorVersion)
+ {
+ }
+
+ GLint getClientMajorVersion() const { return mClientMajorVersion; }
+ GLint getClientMinorVersion() const { return mClientMinorVersion; }
+
+ bool isES2() const { return mClientMajorVersion == 2; }
+ bool isES3() const { return mClientMajorVersion == 3 && mClientMinorVersion == 0; }
+ bool isES31() const { return mClientMajorVersion == 3 && mClientMinorVersion == 1; }
+ bool isES3OrGreater() const { return mClientMajorVersion >= 3; }
+
+ private:
+ GLint mClientMajorVersion;
+ GLint mClientMinorVersion;
+};
class ContextState final : public angle::NonCopyable
{
public:
ContextState(uintptr_t context,
- const Version &clientVersion,
+ GLint clientMajorVersion,
+ GLint clientMinorVersion,
State *state,
const Caps &caps,
const TextureCapsMap &textureCaps,
const Extensions &extensions,
const ResourceManager *resourceManager,
- const Limitations &limitations,
- const ResourceMap<Framebuffer> &framebufferMap);
+ const Limitations &limitations);
~ContextState();
uintptr_t getContext() const { return mContext; }
- GLint getClientMajorVersion() const { return mClientVersion.major; }
- GLint getClientMinorVersion() const { return mClientVersion.minor; }
- const Version &getClientVersion() const { return mClientVersion; }
+ GLint getClientMajorVersion() const { return mGLVersion.getClientMajorVersion(); }
+ GLint getClientMinorVersion() const { return mGLVersion.getClientMinorVersion(); }
+ const GLVersion &getGLVersion() const { return mGLVersion; }
const State &getState() const { return *mState; }
const Caps &getCaps() const { return mCaps; }
const TextureCapsMap &getTextureCaps() const { return mTextureCaps; }
@@ -53,7 +69,7 @@ class ContextState final : public angle::NonCopyable
friend class Context;
friend class ValidationContext;
- Version mClientVersion;
+ GLVersion mGLVersion;
uintptr_t mContext;
State *mState;
const Caps &mCaps;
@@ -61,29 +77,28 @@ class ContextState final : public angle::NonCopyable
const Extensions &mExtensions;
const ResourceManager *mResourceManager;
const Limitations &mLimitations;
- const ResourceMap<Framebuffer> &mFramebufferMap;
};
class ValidationContext : angle::NonCopyable
{
public:
- ValidationContext(const Version &clientVersion,
+ ValidationContext(GLint clientMajorVersion,
+ GLint clientMinorVersion,
State *state,
const Caps &caps,
const TextureCapsMap &textureCaps,
const Extensions &extensions,
const ResourceManager *resourceManager,
const Limitations &limitations,
- const ResourceMap<Framebuffer> &framebufferMap,
bool skipValidation);
virtual ~ValidationContext() {}
virtual void handleError(const Error &error) = 0;
const ContextState &getContextState() const { return mState; }
- GLint getClientMajorVersion() const { return mState.getClientMajorVersion(); }
- GLint getClientMinorVersion() const { return mState.getClientMinorVersion(); }
- const Version &getClientVersion() const { return mState.getClientVersion(); }
+ int getClientMajorVersion() const { return mState.getClientMajorVersion(); }
+ int getClientMinorVersion() const { return mState.getClientMinorVersion(); }
+ const GLVersion &getGLVersion() const { return mState.mGLVersion; }
const State &getGLState() const { return mState.getState(); }
const Caps &getCaps() const { return mState.getCaps(); }
const TextureCapsMap &getTextureCaps() const { return mState.getTextureCaps(); }
@@ -95,14 +110,6 @@ class ValidationContext : angle::NonCopyable
bool getQueryParameterInfo(GLenum pname, GLenum *type, unsigned int *numParams);
bool getIndexedQueryParameterInfo(GLenum target, GLenum *type, unsigned int *numParams);
- Program *getProgram(GLuint handle) const;
- Shader *getShader(GLuint handle) const;
-
- bool isTextureGenerated(GLuint texture) const;
- bool isBufferGenerated(GLuint buffer) const;
- bool isRenderbufferGenerated(GLuint renderbuffer) const;
- bool isFramebufferGenerated(GLuint framebuffer) const;
-
protected:
ContextState mState;
bool mSkipValidation;