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>
This commit is contained in:
Icecream95 2021-04-10 15:28:15 +12:00
parent c43109c07b
commit 0a7a61b2d7
3 changed files with 13 additions and 5 deletions

View File

@ -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);

View File

@ -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,

View File

@ -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);