diff --git a/src/gallium/drivers/asahi/agx_state.c b/src/gallium/drivers/asahi/agx_state.c index 664df334395..31a9560cec6 100644 --- a/src/gallium/drivers/asahi/agx_state.c +++ b/src/gallium/drivers/asahi/agx_state.c @@ -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. */