asahi: Plumb through lower_clip_fs

Key to rast->clip_plane_enable and lower. This fixes translucency of one
of the surfaces in the Neverball title screen.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17198>
This commit is contained in:
Alyssa Rosenzweig 2022-08-02 21:18:22 -04:00
parent e441896eb8
commit 8a1050082f
2 changed files with 7 additions and 0 deletions

View file

@ -943,6 +943,11 @@ agx_update_shader(struct agx_context *ctx, struct agx_compiled_shader **out,
NIR_PASS_V(nir, nir_lower_blend, &opts);
NIR_PASS_V(nir, nir_lower_fragcolor, key->nr_cbufs);
if (key->clip_plane_enable) {
NIR_PASS_V(nir, nir_lower_clip_fs, key->clip_plane_enable,
false);
}
}
agx_compile_shader_nir(nir, &key->base, &binary, &compiled->info);
@ -1017,6 +1022,7 @@ agx_update_fs(struct agx_context *ctx)
{
struct asahi_shader_key key = {
.nr_cbufs = ctx->batch->nr_cbufs,
.clip_plane_enable = ctx->rast->base.clip_plane_enable,
};
for (unsigned i = 0; i < key.nr_cbufs; ++i) {

View file

@ -135,6 +135,7 @@ struct asahi_shader_key {
struct agx_shader_key base;
struct agx_blend blend;
unsigned nr_cbufs;
uint8_t clip_plane_enable;
enum pipe_format rt_formats[PIPE_MAX_COLOR_BUFS];
};