On 21/10/16 05:55, Timothy Arceri wrote: > On Thu, 2016-10-20 at 12:37 +0200, Samuel Iglesias Gonsálvez wrote: >> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97804 >> Signed-off-by: Samuel Iglesias Gonsálvez <[email protected]> >> --- >> ...t-precision-qualifier-redeclaration.shader_test | 34 >> ++++++++++++++++++++++ >> 1 file changed, 34 insertions(+) >> create mode 100644 tests/spec/glsl-es-1.00/linker/glsl-default- >> precision-qualifier-redeclaration.shader_test >> >> diff --git a/tests/spec/glsl-es-1.00/linker/glsl-default-precision- >> qualifier-redeclaration.shader_test b/tests/spec/glsl-es- >> 1.00/linker/glsl-default-precision-qualifier- >> redeclaration.shader_test >> new file mode 100644 >> index 0000000..510ba20 >> --- /dev/null >> +++ b/tests/spec/glsl-es-1.00/linker/glsl-default-precision- >> qualifier-redeclaration.shader_test >> @@ -0,0 +1,34 @@ >> +# >> +# Test that vertex shader defaults to highp (only fragment shader >> +# needs to specify float precision) and that later fragment shader >> +# highp precision declaration overrides earlier mediump declaration. >> +# >> +[require] >> +GL ES >= 2.0 >> +GLSL ES >= 1.00 >> + >> +[vertex shader] >> + >> +uniform float a; >> + >> +void main(void) >> +{ >> + gl_Position = vec4(a); >> +} >> + >> +[fragment shader] >> +#ifdef GL_ES >> +precision mediump float; >> +#endif >> +#ifdef GL_ES >> +precision highp float; >> +#endif > > The test is fine but I believe we need more tests for the scoping > rules. > > "The precision statement has the same scoping rules as variable > declarations. If it is declared inside a compound statement, its effect > stops at the end of the innermost > statement it was declared in. Precision statements in nested scopes > override precision statements in outer > scopes. Multiple precision statements for the same basic type can > appear inside the same scope, with later > statements overriding earlier statements within that scope" > > This test only tests the last rule. >
Thanks Timothy. I will write more tests to check the scoping rules.
Sam
>> +
>> +uniform float a;
>> +
>> +void main(void)
>> +{
>> + gl_FragColor = vec4(a);
>> +}
>> +[test]
>> +link success
>
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Piglit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/piglit
