Use packed enums for the texture types and targets, part 2
This completes the refactor by using the packed enums in the gl:: layer
and in the backends.
The packed enum code generation is modified to support explicitly
assigning values to the packed enums so that the TextureTarget cube map
faces are in the correct order and easy to iterate over.
BUG=angleproject:2169
Change-Id: I5903235e684ccf382e92a8a1e10c5c85b4b16a04
Reviewed-on: https://chromium-review.googlesource.com/939994
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libANGLE/queryutils.cpp b/src/libANGLE/queryutils.cpp
index 9370f4f..a90545a 100644
--- a/src/libANGLE/queryutils.cpp
+++ b/src/libANGLE/queryutils.cpp
@@ -33,7 +33,7 @@
template <typename ParamType>
void QueryTexLevelParameterBase(const Texture *texture,
- GLenum target,
+ TextureTarget target,
GLint level,
GLenum pname,
ParamType *params)
@@ -848,8 +848,19 @@
break;
case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:
- *params = attachmentObject->cubeMapFace();
- break;
+ {
+ TextureTarget face = attachmentObject->cubeMapFace();
+ if (face != TextureTarget::InvalidEnum)
+ {
+ *params = ToGLenum(attachmentObject->cubeMapFace());
+ }
+ else
+ {
+ // This happens when the attachment isn't a texture cube map face
+ *params = GL_NONE;
+ }
+ }
+ break;
case GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE:
*params = attachmentObject->getRedSize();
@@ -1099,7 +1110,7 @@
}
void QueryTexLevelParameterfv(const Texture *texture,
- GLenum target,
+ TextureTarget target,
GLint level,
GLenum pname,
GLfloat *params)
@@ -1108,7 +1119,7 @@
}
void QueryTexLevelParameteriv(const Texture *texture,
- GLenum target,
+ TextureTarget target,
GLint level,
GLenum pname,
GLint *params)