<div dir="ltr">Thank You Francisco for pointing this out. I didn't know about this bug. </div><div class="gmail_extra"><br><div class="gmail_quote">2017-06-12 20:59 GMT+02:00 Francisco Jerez <span dir="ltr"><<a href="mailto:currojerez@riseup.net" target="_blank">currojerez@riseup.net</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Dorian Apanel <<a href="mailto:dorian.apanel@gmail.com">dorian.apanel@gmail.com</a>> writes:<br>
<br>
> Textures created by image load/store tests where not complete.<br>
> Needed to set max level, to relax mip requirements.<br>
> Load/Store on incomplete textures should return zeros/change nothing.<br>
> Added negative test case to check this.<br>
><br>
<br>
</span>I don't think these changes are correct. It's unlikely that the<br>
sampler minification controls were intended to have any effect on image<br>
unit completeness. Have a look at the related OpenGL spec bug:<br>
<br>
<a href="https://cvs.khronos.org/bugzilla/show_bug.cgi?id=16111" rel="noreferrer" target="_blank">https://cvs.khronos.org/<wbr>bugzilla/show_bug.cgi?id=16111</a><br>
<br>
And related discussion in the mesa-dev mailing list:<br>
<br>
<a href="https://lists.freedesktop.org/archives/mesa-dev/2016-July/123212.html" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>archives/mesa-dev/2016-July/<wbr>123212.html</a><br>
<div><div class="h5"><br>
> Signed-off-by: Dorian Apanel <<a href="mailto:dorian.apanel@gmail.com">dorian.apanel@gmail.com</a>><br>
> ---<br>
> tests/spec/arb_shader_image_<wbr>load_store/common.c | 9 +++++++++<br>
> tests/spec/arb_shader_image_<wbr>load_store/invalid.c | 18 ++++++++++++++++++<br>
> 2 files changed, 27 insertions(+)<br>
><br>
> diff --git a/tests/spec/arb_shader_image_<wbr>load_store/common.c b/tests/spec/arb_shader_image_<wbr>load_store/common.c<br>
> index cbeaac7..fdc2ef3 100644<br>
> --- a/tests/spec/arb_shader_image_<wbr>load_store/common.c<br>
> +++ b/tests/spec/arb_shader_image_<wbr>load_store/common.c<br>
> @@ -141,6 +141,11 @@ upload_image_levels(const struct image_info img, unsigned num_levels,<br>
> glGenTextures(1, &textures[unit]);<br>
> glBindTexture(img.target-><wbr>target, textures[unit]);<br>
><br>
> + if (img.target->target != GL_TEXTURE_BUFFER) {<br>
> + glTexParameteri(img.target-><wbr>target, GL_TEXTURE_BASE_LEVEL, 0);<br>
> + glTexParameteri(img.target-><wbr>target, GL_TEXTURE_MAX_LEVEL, num_levels - 1);<br>
> + }<br>
> +<br>
> switch (img.target->target) {<br>
> case GL_TEXTURE_1D:<br>
> for (l = 0; l < num_levels; ++l) {<br>
> @@ -301,6 +306,8 @@ upload_image_levels(const struct image_info img, unsigned num_levels,<br>
><br>
> glGenTextures(1, &tmp_tex);<br>
> glBindTexture(GL_TEXTURE_2D, tmp_tex);<br>
> + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0);<br>
> + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0);<br>
><br>
> if (img.target->target == GL_TEXTURE_2D_MULTISAMPLE_<wbr>ARRAY) {<br>
> glTexImage3DMultisample(GL_<wbr>TEXTURE_2D_MULTISAMPLE_ARRAY,<br>
> @@ -462,6 +469,8 @@ download_image_levels(const struct image_info img, unsigned num_levels,<br>
><br>
> glGenTextures(1, &tmp_tex);<br>
> glBindTexture(GL_TEXTURE_2D, tmp_tex);<br>
> + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0);<br>
> + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0);<br>
><br>
> glTexImage2D(GL_TEXTURE_2D, 0, img.format->format,<br>
> grid.size.x, grid.size.y, 0,<br>
> diff --git a/tests/spec/arb_shader_image_<wbr>load_store/invalid.c b/tests/spec/arb_shader_image_<wbr>load_store/invalid.c<br>
> index 6bf3bce..cedb37a 100644<br>
> --- a/tests/spec/arb_shader_image_<wbr>load_store/invalid.c<br>
> +++ b/tests/spec/arb_shader_image_<wbr>load_store/invalid.c<br>
> @@ -229,6 +229,14 @@ invalidate_incomplete(const struct image_info img, GLuint prog)<br>
> }<br>
><br>
> static bool<br>
> +invalidate_incomplete_max_<wbr>level(const struct image_info img, GLuint prog)<br>
> +{<br>
> + /* Change max level to greater then supplied mips count. */<br>
> + glTexParameteri(img.target-><wbr>target, GL_TEXTURE_MAX_LEVEL, 3);<br>
> + return piglit_check_gl_error(GL_NO_<wbr>ERROR);<br>
> +}<br>
> +<br>
> +static bool<br>
> invalidate_level_bounds(const struct image_info img, GLuint prog)<br>
> {<br>
> const int level = 1;<br>
> @@ -370,6 +378,16 @@ piglit_init(int argc, char **argv)<br>
> "%s/incomplete image test", op->name);<br>
><br>
> /*<br>
> + * Texture is also incomplete if not all mipmaps(down to 1x1)<br>
> + * are supplied and GL_TEXTURE_MAX_LEVEL does not relax<br>
> + * this requirement.<br>
> + */<br>
> + subtest(&status, true,<br>
> + run_test(op, def_img, def_img,<br>
> + invalidate_incomplete_max_<wbr>level, false),<br>
> + "%s/incomplete image test (MAX_LEVEL)", op->name);<br>
> +<br>
> + /*<br>
> * " * the texture level bound to the image unit is<br>
> * less than the base level or greater than the<br>
> * maximum level of the texture; [...]"<br>
> --<br>
> 2.10.2.windows.1<br>
><br>
</div></div>> ______________________________<wbr>_________________<br>
> Piglit mailing list<br>
> <a href="mailto:Piglit@lists.freedesktop.org">Piglit@lists.freedesktop.org</a><br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/piglit" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/piglit</a><br>
</blockquote></div><br></div>