[Piglit] [PATCH 3/3] egl_khr_create_context: Test the debug flag
Chad Versace
chad.versace at linux.intel.com
Tue Oct 1 15:51:03 PDT 2013
On 10/01/2013 02:48 PM, Matt Turner wrote:
> On Fri, Sep 20, 2013 at 7:02 PM, Chad Versace
> <chad.versace at linux.intel.com> wrote:
>> Test eglCreateContext with with EGL_CONTEXT_OPENGL_BIT_KHR set for GL,
>> GLES1, GLES2, and GLES3. If context creation succeeds, then verify the
>> context is really a debug context by verifying GL_CONTEXT_FLAGS contains
>> GL_CONTEXT_FLAG_DEBUG_BIT. If context creation fails, then verify that
>> EGL_BAD_MATCH is emitted.
>>
>> On Mesa 9.2 with Intel Haswell, the GL test passes, but the GLES tests fail
>> because eglCreateContext emits EGL_BAD_ATTRIBUTE.
>>
>> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=69624
>> Signed-off-by: Chad Versace <chad.versace at linux.intel.com>
>> ---
>> tests/all.tests | 2 +
>> .../spec/egl_khr_create_context/CMakeLists.gl.txt | 1 +
>> .../spec/egl_khr_create_context/valid-flag-debug.c | 184 +++++++++++++++++++++
>> 3 files changed, 187 insertions(+)
>> create mode 100644 tests/egl/spec/egl_khr_create_context/valid-flag-debug.c
>> +#include "piglit-util-egl.h"
>> +#include "piglit-util-gl-common.h"
>> +#include "common.h"
>> +
>> +const char *usage = "%s gl|gles1|gles2|gles3\n";
>
> I don't like seeing printf format specifiers in strings like this.
> Since usage is only used once, just inline the string into the fprintf
> call.
Will fix in v2.
>> + switch (context_bit) {
>> + case EGL_OPENGL_BIT:
>> + dispatch_api = PIGLIT_DISPATCH_GL;
>> + break;
>> + case EGL_OPENGL_ES_BIT:
>> + dispatch_api = PIGLIT_DISPATCH_ES1;
>
> piglit doesn't actually have ES1 dispatch. Is this a problem?
>
> With the one fix and assuming this isn't a problem,
>
> Reviewed-by: Matt Turner <mattst88 at gmail.com>
Argh. The lack of ES1 dispatch makes the test skip on ES1. Oops.
Seeing that the only GL functions used here are glGetString and glGetIntegerv,
I think it's safe to lie to piglit_dispatch_init by requesting ES2 dispatch.
I tried this, and it worked for me. What do you think?
v2 coming now, with the lie.
More information about the Piglit
mailing list