GLES1: Fixes for Gets() test
- Fixed wrong face parameter for glGetMaterial*.
- Enabled GL_LINE_SMOOTH capability in state only (no rendering yet)
- Enabled logical operation capability in state only (no rendering yet)
- Fixed wrong handling of GL_RGB/ALPHA_SCALE and
GL_POINT_COORD_REPLACE_OES
Test: Enable and pass Gets() GLES1 conformance test
BUG=angleproject:2306
Change-Id: Ib5c50a2055129b76ad24053baf0dac24dcc00761
Reviewed-on: https://chromium-review.googlesource.com/1176161
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Lingfeng Yang <lfy@google.com>
diff --git a/src/libANGLE/validationES1.cpp b/src/libANGLE/validationES1.cpp
index e2e158c..6967a6c 100644
--- a/src/libANGLE/validationES1.cpp
+++ b/src/libANGLE/validationES1.cpp
@@ -239,14 +239,6 @@
MaterialParameter pname,
const GLfloat *params)
{
- ANGLE_VALIDATE_IS_GLES1(context);
-
- if (face != GL_FRONT_AND_BACK)
- {
- ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidMaterialFace);
- return false;
- }
-
switch (pname)
{
case MaterialParameter::Ambient:
@@ -267,12 +259,43 @@
}
}
+bool ValidateMaterialSetting(Context *context,
+ GLenum face,
+ MaterialParameter pname,
+ const GLfloat *params)
+{
+ ANGLE_VALIDATE_IS_GLES1(context);
+
+ if (face != GL_FRONT_AND_BACK)
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidMaterialFace);
+ return false;
+ }
+
+ return ValidateMaterialCommon(context, face, pname, params);
+}
+
+bool ValidateMaterialQuery(Context *context, GLenum face, MaterialParameter pname)
+{
+ ANGLE_VALIDATE_IS_GLES1(context);
+
+ if (face != GL_FRONT && face != GL_BACK)
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidMaterialFace);
+ return false;
+ }
+
+ GLfloat dummyParams[4] = {0.0f, 0.0f, 0.0f, 0.0f};
+
+ return ValidateMaterialCommon(context, face, pname, dummyParams);
+}
+
bool ValidateMaterialSingleComponent(Context *context,
GLenum face,
MaterialParameter pname,
GLfloat param)
{
- if (!ValidateMaterialCommon(context, face, pname, ¶m))
+ if (!ValidateMaterialSetting(context, face, pname, ¶m))
{
return false;
}
@@ -800,14 +823,12 @@
bool ValidateGetMaterialfv(Context *context, GLenum face, MaterialParameter pname, GLfloat *params)
{
- GLfloat dummyParams[4] = {0.0f, 0.0f, 0.0f, 0.0f};
- return ValidateMaterialCommon(context, face, pname, dummyParams);
+ return ValidateMaterialQuery(context, face, pname);
}
bool ValidateGetMaterialxv(Context *context, GLenum face, MaterialParameter pname, GLfixed *params)
{
- GLfloat dummyParams[4] = {0.0f, 0.0f, 0.0f, 0.0f};
- return ValidateMaterialCommon(context, face, pname, dummyParams);
+ return ValidateMaterialQuery(context, face, pname);
}
bool ValidateGetPointerv(Context *context, GLenum pname, void **params)
@@ -933,10 +954,32 @@
return true;
}
-bool ValidateLogicOp(Context *context, GLenum opcode)
+bool ValidateLogicOp(Context *context, LogicalOperation opcode)
{
- UNIMPLEMENTED();
- return true;
+ ANGLE_VALIDATE_IS_GLES1(context);
+ switch (opcode)
+ {
+ case LogicalOperation::And:
+ case LogicalOperation::AndInverted:
+ case LogicalOperation::AndReverse:
+ case LogicalOperation::Clear:
+ case LogicalOperation::Copy:
+ case LogicalOperation::CopyInverted:
+ case LogicalOperation::Equiv:
+ case LogicalOperation::Invert:
+ case LogicalOperation::Nand:
+ case LogicalOperation::Noop:
+ case LogicalOperation::Nor:
+ case LogicalOperation::Or:
+ case LogicalOperation::OrInverted:
+ case LogicalOperation::OrReverse:
+ case LogicalOperation::Set:
+ case LogicalOperation::Xor:
+ return true;
+ default:
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidLogicOp);
+ return false;
+ }
}
bool ValidateMaterialf(Context *context, GLenum face, MaterialParameter pname, GLfloat param)
@@ -949,7 +992,7 @@
MaterialParameter pname,
const GLfloat *params)
{
- return ValidateMaterialCommon(context, face, pname, params);
+ return ValidateMaterialSetting(context, face, pname, params);
}
bool ValidateMaterialx(Context *context, GLenum face, MaterialParameter pname, GLfixed param)
@@ -969,7 +1012,7 @@
paramsf[i] = FixedToFloat(params[i]);
}
- return ValidateMaterialCommon(context, face, pname, paramsf);
+ return ValidateMaterialSetting(context, face, pname, paramsf);
}
bool ValidateMatrixMode(Context *context, MatrixType mode)