aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2020-05-29 16:05:22 -0400
committerMarge Bot <[email protected]>2020-05-29 20:19:46 +0000
commit52875a34aaf7eaf913740f157bccce5e82f8679b (patch)
tree1f1e240f649d4e9aea79214fe3ed17d8be45690a /src
parent11470fcde266aa8b864b6a114fc923b2b8e5907a (diff)
panfrost: Don't generate gl_FragCoord varying on Bifrost
It's treated as a sysval there, so that's silly. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5267>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/panfrost/pan_cmdstream.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c
index c77afaedc0d..0a3bbc97688 100644
--- a/src/gallium/drivers/panfrost/pan_cmdstream.c
+++ b/src/gallium/drivers/panfrost/pan_cmdstream.c
@@ -1724,6 +1724,7 @@ panfrost_emit_varying_descriptor(struct panfrost_batch *batch,
{
/* Load the shaders */
struct panfrost_context *ctx = batch->ctx;
+ struct panfrost_device *device = pan_device(ctx->base.screen);
struct panfrost_shader_state *vs, *fs;
unsigned int num_gen_varyings = 0;
size_t vs_size, fs_size;
@@ -1816,7 +1817,9 @@ panfrost_emit_varying_descriptor(struct panfrost_batch *batch,
signed gl_PointSize = vs->writes_point_size ? (idx++) : -1;
signed gl_PointCoord = reads_point_coord ? (idx++) : -1;
signed gl_FrontFacing = fs->reads_face ? (idx++) : -1;
- signed gl_FragCoord = fs->reads_frag_coord ? (idx++) : -1;
+ signed gl_FragCoord = (fs->reads_frag_coord &&
+ !(device->quirks & IS_BIFROST))
+ ? (idx++) : -1;
/* Emit the stream out buffers */
@@ -1860,16 +1863,15 @@ panfrost_emit_varying_descriptor(struct panfrost_batch *batch,
primitive_size->pointer = varyings_p;
}
- if (reads_point_coord)
+ if (gl_PointCoord >= 0)
varyings[gl_PointCoord].elements = MALI_VARYING_POINT_COORD;
- if (fs->reads_face)
+ if (gl_FrontFacing >= 0)
varyings[gl_FrontFacing].elements = MALI_VARYING_FRONT_FACING;
- if (fs->reads_frag_coord)
+ if (gl_FragCoord >= 0)
varyings[gl_FragCoord].elements = MALI_VARYING_FRAG_COORD;
- struct panfrost_device *device = pan_device(ctx->base.screen);
assert(!(device->quirks & IS_BIFROST) || !(reads_point_coord));
/* Let's go ahead and link varying meta to the buffer in question, now