[Piglit] [PATCH] gen_flat_interpolation_qualifier.py: Adds non-flat interpolation tests generator

Andres Gomez agomez at igalia.com
Mon Apr 4 17:05:43 UTC 2016


This patch provides additional tests for the patch under review at:
https://lists.freedesktop.org/archives/mesa-dev/2016-April/111842.html

Also, this generator provides additional tests for the
ARB_gpu_shader_fp64 extension:
https://www.opengl.org/registry/specs/ARB/gpu_shader_fp64.txt

Which has previous patches for new tests under review at:
https://lists.freedesktop.org/archives/piglit/2016-March/019167.html

This work is complemented with the corresponding bug to add support
for this extension into the i965 shader backend at:
https://bugs.freedesktop.org/show_bug.cgi?id=92760

Br.

On Mon, 2016-04-04 at 20:00 +0300, Andres Gomez wrote:
> Generator for error checking on "flat" keyword.
> 
> This generator adds, additionally, checks for variables inside
> structs
> and interface blocks, which weren't explicitly mentioned in the GLSL
> specs and, partially, in the GLSL ES specs.
> 
> For a discussion about this check
> https://lists.freedesktop.org/archives/mesa-dev/2016-March/109117.htm
> l
> and Khronos bug #15671.
> 
> Also, removed 8 redundant tests replaced by the generator.
> 
> Signed-off-by: Andres Gomez <agomez at igalia.com>
> ---
>  generated_tests/CMakeLists.txt                     |   7 +
>  .../gen_flat_interpolation_qualifier.py            | 170
> +++++++++++++++++++++
>  .../gen_flat_interpolation_qualifier/compiler.mako |  98
> ++++++++++++
>  .../template.frag.mako                             |  60 ++++++++
>  .../nonflat-int-array.frag                         |  31 ----
>  .../interpolation-qualifiers/nonflat-int.frag      |  26 ----
>  .../interpolation-qualifiers/nonflat-ivec4.frag    |  26 ----
>  .../interpolation-qualifiers/nonflat-uint.frag     |  26 ----
>  .../interpolation-qualifiers/nonflat-uvec4.frag    |  26 ----
>  .../nonflat-int-array.frag                         |  22 ---
>  .../interpolation-qualifiers/nonflat-int.frag      |  22 ---
>  .../interpolation-qualifiers/nonflat-ivec4.frag    |  22 ---
>  .../interpolation-qualifiers/nonflat-uint.frag     |  22 ---
>  .../interpolation-qualifiers/nonflat-uvec4.frag    |  22 ---
>  .../varying-struct-nonflat-int.frag                |  29 ----
>  .../varying-struct-nonflat-uint.frag               |  29 ----
>  16 files changed, 335 insertions(+), 303 deletions(-)
>  create mode 100644
> generated_tests/gen_flat_interpolation_qualifier.py
>  create mode 100644
> generated_tests/templates/gen_flat_interpolation_qualifier/compiler.m
> ako
>  create mode 100644
> generated_tests/templates/gen_flat_interpolation_qualifier/template.f
> rag.mako
>  delete mode 100644 tests/spec/glsl-1.30/compiler/interpolation-
> qualifiers/nonflat-int-array.frag
>  delete mode 100644 tests/spec/glsl-1.30/compiler/interpolation-
> qualifiers/nonflat-int.frag
>  delete mode 100644 tests/spec/glsl-1.30/compiler/interpolation-
> qualifiers/nonflat-ivec4.frag
>  delete mode 100644 tests/spec/glsl-1.30/compiler/interpolation-
> qualifiers/nonflat-uint.frag
>  delete mode 100644 tests/spec/glsl-1.30/compiler/interpolation-
> qualifiers/nonflat-uvec4.frag
>  delete mode 100644 tests/spec/glsl-es-3.00/compiler/interpolation-
> qualifiers/nonflat-int-array.frag
>  delete mode 100644 tests/spec/glsl-es-3.00/compiler/interpolation-
> qualifiers/nonflat-int.frag
>  delete mode 100644 tests/spec/glsl-es-3.00/compiler/interpolation-
> qualifiers/nonflat-ivec4.frag
>  delete mode 100644 tests/spec/glsl-es-3.00/compiler/interpolation-
> qualifiers/nonflat-uint.frag
>  delete mode 100644 tests/spec/glsl-es-3.00/compiler/interpolation-
> qualifiers/nonflat-uvec4.frag
>  delete mode 100644 tests/spec/glsl-es-3.00/compiler/interpolation-
> qualifiers/varying-struct-nonflat-int.frag
>  delete mode 100644 tests/spec/glsl-es-3.00/compiler/interpolation-
> qualifiers/varying-struct-nonflat-uint.frag
> 
> diff --git a/generated_tests/CMakeLists.txt
> b/generated_tests/CMakeLists.txt
> index 569ca21..3c5b11a 100644
> --- a/generated_tests/CMakeLists.txt
> +++ b/generated_tests/CMakeLists.txt
> @@ -124,6 +124,12 @@ piglit_make_generated_tests(
>  	templates/gen_inout_fp64/template.shader_test.mako
>  	)
>  piglit_make_generated_tests(
> +	flat_interpolation_qualifier.list
> +	gen_flat_interpolation_qualifier.py
> +	templates/gen_flat_interpolation_qualifier/compiler.mako
> +	templates/gen_flat_interpolation_qualifier/template.frag.mak
> o
> +	)
> +piglit_make_generated_tests(
>  	shader_precision_tests.list
>  	gen_shader_precision_tests.py
>  	builtin_function.py
> @@ -181,6 +187,7 @@ add_custom_target(gen-gl-tests
>  			builtin_uniform_tests_fp64.list
>  			constant_array_size_tests_fp64.list
>  			inout_fp64.list
> +			flat_interpolation_qualifier.list
>  			shader_precision_tests.list
>  			shader_image_load_store_tests.list
>  			variable_index_read_tests.list
> diff --git a/generated_tests/gen_flat_interpolation_qualifier.py
> b/generated_tests/gen_flat_interpolation_qualifier.py
> new file mode 100644
> index 0000000..2290c3b
> --- /dev/null
> +++ b/generated_tests/gen_flat_interpolation_qualifier.py
> @@ -0,0 +1,170 @@
> +# coding=utf-8
> +#
> +# Copyright © 2016 Intel Corporation
> +#
> +# Permission is hereby granted, free of charge, to any person
> obtaining a
> +# copy of this software and associated documentation files (the
> "Software"),
> +# to deal in the Software without restriction, including without
> limitation
> +# the rights to use, copy, modify, merge, publish, distribute,
> sublicense,
> +# and/or sell copies of the Software, and to permit persons to whom
> the
> +# Software is furnished to do so, subject to the following
> conditions:
> +#
> +# The above copyright notice and this permission notice (including
> the next
> +# paragraph) shall be included in all copies or substantial portions
> of the
> +# Software.
> +#
> +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
> EXPRESS OR
> +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
> MERCHANTABILITY,
> +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT
> SHALL
> +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES
> OR OTHER
> +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
> ARISING
> +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
> OTHER
> +# DEALINGS IN THE SOFTWARE.
> +
> +"""Generate non-flat interpolation qualifier tests."""
> +
> +from __future__ import print_function, division, absolute_import
> +import argparse
> +import os
> +import itertools
> +
> +from templates import template_dir
> +from modules import utils
> +
> +TEMPLATES =
> template_dir(os.path.basename(os.path.splitext(__file__)[0]))
> +
> +INT_TYPES = ['int', 'ivec2', 'ivec3', 'ivec4']
> +
> +UINT_TYPES = ['uint', 'uvec2', 'uvec3', 'uvec4']
> +
> +DOUBLE_TYPES = ['double', 'dvec2', 'dvec3', 'dvec4',
> +                'dmat2', 'dmat2x3', 'dmat2x4',
> +                'dmat3x2', 'dmat3', 'dmat3x4',
> +                'dmat4x2', 'dmat4x3', 'dmat4']
> +
> +def get_dir_name(ver):
> +    """Returns the directory name to save tests given a GLSL
> version."""
> +
> +    assert isinstance(ver, str)
> +    if ver.startswith('GL_'):
> +        feature_dir = ver[3:].lower()
> +    elif ver.endswith(' es'):
> +        feature_dir = 'glsl-es-' + ver[0] + '.' + ver[1:3]
> +    else:
> +        feature_dir = 'glsl-' + ver[0] + '.' + ver[1:]
> +
> +    return os.path.join('spec', feature_dir, 'compiler',
> +                        'flat_interpolation')
> +
> +
> +def generate(type_name, mode, interface_block, struct, array, ver,
> names_only):
> +    """Generate GLSL parser tests."""
> +
> +    assert isinstance(type_name, str)
> +    assert isinstance(mode, str)
> +    assert isinstance(interface_block, bool)
> +    assert isinstance(struct, bool)
> +    assert isinstance(array, bool)
> +    assert isinstance(ver, str)
> +    assert isinstance(names_only, bool)
> +
> +    filename = os.path.join(
> +        get_dir_name(ver),
> +        '{0}{1}{2}{3}-{4}{5}.frag'.format(mode,
> +                                          '-interface_block' if
> interface_block else '',
> +                                          '-struct' if struct else
> '',
> +                                          '-array' if array else '',
> +                                          type_name,
> +                                          '-bad' if mode != 'flat'
> else ''))
> +
> +    print(filename)
> +
> +    if not names_only:
> +        with open(filename, 'w') as test_file:
> +            test_file.write(TEMPLATES.get_template(
> +                'template.frag.mako').render_unicode(
> +                    ver=ver,
> +                    mode=mode,
> +                    type_name=type_name,
> +                    interface_block=interface_block,
> +                    struct=struct,
> +                    array=array))
> +
> +
> +def create_tests(type_names, glsl_vers, names_only):
> +    """Creates combinations for flat qualifier tests."""
> +
> +    assert isinstance(type_names, list)
> +    assert isinstance(glsl_vers, list)
> +    assert isinstance(names_only, bool)
> +
> +    modes = ['flat', 'noperspective', 'smooth', 'default']
> +    interface_blocks = [True, False]
> +    structs = [True, False]
> +    arrays = [True, False]
> +    if not names_only:
> +        for ver in glsl_vers:
> +            utils.safe_makedirs(get_dir_name(ver))
> +
> +    for t_name, mode, interface_block, struct, array, ver in
> itertools.product(type_names,
> +                                                                    
>            modes,
> +                                                                    
>            interface_blocks,
> +                                                                    
>            structs,
> +                                                                    
>            arrays,
> +                                                                    
>            glsl_vers):
> +        if ver.endswith(' es'):
> +            # There is no "noperspective" interpolation mode in GLSL
> ES
> +            if mode == 'noperspective':
> +                continue
> +            # There is no support for arrays in input structs in
> GLSL ES
> +            if struct and array:
> +                continue
> +        # Input interface blocks didn't appear in GLSL until 1.50
> +        if interface_block and ver == '130':
> +            ver = '150'
> +        # Input interface blocks didn't appear in GLSL ES until 3.20
> +        if interface_block and ver == '300 es':
> +            ver = '320 es'
> +        # Input structs weren't allowed until 1.50
> +        if struct and ver == '130':
> +            ver = '150'
> +        yield t_name, mode, interface_block, struct, array, ver,
> names_only
> +
> +
> +def all_tests(names_only):
> +    """Creates all the combinations for flat qualifier tests."""
> +
> +    assert isinstance(names_only, bool)
> +
> +    # We need additional directories for GLSL 150 and GLSL ES 320
> +    if not names_only:
> +        utils.safe_makedirs(get_dir_name('150'))
> +        utils.safe_makedirs(get_dir_name('320 es'))
> +    for test_args in (list(create_tests(INT_TYPES + UINT_TYPES,
> +                                        ['130', '300 es'],
> +                                        names_only))
> +                      + list(create_tests(DOUBLE_TYPES,
> +                                          ['GL_ARB_gpu_shader_fp64',
> '400'],
> +                                          names_only))):
> +        yield test_args
> +
> +
> +def main():
> +    """Main function."""
> +
> +    parser = argparse.ArgumentParser(
> +        description="Generate non-flat interpolation qualifier tests
> with fp64 types")
> +    parser.add_argument(
> +        '--names-only',
> +        dest='names_only',
> +        action='store_true',
> +        default=False,
> +        help="Don't output files, just generate a list of filenames
> to stdout")
> +    args = parser.parse_args()
> +
> +    for test_args in all_tests(args.names_only):
> +        generate(*test_args)
> +
> +
> +if __name__ == '__main__':
> +    main()
> diff --git
> a/generated_tests/templates/gen_flat_interpolation_qualifier/compiler
> .mako
> b/generated_tests/templates/gen_flat_interpolation_qualifier/compiler
> .mako
> new file mode 100644
> index 0000000..eb6117f
> --- /dev/null
> +++
> b/generated_tests/templates/gen_flat_interpolation_qualifier/compiler
> .mako
> @@ -0,0 +1,98 @@
> +## -*- coding: utf-8 -*-
> +<%
> +    if ver == 'GL_ARB_gpu_shader_fp64':
> +        glsl_version_int = '150'
> +    else:
> +        glsl_version_int = ver
> +
> +    glsl_version = glsl_version_int[0] + '.' + glsl_version_int[1:3]
> +%>\
> +/* [config]
> + * expect_result: \
> +% if mode == 'flat':
> +pass
> +% else:
> +fail
> +% endif
> + * glsl_version: ${glsl_version}
> +% if ver == 'GL_ARB_gpu_shader_fp64':
> + * require_extensions: ${ver}
> +% endif
> + * [end config]
> + *
> +<%block name="comments"/>\
> +% if ver == 'GL_ARB_gpu_shader_fp64':
> + *
> + * ${ver} spec states:
> + *
> + *    "Modifications to The OpenGL Shading Language Specification,
> Version 1.50
> + *     (Revision 09)
> + *    ...
> + *        Modify Section 4.3.4, Inputs, p. 31
> + *    ...
> + *        (modify third paragraph, p. 32, allowing doubles as inputs
> and disallowing
> + *        as non-flat fragment inputs) ... Fragment inputs can only
> be signed and
> + *        unsigned integers and integer vectors, float, floating-
> point vectors,
> + *        double, double-precision vectors, single- or double-
> precision matrices, or
> + *        arrays or structures of these. Fragment shader inputs that
> are signed or
> + *        unsigned integers, integer vectors, doubles, double-
> precision vectors, or
> + *        double-precision matrices must be qualified with the
> interpolation
> + *        qualifier flat."
> +% elif ver == '130':
> + *
> + * The OpenGL Shading Language 1.30 spec states:
> + *
> + *    "4.3.6 Outputs
> + *    ...
> + *        If a vertex output is a signed or unsigned integer or
> + *        integer vector, then it must be qualified with the
> + *        interpolation qualifier flat.
> + *    ...
> + *        The type and presence of the interpolation qualifiers and
> + *        storage qualifiers and invariant qualifiers of variables
> + *        with the same name declared in linked vertex and fragments
> + *        shaders must match, otherwise the link command will fail."
> + *
> + * From this, it can be followed that if a fragment input is a
> signed
> + * or unsigned integer or derived type, it must be qualified with
> the
> + * interpolation qualifier flat.
> +% elif ver == '150':
> + *
> + * The OpenGL Shading Language 1.50 spec states:
> + *
> + *    "4.3.4 Inputs
> + *    ...
> + *        Fragment shader inputs that are signed or unsigned
> integers
> + *        or integer vectors must be qualified with the
> interpolation
> + *        qualifier flat."
> +% elif ver == '400':
> + *
> + * The OpenGL Shading Language 4.00 spec states:
> + *
> + *    "4.3.4 Inputs
> + *    ...
> + *        Fragment shader inputs that are signed or unsigned
> integers,
> + *        integer vectors, or any double-precision floating-point
> type
> + *        must be qualified with the interpolation qualifier flat."
> +% elif ver == '300 es':
> + *
> + * The OpenGL ES Shading Language 3.00 spec states:
> + *
> + *    "4.3.4 Input Variables
> + *    ...
> + *        Fragment shader inputs that are, or contain, signed or
> + *        unsigned integers or integer vectors must be qualified
> with
> + *        the interpolation qualifier flat."
> +% endif
> + */
> +
> +#version ${glsl_version_int}
> +% if ver == 'GL_ARB_gpu_shader_fp64':
> +#extension ${ver} : require
> +% endif
> +% if ver.endswith(' es'):
> +
> +precision mediump float;
> +% endif
> +
> +${next.body()}\
> diff --git
> a/generated_tests/templates/gen_flat_interpolation_qualifier/template
> .frag.mako
> b/generated_tests/templates/gen_flat_interpolation_qualifier/template
> .frag.mako
> new file mode 100644
> index 0000000..c15e3c2
> --- /dev/null
> +++
> b/generated_tests/templates/gen_flat_interpolation_qualifier/template
> .frag.mako
> @@ -0,0 +1,60 @@
> +## -*- coding: utf-8 -*-
> +<%inherit file="compiler.mako"/>\
> +<%
> +   var_name = 'u'
> +   var_as_vec4 = 's.' + var_name if struct else var_name
> +   if array:
> +      var_name += '[4]'
> +      var_as_vec4 += '[3]'
> +
> +   if type_name.startswith('dmat'):
> +      var_as_vec4 += '[0]'
> +
> +   if type_name.endswith('2'):
> +      var_as_vec4 += '.xyxy'
> +   elif type_name.endswith('3'):
> +      var_as_vec4 += '.xyzx'
> +%>\
> +<%block name="comments">\
> + * Declare a ${mode} interpolation ${type_name}\
> +% if array:
> + array\
> +% endif
> +% if struct:
> + inside a struct\
> +% endif
> +% if interface_block:
> + in an interface block\
> +% endif
> +.
> +</%block>\
> +% if struct:
> +struct S {
> +    ${type_name} ${var_name};
> +};
> +
> +% endif
> +% if interface_block:
> +in IB {
> +    \
> +% endif
> +% if mode != 'default':
> +${mode} \
> +% endif
> +% if not interface_block:
> +in \
> +% endif
> +% if struct:
> +S s;
> +% else:
> +${type_name} ${var_name};
> +% endif
> +% if interface_block:
> +};
> +% endif
> +out vec4 color;
> +
> +void main()
> +{
> +    color = vec4(${var_as_vec4});
> +}
> diff --git a/tests/spec/glsl-1.30/compiler/interpolation-
> qualifiers/nonflat-int-array.frag b/tests/spec/glsl-
> 1.30/compiler/interpolation-qualifiers/nonflat-int-array.frag
> deleted file mode 100644
> index 4a610e9..0000000
> --- a/tests/spec/glsl-1.30/compiler/interpolation-qualifiers/nonflat-
> int-array.frag
> +++ /dev/null
> @@ -1,31 +0,0 @@
> -// [config]
> -// expect_result: fail
> -// glsl_version: 1.30
> -// check_link: true
> -// [end config]
> -//
> -// Declare a non-flat integral fragment input.
> -//
> -// From section 4.3.4 ("Inputs") of the GLSL 1.50 spec:
> -//    "Fragment shader inputs that are signed or unsigned integers
> or
> -//    integer vectors must be qualified with the interpolation
> qualifier
> -//    flat."
> -//
> -// Note that prior to GLSL 1.50, this requirement is applied to
> vertex
> -// outputs rather than fragment inputs.  That creates problems in
> the
> -// presence of geometry shaders, so we assume the implementation
> -// should adopt the GLSL 1.50 rule for all desktop GL shaders.
> -//
> -// Note also that the text above makes no provision about arrays of
> -// integers; this is presumably an oversight, since there is no
> -// reasonable way to interpolate a fragment shader input that
> contains
> -// an integer.
> -
> -#version 130
> -
> -in int[2] x;
> -
> -void main()
> -{
> -	gl_FragColor = vec4(float(x[0]), float(x[1]), 0.0, 0.0);
> -}
> diff --git a/tests/spec/glsl-1.30/compiler/interpolation-
> qualifiers/nonflat-int.frag b/tests/spec/glsl-
> 1.30/compiler/interpolation-qualifiers/nonflat-int.frag
> deleted file mode 100644
> index 9cfc82e..0000000
> --- a/tests/spec/glsl-1.30/compiler/interpolation-qualifiers/nonflat-
> int.frag
> +++ /dev/null
> @@ -1,26 +0,0 @@
> -// [config]
> -// expect_result: fail
> -// glsl_version: 1.30
> -// check_link: true
> -// [end config]
> -//
> -// Declare a non-flat integral fragment input.
> -//
> -// From section 4.3.4 ("Inputs") of the GLSL 1.50 spec:
> -//    "Fragment shader inputs that are signed or unsigned integers
> or
> -//    integer vectors must be qualified with the interpolation
> qualifier
> -//    flat."
> -//
> -// Note that prior to GLSL 1.50, this requirement is applied to
> vertex
> -// outputs rather than fragment inputs.  That creates problems in
> the
> -// presence of geometry shaders, so we assume the implementation
> -// should adopt the GLSL 1.50 rule for all desktop GL shaders.
> -
> -#version 130
> -
> -in int x;
> -
> -void main()
> -{
> -	gl_FragColor = vec4(float(x));
> -}
> diff --git a/tests/spec/glsl-1.30/compiler/interpolation-
> qualifiers/nonflat-ivec4.frag b/tests/spec/glsl-
> 1.30/compiler/interpolation-qualifiers/nonflat-ivec4.frag
> deleted file mode 100644
> index 9fbf4e4..0000000
> --- a/tests/spec/glsl-1.30/compiler/interpolation-qualifiers/nonflat-
> ivec4.frag
> +++ /dev/null
> @@ -1,26 +0,0 @@
> -// [config]
> -// expect_result: fail
> -// glsl_version: 1.30
> -// check_link: true
> -// [end config]
> -//
> -// Declare a non-flat integral fragment input.
> -//
> -// From section 4.3.4 ("Inputs") of the GLSL 1.50 spec:
> -//    "Fragment shader inputs that are signed or unsigned integers
> or
> -//    integer vectors must be qualified with the interpolation
> qualifier
> -//    flat."
> -//
> -// Note that prior to GLSL 1.50, this requirement is applied to
> vertex
> -// outputs rather than fragment inputs.  That creates problems in
> the
> -// presence of geometry shaders, so we assume the implementation
> -// should adopt the GLSL 1.50 rule for all desktop GL shaders.
> -
> -#version 130
> -
> -in ivec4 x;
> -
> -void main()
> -{
> -	gl_FragColor = vec4(x);
> -}
> diff --git a/tests/spec/glsl-1.30/compiler/interpolation-
> qualifiers/nonflat-uint.frag b/tests/spec/glsl-
> 1.30/compiler/interpolation-qualifiers/nonflat-uint.frag
> deleted file mode 100644
> index e5e114a..0000000
> --- a/tests/spec/glsl-1.30/compiler/interpolation-qualifiers/nonflat-
> uint.frag
> +++ /dev/null
> @@ -1,26 +0,0 @@
> -// [config]
> -// expect_result: fail
> -// glsl_version: 1.30
> -// check_link: true
> -// [end config]
> -//
> -// Declare a non-flat integral fragment input.
> -//
> -// From section 4.3.4 ("Inputs") of the GLSL 1.50 spec:
> -//    "Fragment shader inputs that are signed or unsigned integers
> or
> -//    integer vectors must be qualified with the interpolation
> qualifier
> -//    flat."
> -//
> -// Note that prior to GLSL 1.50, this requirement is applied to
> vertex
> -// outputs rather than fragment inputs.  That creates problems in
> the
> -// presence of geometry shaders, so we assume the implementation
> -// should adopt the GLSL 1.50 rule for all desktop GL shaders.
> -
> -#version 130
> -
> -in uint x;
> -
> -void main()
> -{
> -	gl_FragColor = vec4(float(x));
> -}
> diff --git a/tests/spec/glsl-1.30/compiler/interpolation-
> qualifiers/nonflat-uvec4.frag b/tests/spec/glsl-
> 1.30/compiler/interpolation-qualifiers/nonflat-uvec4.frag
> deleted file mode 100644
> index b8dd7e2..0000000
> --- a/tests/spec/glsl-1.30/compiler/interpolation-qualifiers/nonflat-
> uvec4.frag
> +++ /dev/null
> @@ -1,26 +0,0 @@
> -// [config]
> -// expect_result: fail
> -// glsl_version: 1.30
> -// check_link: true
> -// [end config]
> -//
> -// Declare a non-flat integral fragment input.
> -//
> -// From section 4.3.4 ("Inputs") of the GLSL 1.50 spec:
> -//    "Fragment shader inputs that are signed or unsigned integers
> or
> -//    integer vectors must be qualified with the interpolation
> qualifier
> -//    flat."
> -//
> -// Note that prior to GLSL 1.50, this requirement is applied to
> vertex
> -// outputs rather than fragment inputs.  That creates problems in
> the
> -// presence of geometry shaders, so we assume the implementation
> -// should adopt the GLSL 1.50 rule for all desktop GL shaders.
> -
> -#version 130
> -
> -in uvec4 x;
> -
> -void main()
> -{
> -	gl_FragColor = vec4(x);
> -}
> diff --git a/tests/spec/glsl-es-3.00/compiler/interpolation-
> qualifiers/nonflat-int-array.frag b/tests/spec/glsl-es-
> 3.00/compiler/interpolation-qualifiers/nonflat-int-array.frag
> deleted file mode 100644
> index a36ea73..0000000
> --- a/tests/spec/glsl-es-3.00/compiler/interpolation-
> qualifiers/nonflat-int-array.frag
> +++ /dev/null
> @@ -1,22 +0,0 @@
> -// [config]
> -// expect_result: fail
> -// glsl_version: 3.00 es
> -// check_link: true
> -// [end config]
> -//
> -// Declare a non-flat integral fragment input.
> -//
> -// From section 4.3.4 ("Input Variables") of the GLSL ES 3.00 spec:
> -//    "Fragment shader inputs that are, or contain, signed or
> unsigned
> -//    integers or integer vectors must be qualified with the
> -//    interpolation qualifier flat."
> -
> -#version 300 es
> -
> -in int[2] x;
> -out highp vec4 color;
> -
> -void main()
> -{
> -	color = vec4(float(x[0]), float(x[1]), 0.0, 0.0);
> -}
> diff --git a/tests/spec/glsl-es-3.00/compiler/interpolation-
> qualifiers/nonflat-int.frag b/tests/spec/glsl-es-
> 3.00/compiler/interpolation-qualifiers/nonflat-int.frag
> deleted file mode 100644
> index 470ebbf..0000000
> --- a/tests/spec/glsl-es-3.00/compiler/interpolation-
> qualifiers/nonflat-int.frag
> +++ /dev/null
> @@ -1,22 +0,0 @@
> -// [config]
> -// expect_result: fail
> -// glsl_version: 3.00 es
> -// check_link: true
> -// [end config]
> -//
> -// Declare a non-flat integral fragment input.
> -//
> -// From section 4.3.4 ("Input Variables") of the GLSL ES 3.00 spec:
> -//    "Fragment shader inputs that are, or contain, signed or
> unsigned
> -//    integers or integer vectors must be qualified with the
> -//    interpolation qualifier flat."
> -
> -#version 300 es
> -
> -in int x;
> -out highp vec4 color;
> -
> -void main()
> -{
> -	color = vec4(x);
> -}
> diff --git a/tests/spec/glsl-es-3.00/compiler/interpolation-
> qualifiers/nonflat-ivec4.frag b/tests/spec/glsl-es-
> 3.00/compiler/interpolation-qualifiers/nonflat-ivec4.frag
> deleted file mode 100644
> index ffdec89..0000000
> --- a/tests/spec/glsl-es-3.00/compiler/interpolation-
> qualifiers/nonflat-ivec4.frag
> +++ /dev/null
> @@ -1,22 +0,0 @@
> -// [config]
> -// expect_result: fail
> -// glsl_version: 3.00 es
> -// check_link: true
> -// [end config]
> -//
> -// Declare a non-flat integral fragment input.
> -//
> -// From section 4.3.4 ("Input Variables") of the GLSL ES 3.00 spec:
> -//    "Fragment shader inputs that are, or contain, signed or
> unsigned
> -//    integers or integer vectors must be qualified with the
> -//    interpolation qualifier flat."
> -
> -#version 300 es
> -
> -in ivec4 x;
> -out highp vec4 color;
> -
> -void main()
> -{
> -	color = vec4(x);
> -}
> diff --git a/tests/spec/glsl-es-3.00/compiler/interpolation-
> qualifiers/nonflat-uint.frag b/tests/spec/glsl-es-
> 3.00/compiler/interpolation-qualifiers/nonflat-uint.frag
> deleted file mode 100644
> index 52bb49d..0000000
> --- a/tests/spec/glsl-es-3.00/compiler/interpolation-
> qualifiers/nonflat-uint.frag
> +++ /dev/null
> @@ -1,22 +0,0 @@
> -// [config]
> -// expect_result: fail
> -// glsl_version: 3.00 es
> -// check_link: true
> -// [end config]
> -//
> -// Declare a non-flat integral fragment input.
> -//
> -// From section 4.3.4 ("Input Variables") of the GLSL ES 3.00 spec:
> -//    "Fragment shader inputs that are, or contain, signed or
> unsigned
> -//    integers or integer vectors must be qualified with the
> -//    interpolation qualifier flat."
> -
> -#version 300 es
> -
> -in uint x;
> -out highp vec4 color;
> -
> -void main()
> -{
> -	color = vec4(x);
> -}
> diff --git a/tests/spec/glsl-es-3.00/compiler/interpolation-
> qualifiers/nonflat-uvec4.frag b/tests/spec/glsl-es-
> 3.00/compiler/interpolation-qualifiers/nonflat-uvec4.frag
> deleted file mode 100644
> index 86e5702..0000000
> --- a/tests/spec/glsl-es-3.00/compiler/interpolation-
> qualifiers/nonflat-uvec4.frag
> +++ /dev/null
> @@ -1,22 +0,0 @@
> -// [config]
> -// expect_result: fail
> -// glsl_version: 3.00 es
> -// check_link: true
> -// [end config]
> -//
> -// Declare a non-flat integral fragment input.
> -//
> -// From section 4.3.4 ("Input Variables") of the GLSL ES 3.00 spec:
> -//    "Fragment shader inputs that are, or contain, signed or
> unsigned
> -//    integers or integer vectors must be qualified with the
> -//    interpolation qualifier flat."
> -
> -#version 300 es
> -
> -in uvec4 x;
> -out highp vec4 color;
> -
> -void main()
> -{
> -	color = vec4(x);
> -}
> diff --git a/tests/spec/glsl-es-3.00/compiler/interpolation-
> qualifiers/varying-struct-nonflat-int.frag b/tests/spec/glsl-es-
> 3.00/compiler/interpolation-qualifiers/varying-struct-nonflat-
> int.frag
> deleted file mode 100644
> index 42360c2..0000000
> --- a/tests/spec/glsl-es-3.00/compiler/interpolation-
> qualifiers/varying-struct-nonflat-int.frag
> +++ /dev/null
> @@ -1,29 +0,0 @@
> -/* [config]
> - * expect_result: fail
> - * glsl_version: 3.00
> - * check_link: true
> - * [end config]
> - *
> - * From the GLSL ES 3.00 spec, Section 4.3.4 ("Input Variables"):
> - *
> - *     "Fragment shader inputs that are, or contain, signed or
> - *     unsigned integers or integer vectors must be qualified with
> the
> - *     interpolation qualifier flat."
> - *
> - * This test verifies that a non-flat varying struct containing
> - * signed integral data is properly flagged as an error.
> - */
> -
> -#version 300 es
> -
> -struct S {
> -	int i;
> -};
> -
> -in S foo;
> -out highp vec4 color;
> -
> -void main()
> -{
> -	color = vec4(foo.i);
> -}
> diff --git a/tests/spec/glsl-es-3.00/compiler/interpolation-
> qualifiers/varying-struct-nonflat-uint.frag b/tests/spec/glsl-es-
> 3.00/compiler/interpolation-qualifiers/varying-struct-nonflat-
> uint.frag
> deleted file mode 100644
> index 525aaa1..0000000
> --- a/tests/spec/glsl-es-3.00/compiler/interpolation-
> qualifiers/varying-struct-nonflat-uint.frag
> +++ /dev/null
> @@ -1,29 +0,0 @@
> -/* [config]
> - * expect_result: fail
> - * glsl_version: 3.00
> - * check_link: true
> - * [end config]
> - *
> - * From the GLSL ES 3.00 spec, Section 4.3.4 ("Input Variables"):
> - *
> - *     "Fragment shader inputs that are, or contain, signed or
> - *     unsigned integers or integer vectors must be qualified with
> the
> - *     interpolation qualifier flat."
> - *
> - * This test verifies that a non-flat varying struct containing
> - * unsigned integral data is properly flagged as an error.
> - */
> -
> -#version 300 es
> -
> -struct S {
> -	uint u;
> -};
> -
> -in S foo;
> -out highp vec4 color;
> -
> -void main()
> -{
> -	color = vec4(foo.u);
> -}
-- 
Br,

Andres

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/piglit/attachments/20160404/f0b86d4f/attachment-0001.sig>


More information about the Piglit mailing list