asahi/clc: promote bindless textures

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35949>
This commit is contained in:
Alyssa Rosenzweig 2025-07-04 18:10:29 -04:00
parent ffe262ee11
commit 2fca9dcedf
3 changed files with 9 additions and 1 deletions

View file

@ -347,6 +347,13 @@ main(int argc, char **argv)
bool is_helper = !strcmp(libfunc->name, "libagx_helper");
struct agx_shader_key key = {
.promote_constants = !is_helper,
/* Most of the internal programs don't use textures at all, but
* the few that do are exclusively bindless, so we want to
* promote their access.
*/
.promote_textures = true,
.reserved_preamble = layout.size_B / 2,
.is_helper = is_helper,
};

View file

@ -178,6 +178,7 @@ static inline struct agx_precompiled_kernel_info
agx_compact_kernel_info(struct agx_shader_info *info)
{
assert(info->has_preamble == (info->nr_preamble_gprs > 0));
assert(info->texture_state_count <= 8 && "static maximum, no need to plumb");
return (struct agx_precompiled_kernel_info){
.preamble_offset = info->preamble_offset,

View file

@ -261,7 +261,7 @@ agx_get_precompiled_locked(struct agx_bg_eot_cache *cache, unsigned program)
/* Bake launch */
agx_pack(&p->b.launch, CDM_LAUNCH_WORD_0, cfg) {
cfg.texture_state_register_count = 0;
cfg.texture_state_register_count = 8 /* same encoding as 0 */;
cfg.sampler_state_register_count = 1;
cfg.uniform_register_count = info->push_count;
cfg.preshader_register_count = info->nr_preamble_gprs;