Mesa (staging/21.3): nir/lower_pntc_ytransform: Support PointCoordIsSysval

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Nov 17 20:07:01 UTC 2021


Module: Mesa
Branch: staging/21.3
Commit: ffb3ab4d7ad5a0f38cf308fc81c69c460e1bf6a6
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ffb3ab4d7ad5a0f38cf308fc81c69c460e1bf6a6

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>
(cherry picked from commit e257344a82417b6dc28d5834a0a9376fefd7f5ac)

---

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

diff --git a/.pick_status.json b/.pick_status.json
index 137884bed60..666a3b17de9 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1426,7 +1426,7 @@
         "description": "nir/lower_pntc_ytransform: Support PointCoordIsSysval",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": null
     },
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 dda54433aa0..a17c87e46e7 100644
--- a/src/panfrost/ci/panfrost-g52-fails.txt
+++ b/src/panfrost/ci/panfrost-g52-fails.txt
@@ -19,7 +19,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
@@ -102,7 +101,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
@@ -1291,6 +1289,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