asahi: Lower clip distances late
This pass works either early or late, so run it late. It creates some nir_variables as a side effect, which is weird, but it doesn't matter because the AGX backend doesn't look at variables and the metadata and lowered I/O intrinsics are all correct. This is the last step to moving I/O lowering (and hence shader preprocessing) to CSO create time. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21104>
This commit is contained in:
committed by
Marge Bot
parent
59c64d90e2
commit
4495f85b08
@@ -1370,14 +1370,6 @@ agx_compile_variant(struct agx_device *dev, struct agx_uncompiled_shader *so,
|
||||
|
||||
nir_shader *nir = nir_shader_clone(NULL, so->nir);
|
||||
|
||||
if (nir->info.stage == MESA_SHADER_FRAGMENT) {
|
||||
struct asahi_fs_shader_key *key = &key_->fs;
|
||||
|
||||
if (key->clip_plane_enable) {
|
||||
NIR_PASS_V(nir, nir_lower_clip_fs, key->clip_plane_enable, false);
|
||||
}
|
||||
}
|
||||
|
||||
agx_preprocess_nir(nir);
|
||||
|
||||
if (nir->info.stage == MESA_SHADER_VERTEX) {
|
||||
@@ -1412,6 +1404,10 @@ agx_compile_variant(struct agx_device *dev, struct agx_uncompiled_shader *so,
|
||||
key->sprite_coord_enable,
|
||||
false /* point coord is sysval */);
|
||||
}
|
||||
|
||||
if (key->clip_plane_enable) {
|
||||
NIR_PASS_V(nir, nir_lower_clip_fs, key->clip_plane_enable, false);
|
||||
}
|
||||
}
|
||||
|
||||
struct agx_shader_key base_key = {0};
|
||||
|
||||
Reference in New Issue
Block a user