Module: Mesa
Branch: main
Commit: 6938c9f9cd06fff8cdf284aa6316570242a1f17a
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=6938c9f9cd06fff8cdf284aa6316570242a1f17a

Author: Alyssa Rosenzweig <[email protected]>
Date:   Sat Aug 20 12:59:01 2022 -0400

u_transfer_helper: Pack Z24S8 to Z24-in-Z32F and S8

On Asahi needed to pass

   
dEQP-GLES3.functional.texture.specification.texsubimage2d_depth.depth24_stencil8

Signed-off-by: Alyssa Rosenzweig <[email protected]>
Acked-by: Mike Blumenkrantz <[email protected]>
Acked-by: Dave Airlie <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18136>

---

 src/gallium/auxiliary/util/u_transfer_helper.c | 28 ++++++++++++++++++--------
 1 file changed, 20 insertions(+), 8 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_transfer_helper.c 
b/src/gallium/auxiliary/util/u_transfer_helper.c
index 1aaf2b382a7..fbb523fcf83 100644
--- a/src/gallium/auxiliary/util/u_transfer_helper.c
+++ b/src/gallium/auxiliary/util/u_transfer_helper.c
@@ -324,14 +324,26 @@ u_transfer_helper_transfer_map(struct pipe_context *pctx,
                                                           width, height);
             break;
          case PIPE_FORMAT_Z24_UNORM_S8_UINT:
-            assert(!helper->z24_in_z32f);
-            util_format_z24_unorm_s8_uint_pack_separate(trans->staging,
-                                                        ptrans->stride,
-                                                        trans->ptr,
-                                                        trans->trans->stride,
-                                                        trans->ptr2,
-                                                        trans->trans2->stride,
-                                                        width, height);
+            if (helper->z24_in_z32f) {
+               util_format_z24_unorm_s8_uint_pack_z_float(trans->staging,
+                                                          ptrans->stride,
+                                                          trans->ptr,
+                                                          trans->trans->stride,
+                                                          width, height);
+               util_format_z24_unorm_s8_uint_pack_s_8uint(trans->staging,
+                                                          ptrans->stride,
+                                                          trans->ptr2,
+                                                          
trans->trans2->stride,
+                                                          width, height);
+            } else {
+               util_format_z24_unorm_s8_uint_pack_separate(trans->staging,
+                                                           ptrans->stride,
+                                                           trans->ptr,
+                                                           
trans->trans->stride,
+                                                           trans->ptr2,
+                                                           
trans->trans2->stride,
+                                                           width, height);
+            }
             break;
          default:
             unreachable("Unexpected format");

Reply via email to