[Mesa-dev] [PATCH 4/8] i965: Update the shadow miptree from the main to fake the ETC2 compression

Nanley Chery nanleychery at gmail.com
Wed Feb 6 17:51:15 UTC 2019


On Sun, Feb 03, 2019 at 03:59:42PM +0200, Eleni Maria Stea wrote:
> On Fri, 18 Jan 2019 17:09:03 -0800
> Nanley Chery <nanleychery at gmail.com> wrote:
> 
> > On Mon, Nov 19, 2018 at 10:54:08AM +0200, Eleni Maria Stea wrote:
> [...]
> > > +   int img_d = smt->surf.logical_level0_px.depth;  
> > 
> > I don't think 3D ETC textures are possible. From the GL4.6 spec:
> > 
> > 	An INVALID_OPERATION error is generated by
> > CompressedTexImage3D if internalformat is one of the EAC, ETC2, or
> > RGTC formats and either border is non-zero, or target is not
> > TEXTURE_2D_ARRAY.
> 
> Hi Nanley,
> 
> Thanks for pointing this out. I've made the change in my new series
> of patches but after giving it a second thought, I believe that I'd
> rather put back the depth in the calculation of num_slices:
> 
> As, I understand the spec, if the border is zero, the 3D images should
> be supported. Mesa already checks the border value in the file:
> src/mesa/main/teximage.c function: compressed_texture_error_check and
> has a comment:
> 

OpenGL 4.6 says:

   An INVALID_OPERATION error is generated by CompressedTexImage3D if
   internalformat is one of the EAC, ETC2, or RGTC formats and either
   border is non-zero, or target is not TEXTURE_2D_ARRAY.

In this case, it means that we should return an error if the texture
target isn't a 2D array (regardless of the border value).

> /* No compressed formats support borders at this time */
> 
> and so only ETC/EAC compressed formats without border will reach the
> update function and we should support them.
> 

In this function, 3D ETC compressed textures return an GL error where it
calls _mesa_target_can_be_compressed() at line 2034:

   if (!_mesa_target_can_be_compressed(ctx, target, internalFormat, &error)) {
      reason = "target";
      goto error;
   }

> Also, I see that we have some CTS tests that call the
> CompressedTexImage3D for ETC/EAC formats with 0 border value, so I
> suppose that is expected to have 3D images of these formats.
> 

As seen from the citation above, ETC/EAC formats must have a 0 border
value and a target of TEXTURE_2D_ARRAY when calling
CompressedTexImage3D.

> What do you think?
> 
> Thank you in advance,
> Eleni


More information about the mesa-dev mailing list