From 8ccf672fa3c000b958f961812152cc1a359a8792 Mon Sep 17 00:00:00 2001 From: Emma Anholt Date: Tue, 19 Oct 2021 15:36:09 -0700 Subject: [PATCH] gallium/u_blitter: Read MSAA z/s from sampler's .x instead of .y or .z. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Marek Olšák Part-of: --- 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"); }