[Piglit] [PATCH 2/4] util, shader_runner: random fixes for compatibility profile
Ilia Mirkin
imirkin at alum.mit.edu
Sat Oct 21 17:59:35 UTC 2017
On Sat, Oct 21, 2017 at 8:55 AM, Marek Olšák <maraeo at gmail.com> wrote:
> From: Marek Olšák <marek.olsak at amd.com>
>
> ---
> tests/shaders/shader_runner.c | 2 +-
> tests/util/piglit-framework-gl/piglit_wfl_framework.c | 7 ++++++-
> 2 files changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
> index 625521c..31bd315 100644
> --- a/tests/shaders/shader_runner.c
> +++ b/tests/shaders/shader_runner.c
> @@ -2786,21 +2786,21 @@ program_must_be_in_use(void)
> } else if (!prog_in_use) {
> fprintf(stderr, "Failed to use program: %s\n", prog_err_info);
> return PIGLIT_FAIL;
> }
> return PIGLIT_PASS;
> }
>
> static void
> bind_vao_if_supported()
> {
> - if (vao == 0 && gl_version.num >= 31) {
> + if (vao == 0 && piglit_is_core_profile) {
> glGenVertexArrays(1, &vao);
> glBindVertexArray(vao);
> }
> }
>
> static enum piglit_result
> draw_arrays_common(int first, size_t count)
> {
> enum piglit_result result = program_must_be_in_use();
> if (first < 0) {
> diff --git a/tests/util/piglit-framework-gl/piglit_wfl_framework.c b/tests/util/piglit-framework-gl/piglit_wfl_framework.c
> index 5968459..20b9c45 100644
> --- a/tests/util/piglit-framework-gl/piglit_wfl_framework.c
> +++ b/tests/util/piglit-framework-gl/piglit_wfl_framework.c
> @@ -533,21 +533,26 @@ make_context_current(struct piglit_wfl_framework *wfl_fw,
> {
> bool ok = false;
>
> #if defined(PIGLIT_USE_OPENGL)
>
> if (test_config->supports_gl_core_version) {
> ok = make_context_current_singlepass(wfl_fw, test_config,
> CONTEXT_GL_CORE,
> partial_config_attrib_list);
> if (ok) {
> - piglit_is_core_profile = true;
> + /* OpenGL 3.1 is special. It doesn't have
> + * a compatibility profile, but it can have
> + * ARB_compatibility.
> + */
> + piglit_is_core_profile =
> + !piglit_is_extension_supported("GL_ARB_compatibility");
Presumably a test that wants a core context wouldn't be happy with GL
3.1 + GL_ARB_compatibility. IMHO only do the return when
piglit_is_core_profile == true.
> return;
> }
> }
>
> piglit_is_core_profile = false;
>
> if (test_config->supports_gl_core_version &&
> test_config->supports_gl_compat_version) {
> /* The above attempt to create a core context failed. */
> printf("piglit: info: Falling back to GL %d.%d "
> --
> 2.7.4
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit
More information about the Piglit
mailing list