ES31: Implement glSampleMaski on OpenGL
This patch intends to implement glSampleMaski on OpenGL
backends.
Refers to: https://chromium-review.googlesource.com/c/487603
BUG=angleproject:1592
TEST=dEQP-GLES31.functional.state_query.*.sample_mask*
TEST=dEQP-GLES31.functional.texture.multisample.*.sample_mask*
Change-Id: If5ddd6ab57259593919a482be80fbdbe29f6f54d
Reviewed-on: https://chromium-review.googlesource.com/573727
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libANGLE/validationES31.cpp b/src/libANGLE/validationES31.cpp
index 40f59e7..63f5c59 100644
--- a/src/libANGLE/validationES31.cpp
+++ b/src/libANGLE/validationES31.cpp
@@ -1312,4 +1312,21 @@
return true;
}
+bool ValidateSampleMaski(Context *context, GLuint maskNumber)
+{
+ if (context->getClientVersion() < ES_3_1)
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required);
+ return false;
+ }
+
+ if (maskNumber >= context->getCaps().maxSampleMaskWords)
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidSampleMaskNumber);
+ return false;
+ }
+
+ return true;
+}
+
} // namespace gl