diff --git a/src/gallium/drivers/asahi/agx_uniforms.c b/src/gallium/drivers/asahi/agx_uniforms.c index ca4d8cc95f2..5a389ff928a 100644 --- a/src/gallium/drivers/asahi/agx_uniforms.c +++ b/src/gallium/drivers/asahi/agx_uniforms.c @@ -89,6 +89,7 @@ agx_upload_stage_uniforms(struct agx_batch *batch, uint64_t textures, { struct agx_context *ctx = batch->ctx; struct agx_stage *st = &ctx->stage[stage]; + struct agx_device *dev = agx_device(ctx->base.screen); struct agx_ptr root_ptr = agx_pool_alloc_aligned( &batch->pool, sizeof(struct agx_stage_uniforms), 16); @@ -101,6 +102,16 @@ agx_upload_stage_uniforms(struct agx_batch *batch, uint64_t textures, uniforms.lod_bias[s] = st->samplers[s]->lod_bias_as_fp16; } + /* If we use bindless samplers, insert sampler into the heap */ + if (st->shader && st->shader->uses_bindless_samplers) { + u_foreach_bit(s, st->valid_samplers) { + uniforms.sampler_handle[s] = + 28 + + agx_sampler_heap_add(dev, &batch->sampler_heap, + &st->samplers[s]->desc_without_custom_border); + } + } + u_foreach_bit(cb, st->cb_mask) { uniforms.ubo_base[cb] = agx_const_buffer_ptr(batch, &st->cb[cb]); }