<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p><br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 20.07.18 17:04, Danylo Piliaiev
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:78477dfe-16a1-59f1-c0ff-22424b49e351@gmail.com">
      <br>
      <br>
      On 20.07.18 02:26, Francisco Jerez wrote:
      <br>
      <blockquote type="cite">Danylo Piliaiev
        <a class="moz-txt-link-rfc2396E" href="mailto:danylo.piliaiev@gmail.com"><danylo.piliaiev@gmail.com></a> writes:
        <br>
        <br>
        <blockquote type="cite">Test for the regression which happened
          when GL_TEXTURE_BUFFER was
          <br>
          allowed to have incompatible format.
          <br>
          <br>
          v2: Removed unnecessary code duplication - use upload_image
          instead
          <br>
                of init_level. (Francisco Jerez)
          <br>
          <br>
          Bugzilla: <a class="moz-txt-link-freetext" href="https://bugs.freedesktop.org/show_bug.cgi?id=106465">https://bugs.freedesktop.org/show_bug.cgi?id=106465</a>
          <br>
          <br>
          Signed-off-by: Danylo Piliaiev
          <a class="moz-txt-link-rfc2396E" href="mailto:danylo.piliaiev@globallogic.com"><danylo.piliaiev@globallogic.com></a>
          <br>
          ---
          <br>
            .../arb_shader_image_load_store/invalid.c     | 23
          +++++++++++++++----
          <br>
            1 file changed, 19 insertions(+), 4 deletions(-)
          <br>
          <br>
          diff --git a/tests/spec/arb_shader_image_load_store/invalid.c
          b/tests/spec/arb_shader_image_load_store/invalid.c
          <br>
          index ed4b6c064..99f6703a4 100644
          <br>
          --- a/tests/spec/arb_shader_image_load_store/invalid.c
          <br>
          +++ b/tests/spec/arb_shader_image_load_store/invalid.c
          <br>
          @@ -266,13 +266,17 @@ static bool
          <br>
            invalidate_incompatible_format(const struct image_info img,
          GLuint prog)
          <br>
            {
          <br>
                    GLenum base_format =
          image_base_internal_format(img.format);
          <br>
          +        uint32_t pixels[4 * N];
          <br>
          +        init_pixels(img, pixels, 1, 1, 1, 1);
          <br>
          +
          <br>
          +        /* upload_image instead of init_level to support
          GL_TEXTURE_BUFFER */
          <br>
          +        bool ret = upload_image(img, 0, pixels);
          <br>
          +
          <br>
        </blockquote>
        I don't think you actually need to call upload_image() here, it
        should
        <br>
        have been called already by init_image().
        <br>
      </blockquote>
      I don't know where I'm looking... You are right. Only
      glBindImageTexture will be left
      <br>
      and it's enough for the test.
      <br>
      <blockquote type="cite">
        <blockquote type="cite">          /* Pick an incompatible
          texture format with a compatible base
          <br>
                     * type. */
          <br>
          -        bool ret = init_level(img, 0, (base_format ==
          GL_RGBA32F ?
          <br>
          -                                       GL_RGBA8 : GL_RG32UI),
          W, H);
          <br>
          -
          <br>
                    glBindImageTexture(0, get_texture(0), 0, GL_TRUE, 0,
          <br>
          -                           GL_READ_WRITE,
          img.format->format);
          <br>
          +                           GL_READ_WRITE, (base_format ==
          GL_RGBA32F ?
          <br>
          +                                           GL_RGBA8 :
          GL_RG32UI));
          <br>
                      return ret &&
          piglit_check_gl_error(GL_NO_ERROR);
          <br>
            }
          <br>
          @@ -346,6 +350,8 @@ piglit_init(int argc, char **argv)
          <br>
                    for (op = image_ops; op->name; ++op) {
          <br>
                            const struct image_info def_img =
          image_info(
          <br>
                                    GL_TEXTURE_2D,
          op->formats[0].format, W, H);
          <br>
          +                const struct image_info def_img_buffer =
          image_info(
          <br>
          +                        GL_TEXTURE_BUFFER,
          op->formats[0].format, W, H);
          <br>
                              /*
          <br>
                             * According to the spec, an access is
          considered
          <br>
          @@ -399,6 +405,15 @@ piglit_init(int argc, char **argv)
          <br>
                                            
          invalidate_incompatible_format, false),
          <br>
                                    "%s/incompatible format test",
          op->name);
          <br>
            +                /* Test for the regression which happened
          when
          <br>
          +                 * GL_TEXTURE_BUFFER was allowed to have
          incompatible format.
          <br>
          +                 */
          <br>
        </blockquote>
        FTR, did you confirm whether this test-case causes a crash after
        <br>
        re-applying the mesa patch that led to the regression?
        <br>
        <br>
        Thanks.
        <br>
      </blockquote>
      This test-case doesn't crash with that patch. I picked the first
      format from the array
      <br>
      (same as the other tests) which appears to be GL_RGBA32F, but
      unfortunately it's a
      <br>
      format with which we cannot go out of bounds. Picking the format
      which will result in crash
      <br>
      would be better (already tested and crash occurred). I'll do this
      in my hopefully final version of the patch.
      <br>
      <br>
    </blockquote>
    Please, disregard this part, it doesn't crash <span id="result_box"
      class="short_text" lang="en"><span class="">regardless of format</span></span>,
    test just fails - nothing more. <br>
    <blockquote type="cite"
      cite="mid:78477dfe-16a1-59f1-c0ff-22424b49e351@gmail.com">Thank
      you for reviewing these embarrassing patches.
      <br>
      <blockquote type="cite">
        <blockquote type="cite">+                subtest(&status,
          true,
          <br>
          +                        run_test(op, def_img_buffer,
          def_img_buffer,
          <br>
          +                                
          invalidate_incompatible_format, false),
          <br>
          +                        "%s/incompatible format
          test/image%s",
          <br>
          +                        op->name,
          def_img_buffer.target->name);
          <br>
          +
          <br>
                            /*
          <br>
                             * " * the texture bound to the image unit
          has layers,
          <br>
                             *     and the selected layer or cube map
          face doesn't
          <br>
          -- <br>
          2.17.1
          <br>
        </blockquote>
      </blockquote>
      <br>
    </blockquote>
    <br>
  </body>
</html>