asahi: use GS for first-provoking fans

workaround hw bug / missing feature, in a vk compliant way.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
This commit is contained in:
Alyssa Rosenzweig
2023-11-20 16:08:19 -04:00
parent e10e21120b
commit 2129fe30bc

View File

@@ -3621,6 +3621,24 @@ agx_needs_passthrough_gs(struct agx_context *ctx,
return true;
}
/* Experimentally, G13 does not seem to pick the right provoking vertex for
* triangle fans with first provoking. Inserting a GS for this case lets us
* use our (correct) shader-based input assembly, translating to
* appropriately oriented triangles and working around the hardware issue.
* This warrants more investigation in case we're just misconfiguring the
* hardware, but as tri fans are absent in Metal and GL defaults to last
* vertex, this is a plausible part of the hardware to be broken (or absent).
*
* Affects piglit clipflat.
*/
if (info->mode == MESA_PRIM_TRIANGLE_FAN &&
ctx->rast->base.flatshade_first &&
ctx->stage[MESA_SHADER_FRAGMENT].shader->info.inputs_flat_shaded) {
perf_debug_ctx(ctx, "Using passthrough GS due to tri fan bug");
return true;
}
/* Transform feedback is layered on geometry shaders, so if transform
* feedback is used, we need a GS.
*/