Mesa (main): gallium/u_blitter: Read MSAA z/s from sampler's .x instead of .y or .z.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Oct 22 18:53:55 UTC 2021


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

Author: Emma Anholt <emma at anholt.net>
Date:   Tue Oct 19 15:36:09 2021 -0700

gallium/u_blitter: Read MSAA z/s from sampler's .x instead of .y or .z.

u_format defines depth formats as having depth in .x, mesa/st samples for
depth or stencil in .x (not making use of any other channels).
util_make_fs_blit_zs() looks for depth or stencil in .x.  The MSAA path
was the exception looking for it in .z or .y, which was causing drivers to
need to splat their values out to the other channels.  This should be
better on hardware that can emit shorter messages for sampling just the
first channels.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13446>

---

 src/gallium/auxiliary/util/u_simple_shaders.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_simple_shaders.c b/src/gallium/auxiliary/util/u_simple_shaders.c
index aaaa0434804..7a9c5cf435f 100644
--- a/src/gallium/auxiliary/util/u_simple_shaders.c
+++ b/src/gallium/auxiliary/util/u_simple_shaders.c
@@ -623,7 +623,8 @@ util_make_fs_blit_msaa_depth(struct pipe_context *pipe,
                              enum tgsi_texture_type tgsi_tex)
 {
    return util_make_fs_blit_msaa_gen(pipe, tgsi_tex, "FLOAT",
-                                     "POSITION", ".z", "", "");
+                                     "POSITION", ".z", "",
+                                     "MOV TEMP[0].z, TEMP[0].xxxx\n");
 }
 
 
@@ -637,7 +638,8 @@ util_make_fs_blit_msaa_stencil(struct pipe_context *pipe,
                                enum tgsi_texture_type tgsi_tex)
 {
    return util_make_fs_blit_msaa_gen(pipe, tgsi_tex, "UINT",
-                                     "STENCIL", ".y", "", "");
+                                     "STENCIL", ".y", "",
+                                     "MOV TEMP[0].y, TEMP[0].xxxx\n");
 }
 
 



More information about the mesa-commit mailing list