Mesa (main): nir/lower_pntc_ytransform: Support PointCoordIsSysval

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Nov 12 13:07:45 UTC 2021


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

Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date:   Mon Sep 27 17:15:38 2021 -0400

nir/lower_pntc_ytransform: Support PointCoordIsSysval

Pattern match the point coord sysval and support lowering it as well.
This is required to handle flipped framebuffers on Bifrost. However,
what this pass normalizes to is the opposite of the hardware mode we
used on Bifrost before, so we need to swap modes at the same time to
prevent regressions.

Fixes Piglit glsl-fs-pointcoord and glsl-fs-pointcoord_gles2

Signed-off-by: Alyssa Rosenzweig <alyssa at collabora.com>
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13073>

---

 src/compiler/nir/nir_lower_pntc_ytransform.c | 6 ++++--
 src/panfrost/ci/panfrost-g52-fails.txt       | 3 ---
 src/panfrost/lib/pan_shader.h                | 4 ++++
 3 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/compiler/nir/nir_lower_pntc_ytransform.c b/src/compiler/nir/nir_lower_pntc_ytransform.c
index 91dda527d1b..e7b12b4ec65 100644
--- a/src/compiler/nir/nir_lower_pntc_ytransform.c
+++ b/src/compiler/nir/nir_lower_pntc_ytransform.c
@@ -94,8 +94,10 @@ lower_pntc_ytransform_block(lower_pntc_ytransform_state *state,
             nir_deref_instr *deref = nir_src_as_deref(intr->src[0]);
             nir_variable *var = nir_deref_instr_get_variable(deref);
 
-            if (var->data.mode == nir_var_shader_in &&
-                var->data.location == VARYING_SLOT_PNTC) {
+            if ((var->data.mode == nir_var_shader_in &&
+                 var->data.location == VARYING_SLOT_PNTC) ||
+                (var->data.mode == nir_var_system_value &&
+                 var->data.location == SYSTEM_VALUE_POINT_COORD)) {
                 lower_load_pointcoord(state, intr);
             }
          }
diff --git a/src/panfrost/ci/panfrost-g52-fails.txt b/src/panfrost/ci/panfrost-g52-fails.txt
index 4b15631fb9a..de573803020 100644
--- a/src/panfrost/ci/panfrost-g52-fails.txt
+++ b/src/panfrost/ci/panfrost-g52-fails.txt
@@ -18,7 +18,6 @@ glx at glx-swap-pixmap-bad,Fail
 glx at glx-visuals-depth -pixmap,Crash
 glx at glx-visuals-stencil -pixmap,Crash
 shaders at glsl-bug-110796,Fail
-shaders at glsl-fs-pointcoord,Fail
 shaders at glsl-uniform-interstage-limits@subdivide 5,Crash
 shaders at glsl-uniform-interstage-limits@subdivide 5- statechanges,Crash
 shaders at glsl-vs-if-bool,Fail
@@ -101,7 +100,6 @@ spec at arb_fragment_program@sparse-samplers,Crash
 spec at arb_framebuffer_object@arb_framebuffer_object-depth-stencil-blit depth gl_depth32f_stencil8,Fail
 spec at arb_framebuffer_object@arb_framebuffer_object-depth-stencil-blit depth_stencil gl_depth32f_stencil8,Fail
 spec at arb_framebuffer_object@arb_framebuffer_object-depth-stencil-blit stencil gl_depth32f_stencil8,Fail
-spec at arb_framebuffer_object@fbo-gl_pointcoord,Fail
 spec at arb_framebuffer_object@fbo-luminance-alpha,Fail
 spec at arb_framebuffer_srgb@fbo-fast-clear,Fail
 spec at arb_get_program_binary@restore-sso-program,Fail
@@ -1282,6 +1280,5 @@ spec@!opengl 3.1 at primitive-restart-xfb generated,Fail
 spec@!opengl 3.1 at primitive-restart-xfb written,Fail
 spec@!opengl 3.1 at required-texture-attachment-formats,Fail
 spec@!opengl 3.2 at coord-replace-doesnt-eliminate-frag-tex-coords,Fail
-spec@!opengl es 2.0 at glsl-fs-pointcoord,Fail
 spec@!opengl es 3.0 at ext_texture_array-compressed_gles3 texsubimage,Fail
 spec@!opengl es 3.0 at gles-3.0-transform-feedback-uniform-buffer-object,Fail
diff --git a/src/panfrost/lib/pan_shader.h b/src/panfrost/lib/pan_shader.h
index 50867c46053..b975698be5c 100644
--- a/src/panfrost/lib/pan_shader.h
+++ b/src/panfrost/lib/pan_shader.h
@@ -142,6 +142,10 @@ pan_shader_prepare_bifrost_rsd(const struct pan_shader_info *info,
                 rsd->properties.shader_wait_dependency_7 = info->bifrost.wait_7;
 #endif
 
+                /* Match the mesa/st convention. If this needs to be flipped,
+                 * nir_lower_pntc_ytransform will do so. */
+                rsd->properties.point_sprite_coord_origin_max_y = true;
+
                 rsd->properties.allow_forward_pixel_to_be_killed =
                         !info->fs.sidefx;
 



More information about the mesa-commit mailing list