1. 28 Jun, 2012 6 commits
  2. 26 Jun, 2012 2 commits
    • Paul Berry's avatar
      msaa: Test that the "centroid" interpolation qualifier works correctly. · 3c830b87
      Paul Berry authored
      This patch adds tests to verify that:
      
      - When GL_MULTISAMPLE is disabled, the "centroid" keyword is ignored,
        and interpolation is performed at pixel centers (consistent with the
        GL rules for non-antialiased rendering).
      
      - When GL_MULTISAMPLE is enabled and the "centroid" keyword is used,
        interpolation is performed at a location within the boundary of the
        triangle.  The test also verifies that errors introduced into
        derivatives are kept within reasonable bounds.
      
      - When GL_MULTISAMPLE is enabled and the "centroid" keyword is absent,
        derivatives are accurate.
      
      Verified using nVidia's proprietary binary driver for Linux.
      Reviewed-by: default avatarChad Versace <chad.versace@linux.intel.com>
      3c830b87
    • Paul Berry's avatar
      msaa: Add clarifying comments for Triangles program. · 706971b0
      Paul Berry authored
      Clarify the range of values that the tri_num uniform takes on, and
      clarify that the Triangles program draws a grid of small disjoint
      triangles.
      706971b0
  3. 25 Jun, 2012 22 commits
    • Paul Berry's avatar
      msaa/formats: Add EXT_texture_sRGB tests. · 5c51c7be
      Paul Berry authored
      The MSAA "formats" test now properly tests sRGB format framebuffers.
      This patch updates all.tests to cause those formats to be tested.
      Reviewed-by: Anuj Phogat's avatarAnuj Phogat <anuj.phogat@gmail.com>
      5c51c7be
    • Paul Berry's avatar
      msaa/formats: Fix testing of sRGB formats. · f4a543e8
      Paul Berry authored
      sRGB buffers use a different blending operation to do multisample
      resolves from non-sRGB buffers.  Accordingly, when testing sRGB
      formats, we need to use an sRGB reference image.  This patch modifies
      the MSAA "formats" test so that when testing an sRGB format, it
      renders the reference image using SRGB8_ALPHA8 format rather than RGBA
      format.
      
      This required rearranging the initialization order used in the test,
      so that the framebuffer under test is initialized first, so that we
      can query it to see whether it is sRGB before initializing the
      reference framebuffer.
      Reviewed-by: Anuj Phogat's avatarAnuj Phogat <anuj.phogat@gmail.com>
      f4a543e8
    • Paul Berry's avatar
      msaa: Verify accuracy of sRGB MSAA resolves. · 98d1e497
      Paul Berry authored
      From the GL spec, version 4.2, section 4.1.11 (Additional Multisample
      Fragment Operations):
      
          If a framebuffer object is not bound, after all operations have
          been completed on the multisample buffer, the sample values for
          each color in the multisample buffer are combined to produce a
          single color value, and that value is written into the
          corresponding color buffers selected by DrawBuffer or
          DrawBuffers. An implementation may defer the writing of the color
          buffers until a later time, but the state of the framebuffer must
          behave as if the color buffers were updated as each fragment was
          processed. The method of combination is not specified. If the
          framebuffer contains sRGB values, then it is recommended that the
          an average of sample values is computed in a linearized space, as
          for blending (see section 4.1.7).
      
      This patch adds a new "srgb" mode to the MSAA accuracy test, which
      verifies that the formula used by the implementation to blend sRGB
      samples matches the GL spec's recommendations.  When an "srgb"
      accuracy test is requested, the test is modified to do the following
      things:
      
      - Render using a buffer format of SRGB8_ALPHA8 instead of RGBA.
      
      - When manually downsampling the reference image, enable
        FRAMEBUFFER_SRGB, so that the data output by the manual downsampler
        gets converted from linear color space into sRGB color space.  This
        ensures that the reference image is generated according to the
        spec's recommendations.
      
      - Convert pixels from sRGB color space to linear color space before
        comparing the test image and the reference image.  This ensures that
        the RMS error is computed in linear color space, so that the RMS
        error computed for sRGB mode is comparable with the RMS error
        computed for linear RGBA color.
      
      Note: if an implementation fails this test, that does not necessarily
      mean that it fails to meet the GL spec (since the spec only recommends
      sRGB-correct averaging, it doesn't require it).  For example, the
      nVidia closed-source driver for Linux fails this test.
      Reviewed-by: Anuj Phogat's avatarAnuj Phogat <anuj.phogat@gmail.com>
      98d1e497
    • Paul Berry's avatar
      msaa/formats: Add ARB_texture_rg tests. · 1d513da8
      Paul Berry authored
      The MSAA "formats" test now properly tests RED and RG format
      framebuffers.  This patch updates all.tests to cause those formats to
      be tested.
      Reviewed-by: Anuj Phogat's avatarAnuj Phogat <anuj.phogat@gmail.com>
      1d513da8
    • Paul Berry's avatar
      msaa/formats: Fix visualization of RED and RG formats · 60d57dd9
      Paul Berry authored
      The switch statement in visualize_image() wasn't properly handling
      formats whose base internal format is GL_RED or GL_RG.  As a result,
      tests of these formats showed up as a black screen.  This patch addes
      switch cases to handle the formats properly.
      Reviewed-by: Anuj Phogat's avatarAnuj Phogat <anuj.phogat@gmail.com>
      60d57dd9
    • Paul Berry's avatar
      msaa/formats: Add floating point format tests. · f0c48102
      Paul Berry authored
      The MSAA "formats" test now properly tests floating point formats.
      This patch updates all.tests to cause those formats to be tested.
      Reviewed-by: Anuj Phogat's avatarAnuj Phogat <anuj.phogat@gmail.com>
      f0c48102
    • Paul Berry's avatar
      msaa/formats: Adjust tolerance appropriately for floating-point formats. · 17ce210e
      Paul Berry authored
      When setting up a floating-point format, the GL implementation
      responds to queries GL_ATTACHMENT_{RED,GREEN,BLUE,ALPHA}_SIZE with the
      total number of bits in the floating-point value, regardless of
      whether those bits are used for sign, exponent, or mantissa.  However,
      for the purpose of setting a reasonable tolerance for pass/fail
      comparisons, we really should only account for mantissa bits.
      
      This patch modifies the MSAA "formats" test to detect when the buffer
      format is GL_FLOAT, and if so, convert the channel size into the
      number of mantissa bits, so that we don't test floating-point formats
      to an unreasonably tight tolerance.
      Reviewed-by: Anuj Phogat's avatarAnuj Phogat <anuj.phogat@gmail.com>
      17ce210e
    • Paul Berry's avatar
      msaa/formats: Add EXT_texture_integer tests. · 3285ac39
      Paul Berry authored
      The MSAA "formats" test now properly tests integer framebuffer
      formats.  This patch updates all.tests to cause integer framebuffer
      formats to be tested.
      Reviewed-by: Anuj Phogat's avatarAnuj Phogat <anuj.phogat@gmail.com>
      3285ac39
    • Paul Berry's avatar
    • Paul Berry's avatar
      msaa/formats: Use a scale and offset for testing integer formats. · cc56b850
      Paul Berry authored
      This patch adapts the MSAA "formats" test so that when drawing into
      integer framebuffers, it applies the necessary scale and offset to
      cover the entire range of possible integer values.  When reading
      pixels back from the framebuffer, the test applies the inverse scale
      and offset, so that the result can be compared to the reference RGBA
      image.
      Reviewed-by: Anuj Phogat's avatarAnuj Phogat <anuj.phogat@gmail.com>
      cc56b850
    • Paul Berry's avatar
      msaa/formats: Compare integer formats properly. · 780f5e52
      Paul Berry authored
      This patch adapts the MSAA "formats" test to use
      piglit_compare_images_color() to check pass/fail instead of
      piglit_probe_image_color().  This will allow integer formats to be
      tested.
      Reviewed-by: Anuj Phogat's avatarAnuj Phogat <anuj.phogat@gmail.com>
      780f5e52
    • Paul Berry's avatar
      msaa/formats: Adapt glReadPixels() call to handle integer formats. · 57859179
      Paul Berry authored
      This patch adapts the MSAA "formats" test to pass the proper
      parameters to glReadPixels() when checking that the proper image has
      been rendered.  Since glReadPixels() requires an integral type when
      reading pixels from an integer framebuffer, we read the pixels into a
      temporary integer buffer and then copy them (using the CPU) into a
      floating point buffer for comparison to the reference image.
      Reviewed-by: Anuj Phogat's avatarAnuj Phogat <anuj.phogat@gmail.com>
      57859179
    • Paul Berry's avatar
      msaa/formats: Adapt test pattern drawing to handle integer formats. · 55e3a232
      Paul Berry authored
      This patch adapts the MSAA "formats" test so that it can draw to
      integer framebuffers, by creating 3 instantiations of the
      ColorGradientSunburst class, one for testing vec4's (for floating
      point and normalized formats), one for testing ivec4's (for signed
      integer formats), and one for testing uvec4's (for unsigned integer
      formats).
      
      The test determines which ColorGradientSunburst to use by querying
      GL_FRAMEBUFFERATTACHMENT_COMPONENT_TYPE.
      Reviewed-by: Anuj Phogat's avatarAnuj Phogat <anuj.phogat@gmail.com>
      55e3a232
    • Paul Berry's avatar
      msaa: Make it possible to scale and offset ColorGradientSunburst. · 0079e1dd
      Paul Berry authored
      In order to test that MSAA works properly for integer framebuffers, we
      will need to be able to adjust the outputs of the
      ColorGradientSunburst program to cover the range of signed or unsigned
      integers, rather than the range [0, 1] that is appropriate for testing
      normalized color framebuffers.
      
      This patch makes that possible by adding "scale" and "offset"
      parameters to the ColorGradientSunburst program.
      Reviewed-by: Anuj Phogat's avatarAnuj Phogat <anuj.phogat@gmail.com>
      0079e1dd
    • Paul Berry's avatar
      msaa: Make it possible to change output type when drawing sunbursts. · 132c8a10
      Paul Berry authored
      In order to test that MSAA works properly for integer framebuffers, we
      will need to be able to output ivec4 and uvec4 types when rendering
      the test image.  This patch makes that possible by adapting the
      Sunburst GLSL program so that it can be compiled to output ivec4's,
      uvec4's, or vec4's.
      Reviewed-by: Anuj Phogat's avatarAnuj Phogat <anuj.phogat@gmail.com>
      132c8a10
    • Paul Berry's avatar
      util: Make a separate function to compare in-memory images. · e51de44e
      Paul Berry authored
      This patch splits off a new piglit-util function,
      piglit_compare_images_color(), from the existing
      piglit_probe_image_color() function.  The new function compares two
      images in memory, so that the caller can take responsibility for
      calling glReadPixels().
      
      In addition, this patch creates a function
      piglit_compute_probe_tolerance(), which detemines the correct
      tolerance thresholds to use when comparing images.
      
      These functions will be needed in order to test proper behaviour of
      MSAA with different buffer formats, since the MSAA format test needs
      to be able to read the rendered image using glReadPixels, make
      adjustments to it in memory, and then compare the results.
      Reviewed-by: Anuj Phogat's avatarAnuj Phogat <anuj.phogat@gmail.com>
      e51de44e
    • Paul Berry's avatar
      glsl-1.30: Verify proper conversion of large floats to uints. · fdadf55c
      Paul Berry authored
      This patch adds two new tests that exercise a bug in Mesa/i965:
      conversion from float to uint was being done in a two step process:
      convert first to int and then to uint.  Since i965 uses saturating
      arithmetic in float->int conversion, this caused conversion to give
      the wrong result for values greater than 0x7fffffff.
      
      I'll be submitting a Mesa fix shortly.
      Reviewed-by: default avatarChad Versace <chad.versace@linux.intel.com>
      fdadf55c
    • Paul Berry's avatar
      msaa: Test that msaa blits are clipped and scissored correctly. · 75e32b67
      Paul Berry authored
      There are three reasons why the set of rectangles passed to
      glBlitFramebuffer() might need to be clipped before performing the
      blit:
      
      1. If the destination rectangle falls (partly or completely) outside
      the bounds of the draw framebuffer.
      
      2. If the destination rectangle falls (partly or completely) outside
      the scissor rectangle.
      
      3. If the source rectangle falls (party or completely) outside the
      bounds of the read framebuffer.
      
      In cases 1 and 2, it is clear from the GL spec that the blit should be
      clipped.  In case 3, the spec is less clear, however Ian Romanick and
      I have received clarification from the ARB that clipping is the
      intended behaviour.
      
      This test verifies that blits are properly clipped in cases 1-3.  It
      only tests blits in which the source and destination rectangles are
      the same size (i.e. no scaling is occurring), since scaling blits are
      not allowed for MSAA.
      Reviewed-by: default avatarChad Versace <chad.versace@linux.intel.com>
      75e32b67
    • Paul Berry's avatar
    • Jose Fonseca's avatar
      ext_framebuffer_multisample: Use dynamic array instead of variable length array. · ce5739a0
      Jose Fonseca authored
      As the later is a GNU extension, not supported on MSVC.
      
      Missed in the previous commit.
      ce5739a0
    • Jose Fonseca's avatar
      ext_framebuffer_multisample: Use dynamic array instead of variable length array. · 4a4ee8aa
      Jose Fonseca authored
      As the later is a GNU extension, not supported on MSVC.
      
      Trivial.
      4a4ee8aa
    • Jose Fonseca's avatar
      ext_framebuffer_multisample: Cast sin arguments to floating point. · b1f1905f
      Jose Fonseca authored
      To prevent "ambiguous call to overloaded function" error on MSVC.
      
      Trivial.
      b1f1905f
  4. 23 Jun, 2012 7 commits
  5. 22 Jun, 2012 2 commits
  6. 21 Jun, 2012 1 commit