panfrost: fix assertion failure compiling image conversion shaders

In 59a3e12039, we changed the UBO->push optimization in panfrost to
only push UBOs that are available in a CPU buffer. We require
first_ubo_is_default_ubo, to ensure that UBO0 will be a user buffer. We
weren't setting this flag for the image conversion shaders, so got an
assertion failure compiling them. This can be triggered by the
panvk_force_afbc_packing driconf option.

The conversion shader info UBO isn't exactly a "default" UBO in the
sense of being lowered from uniforms, but it is a user buffer, so
setting the flag should be fine.

Fixes: 59a3e12039 ("panfrost: do not push "true" UBOs")
Signed-off-by: Olivia Lee <olivia.lee@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34992>
This commit is contained in:
Olivia Lee 2025-05-14 18:55:39 -07:00 committed by Marge Bot
parent 749265da0d
commit bed54fa402

View file

@ -474,6 +474,9 @@ panfrost_get_mod_convert_shaders(struct panfrost_context *ctx,
nir_shader *nir = \
panfrost_create_##name##_shader(screen, __VA_ARGS__); \
nir->info.num_ubos = 1; \
/* "default" UBO is maybe not correct here, but in panfrost we're */ \
/* using this as an indicator for whether UBO0 is a user UBO */ \
nir->info.first_ubo_is_default_ubo = true; \
shader->name##_cso = pipe_shader_from_nir(pctx, nir); \
}