diff --git a/.gitlab-ci/traces-panfrost.yml b/.gitlab-ci/traces-panfrost.yml index b6aa7d856f5..2e2e84f6676 100644 --- a/.gitlab-ci/traces-panfrost.yml +++ b/.gitlab-ci/traces-panfrost.yml @@ -57,7 +57,7 @@ traces: - path: 0ad/0ad.trace expectations: - device: gl-panfrost-t860 - checksum: e159a06f423998ea7fcc0107f0e62f15 + checksum: 63fd6b8720a6dbc42f3c1281179d5e82 - path: glmark2/buffer-columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=map.rdc expectations: - device: gl-panfrost-t860 @@ -125,7 +125,7 @@ traces: - path: glmark2/ideas-speed=duration.rdc expectations: - device: gl-panfrost-t860 - checksum: 2cf45bca36f4d168e96faf7f90a7e515 + checksum: 458556bc1ade89323181e4d0483a7cd3 - path: glmark2/loop-fragment-loop=false:fragment-steps=5:vertex-steps=5.rdc expectations: - device: gl-panfrost-t860 @@ -202,7 +202,7 @@ traces: - path: humus/CelShading.trace expectations: - device: gl-panfrost-t860 - checksum: e44a7ac7442e82d85de583f2cdd68fdf + checksum: 521ca6a236b8400cf692e6817b91c739 - path: humus/DynamicBranching3.trace expectations: - device: gl-panfrost-t860 diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c index 0b55528ec6a..2b752c07580 100644 --- a/src/gallium/drivers/panfrost/pan_context.c +++ b/src/gallium/drivers/panfrost/pan_context.c @@ -354,7 +354,18 @@ panfrost_draw_emit_tiler(struct panfrost_batch *batch, cfg.draw_mode = pan_draw_mode(info->mode); if (panfrost_writes_point_size(ctx)) cfg.point_size_array_format = MALI_POINT_SIZE_ARRAY_FORMAT_FP16; - cfg.first_provoking_vertex = rast->flatshade_first; + + /* For line primitives, PRIMITIVE.first_provoking_vertex must + * be set to true and the provoking vertex is selected with + * DRAW.flat_shading_vertex. + */ + if (info->mode == PIPE_PRIM_LINES || + info->mode == PIPE_PRIM_LINE_LOOP || + info->mode == PIPE_PRIM_LINE_STRIP) + cfg.first_provoking_vertex = true; + else + cfg.first_provoking_vertex = rast->flatshade_first; + if (info->primitive_restart) cfg.primitive_restart = MALI_PRIMITIVE_RESTART_IMPLICIT; cfg.job_task_split = 6; @@ -402,6 +413,18 @@ panfrost_draw_emit_tiler(struct panfrost_batch *batch, cfg.varying_buffers = fs_vary ? varyings : 0; cfg.thread_storage = shared_mem; + /* For all primitives but lines DRAW.flat_shading_vertex must + * be set to 0 and the provoking vertex is selected with the + * PRIMITIVE.first_provoking_vertex field. + */ + if (info->mode == PIPE_PRIM_LINES || + info->mode == PIPE_PRIM_LINE_LOOP || + info->mode == PIPE_PRIM_LINE_STRIP) { + /* The logic is inverted on bifrost. */ + cfg.flat_shading_vertex = + is_bifrost ? rast->flatshade_first : !rast->flatshade_first; + } + pan_emit_draw_descs(batch, &cfg, PIPE_SHADER_FRAGMENT); if (ctx->occlusion_query && ctx->active_queries) {