[Piglit] [PATCH 2/2] egl_khr_create_context: profile attributes are never invalid for Desktop GL
Matt Turner
mattst88 at gmail.com
Thu Oct 4 10:53:45 PDT 2012
The EGL_KHR_create_context spec says:
"If the requested OpenGL version is less than 3.2,
EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR is ignored and the functionality
of the context is determined solely by the requested version."
---
.../egl_khr_create_context/invalid-attribute-gl.c | 43 --------------------
1 files changed, 0 insertions(+), 43 deletions(-)
diff --git a/tests/egl/spec/egl_khr_create_context/invalid-attribute-gl.c b/tests/egl/spec/egl_khr_create_context/invalid-attribute-gl.c
index 0c71e81..b99dee8 100644
--- a/tests/egl/spec/egl_khr_create_context/invalid-attribute-gl.c
+++ b/tests/egl/spec/egl_khr_create_context/invalid-attribute-gl.c
@@ -25,14 +25,8 @@
static bool try_attribute(int attribute)
{
- /* If the attribute is EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR, use a valid
- * value for that attribute. This ensures that the attribute is
- * rejected for the correct reason.
- */
const EGLint attribs[] = {
attribute,
- (attribute == EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR)
- ? EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR : 0,
EGL_NONE
};
bool pass = true;
@@ -66,7 +60,6 @@ int main(int argc, char **argv)
};
bool pass = true;
unsigned i;
- int gl_version;
if (!EGL_KHR_create_context_setup(EGL_OPENGL_BIT)) {
fprintf(stderr, "Desktop GL not available.\n");
@@ -78,42 +71,6 @@ int main(int argc, char **argv)
pass = try_attribute(bad_attributes[i]) && pass;
}
- /* Create a context so that we can determine the GL version. */
- ctx = eglCreateContext(egl_dpy, cfg, EGL_NO_CONTEXT, NULL);
- if (ctx == EGL_NO_CONTEXT) {
- fprintf(stderr, "eglCreateContext() failed\n");
- piglit_report_result(PIGLIT_FAIL);
- }
-
- if (!eglMakeCurrent(egl_dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, ctx)) {
- fprintf(stderr, "eglMakeCurrent() failed\n");
- piglit_report_result(PIGLIT_FAIL);
- }
-
- piglit_dispatch_default_init();
-
- gl_version = piglit_get_gl_version();
-
- eglMakeCurrent(egl_dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
- eglDestroyContext(egl_dpy, ctx);
-
- /* The EGL_KHR_create_context spec says:
- *
- * "* If an OpenGL context is requested, the requested version is
- * greater than [sic] 3.2, and the value for attribute
- * EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR has no bits set; has any bits set
- * other than EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR and
- * EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR; has more than one of
- * these bits set; or if the implementation does not support the
- * requested profile, then an EGL_BAD_PROFILE_KHR error is
- * generated."
- */
-
- if (gl_version >= 32) {
- pass = try_attribute(EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR)
- && pass;
- }
-
EGL_KHR_create_context_teardown();
piglit_report_result(pass ? PIGLIT_PASS : PIGLIT_FAIL);
--
1.7.8.6
More information about the Piglit
mailing list