mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-25 14:48:12 +02:00
ttn: Set nir->info.separate_shader
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 later treated as separable. 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 revertb634030542("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> Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com> Cc: mesa-stable Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17282> (cherry picked from commit151aa19c21)
This commit is contained in:
parent
af9b753318
commit
122e31b5ea
2 changed files with 4 additions and 1 deletions
|
|
@ -499,7 +499,7 @@
|
|||
"description": "ttn: Set nir->info.separate_shader",
|
||||
"nominated": true,
|
||||
"nomination_type": 0,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null
|
||||
},
|
||||
|
|
|
|||
|
|
@ -2326,6 +2326,9 @@ ttn_compile_init(const void *tgsi_tokens,
|
|||
s->info.num_textures = util_last_bit(scan.samplers_declared);
|
||||
s->info.internal = false;
|
||||
|
||||
/* Default for TGSI is separate, this is assumed throughout the tree */
|
||||
s->info.separate_shader = true;
|
||||
|
||||
for (unsigned i = 0; i < TGSI_PROPERTY_COUNT; i++) {
|
||||
unsigned value = scan.properties[i];
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue