panfrost: Preload gl_FragCoord on Bifrost
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 29 May 2020 20:06:39 +0000 (16:06 -0400)
committerMarge Bot <eric+marge@anholt.net>
Fri, 29 May 2020 20:19:46 +0000 (20:19 +0000)
It's a precoloured register but we do need to specify in the cmdstream
that we want the preloading to happen.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5267>

src/gallium/drivers/panfrost/pan_cmdstream.c

index 0a3bbc976888e8127aae4e5ed12ba9cff433dae4..14d013f08c9873067c49e9be374548d9cc39bd4f 100644 (file)
@@ -338,8 +338,11 @@ panfrost_shader_meta_init(struct panfrost_context *ctx,
                 meta->bifrost1.uniform_buffer_count = panfrost_ubo_count(ctx, st);
                 if (st == PIPE_SHADER_VERTEX)
                         meta->bifrost2.preload_regs = 0xC0;
-                else
+                else {
                         meta->bifrost2.preload_regs = 0x1;
+                        SET_BIT(meta->bifrost2.preload_regs, 0x10, ss->reads_frag_coord);
+                }
+
                 meta->bifrost2.uniform_count = MIN2(ss->uniform_count,
                                                     ss->uniform_cutoff);
         } else {