Mesa (master): panfrost: Don't double-flip Z/W for 2D arrays
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Jan 7 08:08:03 UTC 2020
Module: Mesa
Branch: master
Commit: 4cd3dc94ad7ba991c960457b9134ce233b5b41ab
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=4cd3dc94ad7ba991c960457b9134ce233b5b41ab
Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date: Mon Jan 6 21:36:20 2020 -0500
panfrost: Don't double-flip Z/W for 2D arrays
We need to mindful that we don't clobber the shadow comparator.
Fixes dEQP-GLES3.functional.shaders.texture_functions.texture.sampler2darrayshadow_*
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso at collabora.com>
---
src/panfrost/midgard/midgard_compile.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/panfrost/midgard/midgard_compile.c b/src/panfrost/midgard/midgard_compile.c
index 568a08da44c..efd9f483de5 100644
--- a/src/panfrost/midgard/midgard_compile.c
+++ b/src/panfrost/midgard/midgard_compile.c
@@ -1837,10 +1837,13 @@ emit_texop_native(compiler_context *ctx, nir_tex_instr *instr,
}
if (instr->sampler_dim == GLSL_SAMPLER_DIM_2D) {
- /* Array component in w but NIR wants it in z */
+ /* Array component in w but NIR wants it in z,
+ * but if we have a temp coord we already fixed
+ * that up */
+
if (nr_components == 3) {
ins.swizzle[1][2] = COMPONENT_Z;
- ins.swizzle[1][3] = COMPONENT_Z;
+ ins.swizzle[1][3] = needs_temp_coord ? COMPONENT_W : COMPONENT_Z;
} else if (nr_components == 2) {
ins.swizzle[1][2] =
instr->is_shadow ? COMPONENT_Z : COMPONENT_X;
More information about the mesa-commit
mailing list