Module: Mesa
Branch: master
Commit: 6a154aea0d3375aa8469f28bb8a85e5ee79eef4a
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=6a154aea0d3375aa8469f28bb8a85e5ee79eef4a

Author: Eric Anholt <[email protected]>
Date:   Tue May 19 16:21:20 2020 -0700

freedreno/a5xx: Set MIN_LAYERSZ on 3D textures like we do on a6xx.

These fields (TILE_ALL and MIN_LAYERSZ) seem to be the same on a5xx as
a6xx, having looked at some UBWC vs non-UBWC texturator cases.  Setting
MIN_LAYERSZ does fix the 3D fail we see in the CTS.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5127>

---

 .gitlab-ci/deqp-freedreno-a530-fails.txt         |  1 -
 src/freedreno/registers/a5xx.xml                 | 13 +++++++++++++
 src/gallium/drivers/freedreno/a5xx/fd5_texture.c |  2 ++
 3 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/.gitlab-ci/deqp-freedreno-a530-fails.txt 
b/.gitlab-ci/deqp-freedreno-a530-fails.txt
index 20f6cc1d851..56c8cd7284c 100644
--- a/.gitlab-ci/deqp-freedreno-a530-fails.txt
+++ b/.gitlab-ci/deqp-freedreno-a530-fails.txt
@@ -9,7 +9,6 @@ 
dEQP-GLES2.functional.texture.specification.basic_copytexsubimage2d.2d_luminance
 dEQP-GLES2.functional.texture.specification.basic_copytexsubimage2d.2d_rgb
 dEQP-GLES2.functional.texture.specification.basic_copytexsubimage2d.2d_rgba
 dEQP-GLES3.functional.fbo.blit.rect.nearest_consistency_mag_reverse_dst_y
-dEQP-GLES3.functional.texture.specification.texstorage3d.size.3d_57x63x11_2_levels
 dEQP-GLES3.functional.transform_feedback.array.interleaved.lines.lowp_float
 dEQP-GLES3.functional.transform_feedback.array.interleaved.lines.mediump_int
 dEQP-GLES3.functional.transform_feedback.array.interleaved.points.highp_mat3x2
diff --git a/src/freedreno/registers/a5xx.xml b/src/freedreno/registers/a5xx.xml
index 945e09e5b36..dc809cfb716 100644
--- a/src/freedreno/registers/a5xx.xml
+++ b/src/freedreno/registers/a5xx.xml
@@ -2902,7 +2902,20 @@ different border-color states per texture..  Looks 
something like:
                <bitfield name="TYPE" low="29" high="30" type="a5xx_tex_type"/>
        </reg32>
        <reg32 offset="3" name="3">
+               <!--
+               ARRAY_PITCH is basically LAYERSZ for the first mipmap level, and
+               for 3d textures (laid out mipmap level first) MIN_LAYERSZ is the
+               layer size at the point that it stops being reduced moving to
+               higher (smaller) mipmap levels
+                -->
                <bitfield name="ARRAY_PITCH" low="0" high="13" shr="12" 
type="uint"/>
+               <!--
+               by default levels with w < 16 are linear
+               TILE_ALL makes all levels have tiling
+               seems required when using UBWC, since all levels have UBWC (can 
possibly be disabled?)
+                -->
+               <bitfield name="TILE_ALL" pos="27" type="boolean"/>
+               <bitfield name="MIN_LAYERSZ" low="23" high="26" shr="12"/>
                <bitfield name="FLAG" pos="28" type="boolean"/>
        </reg32>
        <reg32 offset="4" name="4">
diff --git a/src/gallium/drivers/freedreno/a5xx/fd5_texture.c 
b/src/gallium/drivers/freedreno/a5xx/fd5_texture.c
index fdfb2c7d943..ca7bafb0c7a 100644
--- a/src/gallium/drivers/freedreno/a5xx/fd5_texture.c
+++ b/src/gallium/drivers/freedreno/a5xx/fd5_texture.c
@@ -306,6 +306,8 @@ fd5_sampler_view_create(struct pipe_context *pctx, struct 
pipe_resource *prsc,
                break;
        case PIPE_TEXTURE_3D:
                so->texconst3 =
+                       A5XX_TEX_CONST_3_MIN_LAYERSZ(
+                               fd_resource_slice(rsc, 
prsc->last_level)->size0) |
                        A5XX_TEX_CONST_3_ARRAY_PITCH(slice->size0);
                so->texconst5 =
                        A5XX_TEX_CONST_5_DEPTH(u_minify(prsc->depth0, lvl));

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to