summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIcecream95 <ixn@disroot.org>2021-04-10 15:28:15 +1200
committerIcecream95 <ixn@disroot.org>2021-04-10 16:56:39 +1200
commit0a7a61b2d778aaf1fb28d97d7e0467907226989d (patch)
tree2e90fb1936059adf0e486979c6acf00d8bced7e4 /src
parentc43109c07b080dd01e0db1baf003966f8a79b726 (diff)
panfrost: Only do point coord replacement for PIPE_PRIM_POINTS
Fixes rendering in Terraria on Midgard. Thanks to macc24 for reporting this and to HdkR for pointing me to a similar issue for virgl. Cc: mesa-stable Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10154>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/panfrost/pan_cmdstream.c5
-rw-r--r--src/gallium/drivers/panfrost/pan_cmdstream.h3
-rw-r--r--src/gallium/drivers/panfrost/pan_context.c10
3 files changed, 13 insertions, 5 deletions
diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c
index 1e8462e5e4d..b2b8b987be7 100644
--- a/src/gallium/drivers/panfrost/pan_cmdstream.c
+++ b/src/gallium/drivers/panfrost/pan_cmdstream.c
@@ -2107,7 +2107,8 @@ panfrost_emit_varying_descriptor(struct panfrost_batch *batch,
mali_ptr *buffers,
unsigned *buffer_count,
mali_ptr *position,
- mali_ptr *psiz)
+ mali_ptr *psiz,
+ bool point_coord_replace)
{
/* Load the shaders */
struct panfrost_context *ctx = batch->ctx;
@@ -2131,7 +2132,7 @@ panfrost_emit_varying_descriptor(struct panfrost_batch *batch,
uint16_t point_coord_mask = ctx->rasterizer->base.sprite_coord_enable;
/* TODO: point sprites need lowering on Bifrost */
- if (pan_is_bifrost(dev))
+ if (!point_coord_replace || pan_is_bifrost(dev))
point_coord_mask = 0;
unsigned present = pan_varying_present(dev, vs, fs, point_coord_mask);
diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.h b/src/gallium/drivers/panfrost/pan_cmdstream.h
index cdca802615b..4a46976a247 100644
--- a/src/gallium/drivers/panfrost/pan_cmdstream.h
+++ b/src/gallium/drivers/panfrost/pan_cmdstream.h
@@ -84,7 +84,8 @@ panfrost_emit_varying_descriptor(struct panfrost_batch *batch,
mali_ptr *buffers,
unsigned *buffer_count,
mali_ptr *position,
- mali_ptr *psiz);
+ mali_ptr *psiz,
+ bool point_coord_replace);
void
panfrost_emit_vertex_tiler_jobs(struct panfrost_batch *batch,
diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index 11e32c86b45..b3c05805ac7 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -557,11 +557,14 @@ panfrost_direct_draw(struct panfrost_context *ctx,
/* Emit all sort of descriptors. */
mali_ptr varyings = 0, vs_vary = 0, fs_vary = 0, pos = 0, psiz = 0;
+ bool point_coord_replace = (info->mode == PIPE_PRIM_POINTS);
+
panfrost_emit_varying_descriptor(batch,
ctx->padded_count *
ctx->instance_count,
&vs_vary, &fs_vary, &varyings,
- NULL, &pos, &psiz);
+ NULL, &pos, &psiz,
+ point_coord_replace);
mali_ptr attribs, attrib_bufs;
attribs = panfrost_emit_vertex_data(batch, &attrib_bufs);
@@ -654,9 +657,12 @@ panfrost_indirect_draw(struct panfrost_context *ctx,
ctx->instance_count = ctx->vertex_count = ctx->padded_count = 0;
ctx->offset_start = 0;
+ bool point_coord_replace = (info->mode == PIPE_PRIM_POINTS);
+
panfrost_emit_varying_descriptor(batch, 0,
&vs_vary, &fs_vary, &varyings,
- &varying_buf_count, &pos, &psiz);
+ &varying_buf_count, &pos, &psiz,
+ point_coord_replace);
mali_ptr attribs, attrib_bufs;
attribs = panfrost_emit_vertex_data(batch, &attrib_bufs);