[Mesa-dev] [PATCH] mesa: Require mipmap completeness for glCopyImageSubData(), sometimes.

Kenneth Graunke kenneth at whitecape.org
Mon Feb 27 23:03:56 UTC 2017


On Monday, February 27, 2017 5:42:36 AM PST Roland Scheidegger wrote:
> Sounds exactly like something which applications would get wrong (as the
> condition is indeed quite bizarre).

I agree - and it's pointless.  I think it would be better to clarify
the specification to say that sampler-based completeness rules are
ignored.

> At least, unlike using texelFetch with an incomplete texture (due to
> mipfilter again, even though that sampler state is unused with
> texelFetch) it is a honest error here...

True.

> But if other drivers honor that (even with GL not just GLES?) it
> hopefully won't do too much harm, and chances are it gets mostly used
> with immutable textures in any case...
> 
> Roland

So, it turns out the story is a bit more complicated:

GL45-CTS.copy_image.smoke_test creates a GL_RGBA32UI texture, but leaves
the min and mag filters in the texture's sampler object set to the
default values of GL_NEAREST_MIPMAP_LINEAR and GL_LINEAR.

The completeness rules state (quoting GL 4.5 section 8.17 here):

"A texture is complete unless any of the following conditions hold true:

 * Any of:
    - The internal format of the texture is integer (see table 8.12).
    - The internal format is STENCIL_INDEX.
    - The internal format is DEPTH_STENCIL, and the value of
      DEPTH_STENCIL_TEXTURE_MODE for the texture is STENCIL_INDEX.

and either the magnification filter is not NEAREST, or the minification filter
is neither NEAREST nor NEAREST_MIPMAP_NEAREST."

GL45-CTS.copy_image.incompatible_formats and GL45-CTS.copy_image.incompatible_formats_compression have the same issue.

In other words...

- dEQP-GLES31.functional.debug.negative_coverage.*.buffer.copy_image_sub_data
  requires us to enforce mipmap completeness based on the sampler's min filter

- GL45-CTS.copy_image.smoke_test and GL45-CTS.copy_image.incompatible_formats[_compression]
  require us to *ignore* the min filter and mag filter and skip the
  "integer format? -> NEAREST/NEAREST_MIPMAP_NEAREST or incomplete"
  checks.

This is a bit too inconsistent for my tastes, so I'll go pursue this
further with Khronos.  NAK on my patch for now.

--Ken
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170227/712a6643/attachment.sig>


More information about the mesa-dev mailing list