diff options
Diffstat (limited to 'tests/util/piglit-framework-gl.h')
-rw-r--r-- | tests/util/piglit-framework-gl.h | 88 |
1 files changed, 86 insertions, 2 deletions
diff --git a/tests/util/piglit-framework-gl.h b/tests/util/piglit-framework-gl.h index bfb971eb3..3ac084905 100644 --- a/tests/util/piglit-framework-gl.h +++ b/tests/util/piglit-framework-gl.h @@ -55,10 +55,94 @@ enum piglit_gl_visual { * This is named piglit_gl_test_config, rather than piglit_test_config, in * order to distinguish it from other test types, such as EGL and GLX tests. * - * TODO: Add fields here that declare test requirements on GL context - * TODO: flavor, extensions, and window system. + * At least one of the `supports` fields must be set. + * + * If `supports_gl_core_version` and `supports_gl_compat_version` are both + * set, then Piglit will first attempt to run the test under a GL core context + * of the requested version. If context creation fails, then Piglit will then + * attempt to run the test under a GL compatibility context of the requested + * version. */ struct piglit_gl_test_config { + /** + * If this field is non-zero, then the test is able to run under a GL + * core context having at least the given version. + * + * When attempting run a test under a GL core context, Piglit chooses + * a waffle_config with the following attributes set. (Note that + * Waffle ignores the profile attribute for versions less than 3.2). + * - WAFFLE_CONTEXT_PROFILE = WAFFLE_CONTEXT_CORE_PROFILE + * - WAFFLE_CONTEXT_MAJOR_VERSION = supports_gl_core_version / 10 + * - WAFFLE_CONTEXT_MINOR_VERSION = supports_gl_core_version % 10 + * If Piglit fails to acquire the waffle_config or to create the + * waffle_context, then it skips its attempt to run the test under + * a GL core context. + * + * It is an error if this field is less than 3.1 because the concept + * of "core context" does not apply before GL 3.1. + * + * Piglit handles a request for a GL 3.1 core context as a special + * case. As noted above, Waffle ignores the profile attribute when + * choosing a 3.1 config. However, the concept of "core profile" is + * still applicable to 3.1 contexts and is indicated by the context's + * lack of support for the GL_ARB_compatibility extension. Therefore, + * Piglit attempts to run the test under a GL 3.1 core context by + * first creating the context and then skipping the attempt if the + * context supports the GL_ARB_compatibility extension. + * + * If this field is 0, then the test is not able to run under a GL + * core context of any version. + */ + int supports_gl_core_version; + + /** + * If this field is non-zero, then the test is able to run under a GL + * compatibility context having at least the given version. + * + * When attempting run a test under a GL compatibility context, Piglit + * chooses a waffle_config with the following attributes set. (Note + * that Waffle ignores the profile attribute for versions less than + * 3.2). + * - WAFFLE_CONTEXT_PROFILE = WAFFLE_CONTEXT_COMPATIBILITY_PROFILE + * - WAFFLE_CONTEXT_MAJOR_VERSION = supports_gl_core_version / 10 + * - WAFFLE_CONTEXT_MINOR_VERSION = supports_gl_core_version % 10 + * If Piglit fails to acquire the waffle_config or to create the + * waffle_context, then it skips its attempt to run the test under + * a GL compatibility context. + * + * Piglit handles a request for a GL 3.1 compatibility context as + * a special case. As noted above, Waffle ignores the profile + * attribute when choosing a 3.1 config. However, the concept of + * "compatibility profile" is still applicable to 3.1 contexts and is + * indicated by the context's support for the GL_ARB_compatibility + * extension. Therefore, Piglit attempts to run under a GL 3.1 + * compatibility context by first creating the context and then + * skipping the attempt if the context lacks the GL_ARB_compatibility + * extension. + * + * Be aware that, if this field is greater than 10, then the test will + * skip on platforms for which specifying a context version is + * unsupported (that is, GLX that lacks GLX_ARB_create_context and EGL + * that lacks EGL_KHR_create_context). If the test requires a GL + * version greater than 1.0, then consider setting this field to 10 + * and checking the GL version from within the test with + * piglit_require_gl_version(). + * + * If this field is 0, then the test is not able to run under a GL + * compatibility context of any version. + */ + int supports_gl_compat_version; + + /** + * The test is able to run under an OpenGL ES1 context. + */ + bool supports_gl_es1; + + /** + * The test is able to run under an OpenGL ES2 context. + */ + bool supports_gl_es2; + int window_width; int window_height; |