[Piglit] [PATCH 2/4] util, shader_runner: random fixes for compatibility profile

Marek Olšák maraeo at gmail.com
Tue Oct 24 19:30:45 UTC 2017


On Mon, Oct 23, 2017 at 2:49 PM, Ilia Mirkin <imirkin at alum.mit.edu> wrote:
> On Mon, Oct 23, 2017 at 8:35 AM, Marek Olšák <maraeo at gmail.com> wrote:
>> On Sat, Oct 21, 2017 at 7:59 PM, Ilia Mirkin <imirkin at alum.mit.edu> wrote:
>>> 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.
>>
>> It's pretty unlikely for a GL core test to be affected by a
>> compatibility profile. Compatibility extends Core, not the other way
>> around. Additionally, there is no core profile in GL 3.1. If you only
>> have GL 3.1, you can't choose the profile (barring the
>> forward-compatible flag).
>
> The trivial example is "make sure that compat feature is not available
> in core profile".

That's already guaranteed for GL >= 3.2 and CONTEXT_GL_CORE. If
CONTEXT_GL_CORE sets the forward compatible flag, it's also guaranteed
for GL 3.1. There is no other way to enforce a core profile.

The context has been created and made current at this point, so the
function has to return.

Marek


More information about the Piglit mailing list