Add generator for packed GL enums.
For testing this also converts two unimportant GLenums, gl::BufferUsage
and gl::CullModeFace.
BUG=angleproject:2169
Change-Id: If1e86a97d0fed3fd567303aca6506ec579503076
Reviewed-on: https://chromium-review.googlesource.com/688000
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/validationES2.cpp b/src/libANGLE/validationES2.cpp
index 84cbc2a..d073c69 100644
--- a/src/libANGLE/validationES2.cpp
+++ b/src/libANGLE/validationES2.cpp
@@ -4118,7 +4118,7 @@
GLenum target,
GLsizeiptr size,
const void *data,
- GLenum usage)
+ BufferUsage usage)
{
if (size < 0)
{
@@ -4128,17 +4128,17 @@
switch (usage)
{
- case GL_STREAM_DRAW:
- case GL_STATIC_DRAW:
- case GL_DYNAMIC_DRAW:
+ case BufferUsage::StreamDraw:
+ case BufferUsage::StaticDraw:
+ case BufferUsage::DynamicDraw:
break;
- case GL_STREAM_READ:
- case GL_STREAM_COPY:
- case GL_STATIC_READ:
- case GL_STATIC_COPY:
- case GL_DYNAMIC_READ:
- case GL_DYNAMIC_COPY:
+ case BufferUsage::StreamRead:
+ case BufferUsage::StaticRead:
+ case BufferUsage::DynamicRead:
+ case BufferUsage::StreamCopy:
+ case BufferUsage::StaticCopy:
+ case BufferUsage::DynamicCopy:
if (context->getClientMajorVersion() < 3)
{
ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidBufferUsage);
@@ -4795,13 +4795,13 @@
return true;
}
-bool ValidateCullFace(ValidationContext *context, GLenum mode)
+bool ValidateCullFace(ValidationContext *context, CullFaceMode mode)
{
switch (mode)
{
- case GL_FRONT:
- case GL_BACK:
- case GL_FRONT_AND_BACK:
+ case CullFaceMode::Front:
+ case CullFaceMode::Back:
+ case CullFaceMode::FrontAndBack:
break;
default: