Intel Gen7 GPUs don't support the ETC2 formats natively and in order to
show the pixels properly we convert them to RGBA and create RGBA miptrees.
The problem with that is that the GetCompressed* functions that should
return the compressed pixel values return the RGBA instead.

These patches are an attempt to give a solution to this problem, by
using 2 miptrees: the main to stores the ETC values and the generic
shadow (mt->shadow) to store the RGBA. Each time that the main miptree
is unmapped we unpack the ETC to RGBA and we update the shadow. Similarly,
we update all the mipmap levels of the image (if necessary) before the
drawing, for the CopyImageSubData to work.

Also, the OES_copy_image extension that couldn't work on Gen 7 due to the
lack of the ETC support is now enabled back.

Finally, the following glcts and piglit tests pass:

On HSW (previously failing):
----------------------------
KHR-GL46.direct_state_access.textures_compressed_subimage

On HSW and IVB (previously skipped):
-------------------------------------
dEQP-GLES31.functional.texture.border_clamp.formats.compressed_srgb8_alpha8_etc2_eac.*
   (6 tests)
dEQP-GLES31.functional.texture.border_clamp.formats.compressed_srgb8_etc2.*
   (6 tests)
dEQP-GLES31.functional.texture.border_clamp.formats.compressed_srgb8_punchthrough_alpha1_etc2.*
   (6 tests)

On HSW, IVB, SNB (previously skipped):
---------------------------------------
dEQP-GLES3.functional.texture.format.compressed.*
   (12 tests)
dEQP-GLES3.functional.texture.wrap.etc2_eac_srgb8_alpha8.*
   (36 tests)
dEQP-GLES3.functional.texture.wrap.etc2_srgb8.*
   (36 tests)
dEQP-GLES3.functional.texture.wrap.etc2_srgb8_punchthrough_alpha1.*
   (36 tests)

piglit.spec.!opengl es 3_0.oes_compressed_etc2_texture-miptree_gles3 
   (srgb8, srgb8-alpha, srgb8-punchthrough-alpha1)
piglit.spec.arb_es3_compatibility.oes_compressed_etc2_texture-miptree
   (srgb8 compat, srgb8 core, srgb8-alpha8 compat, srgb8-alpha8 core,
    srgb8-punchthrough-alpha1 compat, srgb8-punchthrough-alpha1 core)
(9 tests)

Total tests passing: 148

Eleni Maria Stea (3):
  i965: Faking the ETC2 compression on Gen < 8 GPUs using two miptrees.
  i965: Fixed the CopyImageSubData for ETC2 on Gen < 8
  i965: Enabled the OES_copy_image extension on Gen 7 GPUs

Nanley Chery (1):
  i965: Rename intel_mipmap_tree::r8stencil_* -> ::shadow_*

 src/mesa/drivers/dri/i965/brw_draw.c          |   5 +
 .../drivers/dri/i965/brw_wm_surface_state.c   |  13 +-
 src/mesa/drivers/dri/i965/intel_extensions.c  |  16 +-
 src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 179 ++++++++++--------
 src/mesa/drivers/dri/i965/intel_mipmap_tree.h |  38 +++-
 5 files changed, 161 insertions(+), 90 deletions(-)

-- 
2.20.1

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to