Skip to content

ttn: Set nir->info.separate_shader

Alyssa Rosenzweig requested to merge alyssa/mesa:tgsi/separable-fix into main

TGSI has no legitimate[1] notion of linked shaders, which means tgsi_to_nir should conservatively assume everything all shaders are separable. This requires setting nir->info.separate_shader to warn drivers that shader CSOs might be mixed and matched. Otherwise, the driver might enable optimizations that are invalid for separate shaders, causing issues when the shaders are mixed-and-matches.

This will fix varying linking with u_blitter's shaders on Panfrost (Bifrost and older), when util_blitter_clear is used with Panfrost.

[1] There was a TGSI property added recently to forward nir->info.separate_shader up to virglrenderer, but it's not actually used for anything in virglrenderer and I am still struggling to understand what the use case would be. My gut says we should revert b6340305 ("tgsi: Add SEPARABLE_PROGRAM property"), but I'm not interested in fighting that yak right now. Notably, the u_blitter and hud shaders are separable but are not marked with this property.

Signed-off-by: Alyssa Rosenzweig alyssa@collabora.com Reviewed-by: Emma Anholt emma@anholt.net Cc: mesa-stable


Picked from !17112 (merged) which is stalled on a panfrost kernel issue. Ideally this could land before it bitrots, since this fixes a ttn issue (even if it's not affecting anything yet). Emma reviewed this, but pulling out to a dedicated MR for visibility just in case anyone has objections. Cc @italove and @gerddie as potentially interested parties.

Merge request reports