1. 29 Mar, 2019 5 commits
    • Eric Anholt's avatar
      util: Introduce fui() and uif() helpers for bit-casting floats/uints. · 4abb292f
      Eric Anholt authored
      I wanted to fix up some type-punning warnings and was surprised to see
      we didn't have this yet.
      Reviewed-by: Tapani Pälli's avatarTapani Pälli <tapani.palli@intel.com>
      4abb292f
    • Eric Anholt's avatar
      fp-unpack-01: Reuse the shared piglit_half_from_float(). · a56b7193
      Eric Anholt authored
      The shared one is a more complete implementation of half-float
      packing.
      
      Untested, since Mesa doesn't support the extension.
      Reviewed-by: Tapani Pälli's avatarTapani Pälli <tapani.palli@intel.com>
      a56b7193
    • Andres Gomez's avatar
      arb_program_interface_query: use out resource to make it active · 8305c580
      Andres Gomez authored
      From the GL_ARB_program_interface_query spec v.20:
      
        " When a program is linked, the GL builds a list of /active
          resources/ for each interface.  Examples of active resources
          include variables, interface blocks, and subroutines used by
          shader code.  Resources referenced in shader code are considered
          /active/ unless the compiler and linker can conclusively determine
          that they have no observable effect on the results produced by the
          executable code of the program.  For example, variables might be
          considered inactive if they are declared but not used in
          executable code, used only in a clause of an "if" statement that
          would never be executed, used only in functions that are never
          called, or used only in computations of temporary variables having
          no effect on any shader output.  In cases where the compiler or
          linker cannot make a conclusive determination, any resource
          referenced by shader code will be considered active.  The set of
          active resources on for any interface is implementation-dependent
          because it depends on various analysis and optimizations performed
          by the compiler and linker."
      
      Therefore, although the determination of the active resources is
      implementation dependent, it is clear that not making any kind of use
      in the shader code will, most probably, make the compiler/linker
      determine that the resource is inactive.
      Signed-off-by: Andres Gomez's avatarAndres Gomez <agomez@igalia.com>
      Reviewed-by: Tapani Pälli's avatarTapani Pälli <tapani.palli@intel.com>
      Reviewed-by: Martin Peres's avatarMartin Peres <martin.peres@linux.intel.com>
      8305c580
    • Andres Gomez's avatar
      arb_separate_shader_objects: remove misleading comments · 0a218e49
      Andres Gomez authored
      And also redefined built-ins that are not used.
      
      From Section 7.4.1 (Shader Interface Matching) of the OpenGL 4.60
      spec:
      
        " To use any built-in input or output in the gl_PerVertex block in
          separable program objects, shader code must redeclare that block
          prior to use. A separable program will fail to link if:
      
            * it contains multiple shaders of a single type with different
               redeclarations of this built-in block; or
      
            * any shader uses a built-in block member not found in the
              redeclaration of that block.
      
          There is one exception to this rule described below.
      
          As described above, an exact interface match requires matching
          built-in input and output blocks. At an interface between two
          non-fragment shader stages, the gl_PerVertex input and output
          blocks are considered to match if and only if the block members
          match exactly in name, type, qualification, and declaration order.
          At an interface involving the fragment shader stage, the presence
          or absence of any built-in output does not affect interface
          matching."
      Signed-off-by: Andres Gomez's avatarAndres Gomez <agomez@igalia.com>
      Reviewed-by: Tapani Pälli's avatarTapani Pälli <tapani.palli@intel.com>
      Reviewed-by: Martin Peres's avatarMartin Peres <martin.peres@linux.intel.com>
      0a218e49
    • Andres Gomez's avatar
      arb_program_interface_query: redefine built-ins with SSOs · 7b4ed86f
      Andres Gomez authored
      From Section 7.4.1 (Shader Interface Matching) of the OpenGL 4.60
      spec:
      
        " To use any built-in input or output in the gl_PerVertex block in
          separable program objects, shader code must redeclare that block
          prior to use. A separable program will fail to link if:
      
            * it contains multiple shaders of a single type with different
              redeclarations of this built-in block; or
      
            * any shader uses a built-in block member not found in the
              redeclaration of that block.
      
          There is one exception to this rule described below.
      
          As described above, an exact interface match requires matching
          built-in input and output blocks. At an interface between two
          non-fragment shader stages, the gl_PerVertex input and output
          blocks are considered to match if and only if the block members
          match exactly in name, type, qualification, and declaration order.
          At an interface involving the fragment shader stage, the presence
          or absence of any built-in output does not affect interface
          matching."
      Signed-off-by: Andres Gomez's avatarAndres Gomez <agomez@igalia.com>
      Reviewed-by: Tapani Pälli's avatarTapani Pälli <tapani.palli@intel.com>
      Reviewed-by: Martin Peres's avatarMartin Peres <martin.peres@linux.intel.com>
      7b4ed86f
  2. 26 Mar, 2019 1 commit
  3. 22 Mar, 2019 1 commit
  4. 21 Mar, 2019 1 commit
  5. 20 Mar, 2019 8 commits
    • Andres Gomez's avatar
      arb_enhanced_layouts: add xfb_offset overlap test · 9966894d
      Andres Gomez authored
      From the GL_ARB_enhanced_layouts spec:
      
        " No aliasing in output buffers is allowed: It is a compile-time or
          link-time error to specify variables with overlapping transform
          feedback offsets."
      
      v2: added forgotten check_link.
      
      Cc: Timothy Arceri <tarceri@itsqueeze.com>
      Signed-off-by: Andres Gomez's avatarAndres Gomez <agomez@igalia.com>
      Reviewed-by: Timothy Arceri's avatarTimothy Arceri <tarceri@itsqueeze.com>
      9966894d
    • Andres Gomez's avatar
      arb_enhanced_layouts: add another xfb_stride overflow test · 2afd59ad
      Andres Gomez authored
      Additional check to address a bug in mesa in which a stride which
      is a divisor of the declared offset for an overflowing varying
      won't fail.
      
      From the GL_ARB_enhanced_layouts spec:
      
        " It is a compile-time or link-time error to have any *xfb_offset*
          that overflows *xfb_stride*, whether stated on declarations before
          or after the *xfb_stride*, or in different compilation units."
      
      Cc: Timothy Arceri <tarceri@itsqueeze.com>
      Signed-off-by: Andres Gomez's avatarAndres Gomez <agomez@igalia.com>
      Reviewed-by: Timothy Arceri's avatarTimothy Arceri <tarceri@itsqueeze.com>
      2afd59ad
    • Andres Gomez's avatar
      arb_enhanced_layouts: add component aliasing tests · 93f48c04
      Andres Gomez authored
      New tests for component aliasing with duplicated inputs which match
      the same output variable in the previous stage.
      
      From Section 4.4.1 (Input Layout Qualifiers) of the GLSL 4.60 spec:
      
        " Location aliasing is causing two variables or block members to
          have the same location number. Component aliasing is assigning the
          same (or overlapping) component numbers for two location
          aliases. (Recall if component is not used, components are assigned
          starting with 0.) With one exception, location aliasing is allowed
          only if it does not cause component aliasing; it is a compile-time
          or link-time error to cause component aliasing."
      
      From Section 7.4.1 (Shader Interface Matching) of the OpenGL 4.60 spec:
      
        "   * An output variable is considered to match an input variable in
              the subsequent shader if:
      
              – the two variables match in name, type, and qualification,
                and neither has a location qualifier, or
      
              – the two variables are declared with the same location and
                component layout qualifiers and match in type and
                qualification."
      
      Cc: Timothy Arceri <tarceri@itsqueeze.com>
      Cc: Iago Toral Quiroga <itoral@igalia.com>
      Cc: Ilia Mirkin <imirkin@alum.mit.edu>
      Signed-off-by: Andres Gomez's avatarAndres Gomez <agomez@igalia.com>
      Reviewed-by: Juan Suárez Romero's avatarJuan A. Suarez <jasuarez@igalia.com>
      93f48c04
    • Andres Gomez's avatar
      arb_enhanced_layouts: correct component usage with dvec{3,4} tests · 4b925c82
      Andres Gomez authored
      There was a pre-existing test using "component = 0" with dvec3 which
      was not failing as it should. This was because the other tests
      checking for the usage of the component keyword with dvec3 and dvec4
      were failing due to a different restriction: the component sequence
      was overflowing 3 and/or a double based type was using component 1 o
      3.
      
      Now we fix them by using "component = 0" when need to fail and
      removing the keyword when need to succeed.
      
      From Section 4.4.1 (Input Layout Qualifiers) of the GLSL 4.50 spec:
      
        " It is a compile-time error if this sequence of components gets
          larger than 3. A scalar double will consume two of these
          components, and a dvec2 will consume all four components available
          within a location. A dvec3 or dvec4 can only be declared without
          specifying a component."
      
      ...
      
        " It is a compile-time error to use component 1 or 3 as the
          beginning of a double or dvec2."
      
      Cc: Timothy Arceri <tarceri@itsqueeze.com>
      Cc: Kenneth Graunke <kenneth@whitecape.org>
      Signed-off-by: Andres Gomez's avatarAndres Gomez <agomez@igalia.com>
      Reviewed-by: Timothy Arceri's avatarTimothy Arceri <tarceri@itsqueeze.com>
      4b925c82
    • Andres Gomez's avatar
      arb_enhanced_layouts: add aliasing tests with mixed type widths · 140cb0ee
      Andres Gomez authored
      Added tests which check component aliasing between types that have
      different bit widths.
      
      From Section 4.4.1 (Input Layout Qualifiers) of the GLSL 4.60 spec:
      
          "Further, when location aliasing, the aliases sharing the location
           must have the same underlying numerical type and bit
           width (floating-point or integer, 32-bit versus 64-bit, etc.)
           and the same auxiliary storage and interpolation
           qualification. The one exception where component aliasing is
           permitted is for two input variables (not block members) to a
           vertex shader, which are allowed to have component aliasing. This
           vertex-variable component aliasing is intended only to support
           vertex shaders where each execution path accesses at most one
           input per each aliased component. Implementations are permitted,
           but not required, to generate link-time errors if they detect
           that every path through the vertex shader executable accesses
           multiple inputs aliased to any single component."
      
      Cc: Timothy Arceri <tarceri@itsqueeze.com>
      Cc: Iago Toral Quiroga <itoral@igalia.com>
      Cc: Ilia Mirkin <imirkin@alum.mit.edu>
      Signed-off-by: Andres Gomez's avatarAndres Gomez <agomez@igalia.com>
      Reviewed-by: Juan Suárez Romero's avatarJuan A. Suarez <jasuarez@igalia.com>
      140cb0ee
    • Andres Gomez's avatar
      arb_enhanced_layouts: correct interpolation qualifiers · 7c5cdf51
      Andres Gomez authored
      Corrected several component aliasing tests which shouldn't be failing
      or were failing due to a different reason than the tested one:
      interpolation qualifiers mismatch.
      
      From Section 4.4.1 (Input Layout Qualifiers) of the GLSL 4.50 spec:
      
        " Further, when location aliasing, the aliases sharing the location
          must have the same underlying numerical type (floating-point or
          integer) and the same auxiliary storage and interpolation
          qualification."
      
      Cc: Timothy Arceri <tarceri@itsqueeze.com>
      Signed-off-by: Andres Gomez's avatarAndres Gomez <agomez@igalia.com>
      Reviewed-by: Juan Suárez Romero's avatarJuan A. Suarez <jasuarez@igalia.com>
      7c5cdf51
    • Andres Gomez's avatar
      arb_enhanced_layouts: GL_ARB_gpu_shader_fp64 requires GLSL 1.50 · 8f04a7ec
      Andres Gomez authored
      Cc: Timothy Arceri <tarceri@itsqueeze.com>
      Signed-off-by: Andres Gomez's avatarAndres Gomez <agomez@igalia.com>
      Reviewed-by: Juan Suárez Romero's avatarJuan A. Suarez <jasuarez@igalia.com>
      8f04a7ec
    • Andres Gomez's avatar
      arb_enhanced_layouts: corrected multiple comments · db98d3a7
      Andres Gomez authored
      Cc: Timothy Arceri <tarceri@itsqueeze.com>
      Signed-off-by: Andres Gomez's avatarAndres Gomez <agomez@igalia.com>
      Reviewed-by: Juan Suárez Romero's avatarJuan A. Suarez <jasuarez@igalia.com>
      db98d3a7
  6. 19 Mar, 2019 6 commits
    • Andres Gomez's avatar
      arb_separate_shader_objects: add unused location qualified input test · ff410196
      Andres Gomez authored
      New tests to check that an unused input varying, which would be
      matched based on its explicit location, won't cause a link failure if
      there is no matching output variable.
      
      From the ARB_separate_shader_objects spec v.25:
      
        "   * An output variable is considered to match an input variable in
              the subequent shader if:
      
              * the two variables match in name, type, and qualification; or
      
              * the two variables are declared with the same location layout
                qualifier and match in type and qualification."
      
        ...
      
        " For program objects containing multiple shaders, LinkProgram will
          check for mismatches on interfaces between shader stages in the
          program being linked and generate a link error if a mismatch is
          detected.  A link error will be generated if any statically
          referenced input variable or block does not have a matching
          output."
      
      Cc: Timothy Arceri <tarceri@itsqueeze.com>
      Cc: Iago Toral Quiroga <itoral@igalia.com>
      Cc: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
      Cc: Tapani Pälli <tapani.palli@intel.com>
      Cc: Ian Romanick <ian.d.romanick@intel.com>
      Signed-off-by: Andres Gomez's avatarAndres Gomez <agomez@igalia.com>
      Reviewed-by: Timothy Arceri's avatarTimothy Arceri <tarceri@itsqueeze.com>
      ff410196
    • Andres Gomez's avatar
      arb_separate_shader_objects: add location overlapping tests · 461e76e8
      Andres Gomez authored
      New tests for location overlap with scalars, doubles and for
      duplicated inputs which match the same output variable in the previous
      stage.
      
      From the ARB_separate_shader_objects spec v.25:
      
        "   * An output variable is considered to match an input variable in
              the subequent shader if:
      
              * the two variables match in name, type, and qualification; or
      
              * the two variables are declared with the same location layout
                qualifier and match in type and qualification."
      
      ...
      
        " A program will fail to link if any two non-vertex shader input
          variables are assigned to the same location."
      
      Cc: Timothy Arceri <tarceri@itsqueeze.com>
      Cc: Iago Toral Quiroga <itoral@igalia.com>
      Cc: Ilia Mirkin <imirkin@alum.mit.edu>
      Signed-off-by: Andres Gomez's avatarAndres Gomez <agomez@igalia.com>
      Reviewed-by: Timothy Arceri's avatarTimothy Arceri <tarceri@itsqueeze.com>
      461e76e8
    • Andres Gomez's avatar
      arb_separate_shader_objects: add rendez-vous-by mismatch tests · cd992375
      Andres Gomez authored
      New tests to check that, with separable program objects, interface
      matching by name or location are still checked at link time between
      the inner interfaces existing inside the program.
      
      From the ARB_separate_shader_objects spec v.25:
      
        " With separable program objects, interfaces between shader stages
          may involve the outputs from one program object and the inputs
          from a second program object.  For such interfaces, it is not
          possible to detect mismatches at link time, because the programs
          are linked separately.  When each such program is linked, all
          inputs or outputs interfacing with another program stage are
          treated as active.  The linker will generate an executable that
          assumes the presence of a compatible program on the other side of
          the interface.  If a mismatch between programs occurs, no GL error
          will be generated, but some or all of the inputs on the interface
          will be undefined."
      
      Cc: Timothy Arceri <tarceri@itsqueeze.com>
      Cc: Iago Toral Quiroga <itoral@igalia.com>
      Cc: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
      Cc: Tapani Pälli <tapani.palli@intel.com>
      Cc: Ian Romanick <ian.d.romanick@intel.com>
      Cc: Ilia Mirkin <imirkin@alum.mit.edu>
      Signed-off-by: Andres Gomez's avatarAndres Gomez <agomez@igalia.com>
      Reviewed-by: Timothy Arceri's avatarTimothy Arceri <tarceri@itsqueeze.com>
      cd992375
    • Andres Gomez's avatar
      arb_program_interface_query: correct rendez-vous by name matching · 222fc0b5
      Andres Gomez authored
      Previuosly, this was overlooked asuming that, since they were SSOs, no
      inner interface matching check was needed.
      
      From the ARB_separate_shader_objects spec v.25:
      
        " With separable program objects, interfaces between shader stages
          may involve the outputs from one program object and the inputs
          from a second program object.  For such interfaces, it is not
          possible to detect mismatches at link time, because the programs
          are linked separately.  When each such program is linked, all
          inputs or outputs interfacing with another program stage are
          treated as active.  The linker will generate an executable that
          assumes the presence of a compatible program on the other side of
          the interface.  If a mismatch between programs occurs, no GL error
          will be generated, but some or all of the inputs on the interface
          will be undefined."
      
      Cc: Timothy Arceri <tarceri@itsqueeze.com>
      Cc: Tapani Pälli <tapani.palli@intel.com>
      Cc: Ilia Mirkin <imirkin@alum.mit.edu>
      Cc: Martin Peres <martin.peres@linux.intel.com>
      Signed-off-by: Andres Gomez's avatarAndres Gomez <agomez@igalia.com>
      Reviewed-by: Timothy Arceri's avatarTimothy Arceri <tarceri@itsqueeze.com>
      222fc0b5
    • Andres Gomez's avatar
      arb_program_interface_query: correct tests table indentation · 5b29e6c7
      Andres Gomez authored
      Cc: Timothy Arceri <tarceri@itsqueeze.com>
      Cc: Martin Peres <martin.peres@linux.intel.com>
      Signed-off-by: Andres Gomez's avatarAndres Gomez <agomez@igalia.com>
      Reviewed-by: Timothy Arceri's avatarTimothy Arceri <tarceri@itsqueeze.com>
      5b29e6c7
    • Illia Iorin's avatar
      tests: Check that count of vertex atomic counters enough for test · c3af09e1
      Illia Iorin authored
      In OpenGL 4.6 (Table 23.57: Implementation Dependent Vertex Shader Limits)
      specification  said, that minimum value of MAX_VERTEX_ATOMIC_COUNTERS is 0.
      Therefore if we use them we have to check available count.
      Signed-off-by: default avatarIllia Iorin <illia.iorin@globallogic.com>
      Reviewed-by: Eric Anholt's avatarEric Anholt <eric@anholt.net>
      c3af09e1
  7. 14 Mar, 2019 4 commits
  8. 12 Mar, 2019 4 commits
  9. 11 Mar, 2019 1 commit
  10. 08 Mar, 2019 1 commit
  11. 06 Mar, 2019 4 commits
  12. 01 Mar, 2019 1 commit
    • Ian Romanick's avatar
      arb_gpu_shader_int64: Test extracting individual bytes from 64-bit values · 80baf08d
      Ian Romanick authored
      In Mesa, NIR has an optimization that will convert certain patterns into
      instructions that extract an individual byte from a larger integer.
      When extracting from a 64-bit value, the i965 compiler backend has some
      bugs emitting these instructions.  These tests try to reproduce these
      problems, but only fs-ushr-and-mask.shader_test is able to trigger the
      failure.
      
      The optimization is not (yet) able to recognize the patterns from the
      other tests to generate the mishandled instructions.  With those
      patterns added, all of these tests either fail or hit the assertion:
      
      src/intel/compiler/brw_ir_fs.h:295: fs_reg subscript(fs_reg, brw_reg_type, unsigned int): Assertion `(i + 1) * type_sz(type) <= type_sz(reg.type)' failed.
      Reviewed-by: Matt Turner's avatarMatt Turner <mattst88@gmail.com>
      Cc: Jason Ekstrand <jason@jlekstrand.net>
      80baf08d
  13. 27 Feb, 2019 1 commit
  14. 26 Feb, 2019 2 commits