Commit fceb1837 by Alexis Hetu Committed by Alexis Hétu

Adding some GLES 3.0 specific enums

This cl doesn't actually do anything, but we need to establish exactly how to add new GLES 3.0 specific cases in Swift Shader. Change-Id: I7f31ea98e0d24f71204a3e1a7a31bf3379741e15 Reviewed-on: https://swiftshader-review.googlesource.com/2560Reviewed-by: 's avatarNicolas Capens <capn@google.com> Tested-by: 's avatarAlexis Hétu <sugoi@google.com>
parent b1e911ad
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#define GL_APICALL #define GL_APICALL
#include <GLES2/gl2.h> #include <GLES2/gl2.h>
#include <GLES2/gl2ext.h> #include <GLES2/gl2ext.h>
#include <GLES3/gl3.h>
#define EGLAPI #define EGLAPI
#include <EGL/egl.h> #include <EGL/egl.h>
...@@ -87,6 +88,18 @@ const GLenum compressedTextureFormats[] = ...@@ -87,6 +88,18 @@ const GLenum compressedTextureFormats[] =
GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE, GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE,
GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE, GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE,
#endif #endif
#if (GL_ES_VERSION_3_0)
GL_COMPRESSED_R11_EAC,
GL_COMPRESSED_SIGNED_R11_EAC,
GL_COMPRESSED_RG11_EAC,
GL_COMPRESSED_SIGNED_RG11_EAC,
GL_COMPRESSED_RGB8_ETC2,
GL_COMPRESSED_SRGB8_ETC2,
GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,
GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,
GL_COMPRESSED_RGBA8_ETC2_EAC,
GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,
#endif
}; };
const GLint NUM_COMPRESSED_TEXTURE_FORMATS = sizeof(compressedTextureFormats) / sizeof(compressedTextureFormats[0]); const GLint NUM_COMPRESSED_TEXTURE_FORMATS = sizeof(compressedTextureFormats) / sizeof(compressedTextureFormats[0]);
...@@ -208,6 +221,8 @@ struct State ...@@ -208,6 +221,8 @@ struct State
bool sampleCoverageInvert; bool sampleCoverageInvert;
bool scissorTest; bool scissorTest;
bool dither; bool dither;
bool primitiveRestartFixedIndex;
bool rasterizerDiscard;
GLfloat lineWidth; GLfloat lineWidth;
...@@ -302,6 +317,12 @@ public: ...@@ -302,6 +317,12 @@ public:
void setDither(bool enabled); void setDither(bool enabled);
bool isDitherEnabled() const; bool isDitherEnabled() const;
void setPrimitiveRestartFixedIndex(bool enabled);
bool isPrimitiveRestartFixedIndexEnabled() const;
void setRasterizerDiscard(bool enabled);
bool isRasterizerDiscardEnabled() const;
void setLineWidth(GLfloat width); void setLineWidth(GLfloat width);
void setGenerateMipmapHint(GLenum hint); void setGenerateMipmapHint(GLenum hint);
...@@ -409,6 +430,7 @@ public: ...@@ -409,6 +430,7 @@ public:
bool getFloatv(GLenum pname, GLfloat *params); bool getFloatv(GLenum pname, GLfloat *params);
bool getIntegerv(GLenum pname, GLint *params); bool getIntegerv(GLenum pname, GLint *params);
bool getBooleanv(GLenum pname, GLboolean *params); bool getBooleanv(GLenum pname, GLboolean *params);
bool getTransformFeedbackiv(GLuint xfb, GLenum pname, GLint *param);
bool getQueryParameterInfo(GLenum pname, GLenum *type, unsigned int *numParams); bool getQueryParameterInfo(GLenum pname, GLenum *type, unsigned int *numParams);
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#define GL_APICALL #define GL_APICALL
#include <GLES2/gl2.h> #include <GLES2/gl2.h>
#include <GLES2/gl2ext.h> #include <GLES2/gl2ext.h>
#include <GLES3/gl3.h>
#include <exception> #include <exception>
#include <limits> #include <limits>
...@@ -1628,6 +1629,8 @@ void GL_APIENTRY glDisable(GLenum cap) ...@@ -1628,6 +1629,8 @@ void GL_APIENTRY glDisable(GLenum cap)
case GL_DEPTH_TEST: context->setDepthTest(false); break; case GL_DEPTH_TEST: context->setDepthTest(false); break;
case GL_BLEND: context->setBlend(false); break; case GL_BLEND: context->setBlend(false); break;
case GL_DITHER: context->setDither(false); break; case GL_DITHER: context->setDither(false); break;
case GL_PRIMITIVE_RESTART_FIXED_INDEX: context->setPrimitiveRestartFixedIndex(false); break;
case GL_RASTERIZER_DISCARD: context->setRasterizerDiscard(false); break;
default: default:
return error(GL_INVALID_ENUM); return error(GL_INVALID_ENUM);
} }
...@@ -1715,6 +1718,8 @@ void GL_APIENTRY glEnable(GLenum cap) ...@@ -1715,6 +1718,8 @@ void GL_APIENTRY glEnable(GLenum cap)
case GL_DEPTH_TEST: context->setDepthTest(true); break; case GL_DEPTH_TEST: context->setDepthTest(true); break;
case GL_BLEND: context->setBlend(true); break; case GL_BLEND: context->setBlend(true); break;
case GL_DITHER: context->setDither(true); break; case GL_DITHER: context->setDither(true); break;
case GL_PRIMITIVE_RESTART_FIXED_INDEX: context->setPrimitiveRestartFixedIndex(true); break;
case GL_RASTERIZER_DISCARD: context->setRasterizerDiscard(true); break;
default: default:
return error(GL_INVALID_ENUM); return error(GL_INVALID_ENUM);
} }
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#define GL_APICALL #define GL_APICALL
#include <GLES2/gl2.h> #include <GLES2/gl2.h>
#include <GLES2/gl2ext.h> #include <GLES2/gl2ext.h>
#include <GLES3/gl3.h>
namespace es2 namespace es2
{ {
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
// All rights reserved. No part of this software may be copied, distributed, transmitted, // All rights reserved. No part of this software may be copied, distributed, transmitted,
// transcribed, stored in a retrieval system, translated into any human or computer // transcribed, stored in a retrieval system, translated into any human or computer
// language by any means, or disclosed to third parties without the explicit written // language by any means, or disclosed to third parties without the explicit written
// agreement of TransGaming Inc. Without such an agreement, no rights or licenses, express // agreement of Google Inc. Without such an agreement, no rights or licenses, express
// or implied, including but not limited to any patent rights, are granted to you. // or implied, including but not limited to any patent rights, are granted to you.
// //
// libRAD.cpp: Implements the exported Radiance functions. // libRAD.cpp: Implements the exported Radiance functions.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment