[Piglit] [PATCH] es2_compat: run glReleaseShaderCompiler and use a builtin

Ilia Mirkin imirkin at alum.mit.edu
Sun Feb 7 15:09:15 UTC 2016


On Sun, Feb 7, 2016 at 4:23 AM, Timothy Arceri <t_arceri at yahoo.com.au> wrote:
> On Sat, 2016-02-06 at 15:35 -0500, Ilia Mirkin wrote:
>> All that mesa does when releasing the shader compiler is clear its
>> builtins list. So make sure to use a builtin, and release the
>> compiler
>> sooner, to trigger a bug in mesa.
>>
>> This code sequence is hit by some core Android component.
>>
>> Reported-by: Rob Herring <robh at kernel.org>
>> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
>> ---
>>  .../arb_es2_compatibility-
>> releaseshadercompiler.c                     | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/tests/spec/arb_es2_compatibility/arb_es2_compatibility-
>> releaseshadercompiler.c
>> b/tests/spec/arb_es2_compatibility/arb_es2_compatibility-
>> releaseshadercompiler.c
>> index b5c476e..0abdb5d 100644
>> --- a/tests/spec/arb_es2_compatibility/arb_es2_compatibility-
>> releaseshadercompiler.c
>> +++ b/tests/spec/arb_es2_compatibility/arb_es2_compatibility-
>> releaseshadercompiler.c
>> @@ -55,7 +55,7 @@ static const char fs_text[] =
>>       "#version 100\n"
>>       "uniform mediump vec4 color;\n"
>>       "void main () {\n"
>> -     "    gl_FragColor = color;\n"
>> +     "    gl_FragColor = clamp(color, vec4(0), vec4(1));\n"
>>       "}\n"
>>       ;
>>
>> @@ -67,6 +67,7 @@ draw(const float *color, float x_offset)
>>       GLint offset_location;
>>
>>       prog = piglit_build_simple_program(vs_text, fs_text);
>> +     glReleaseShaderCompiler();
>>
>>       glBindAttribLocation(prog, 0, "vertex");
>>       glLinkProgram(prog);
>> @@ -92,7 +93,6 @@ piglit_display(void)
>>       float blue[] = {0.0, 0.0, 1.0, 0.0};
>>
>>       draw(green, 0.0f);
>> -     glReleaseShaderCompiler();
>>       draw(blue, 1.0f);
>>
>>       pass &= piglit_probe_pixel_rgba(piglit_width / 4,
>> piglit_height / 2,
>
>
> I really think this should be a new subtest rather then moving things
> around in the existing test. It's not clear at all that you are testing
> that builtins still work from just looking at the code after the
> change.
>
> Also it no longer checks for:
>
> glReleaseShaderCompiler()
> glCompileShader()
>
> Its now only checking:
>
> glReleaseShaderCompiler()
> glLinkProgram()
> glCompileShader()
>
> Which seems could make a difference.

OK, I'll test both sequences. Subtests don't really make a lot of
sense here... the failure mode was a crash. Take a look at my v2 and
see if you like it.


More information about the Piglit mailing list