agx: report sampler state count

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36127>
This commit is contained in:
Alyssa Rosenzweig 2025-07-14 19:12:14 -04:00 committed by Marge Bot
parent 2340541eca
commit 4a9ae295cd
2 changed files with 6 additions and 2 deletions

View file

@ -1182,6 +1182,8 @@ agx_emit_image_load(agx_builder *b, agx_index dst, nir_intrinsic_instr *intr)
I->mask = agx_expand_tex_to(b, &intr->def, tmp, !sparse);
b->shader->out->uses_txf = true;
b->shader->out->sampler_state_count =
MAX2(b->shader->out->sampler_state_count, 1);
return NULL;
}
@ -2347,6 +2349,8 @@ agx_emit_tex(agx_builder *b, nir_tex_instr *instr)
if (instr->op == nir_texop_txf || instr->op == nir_texop_txf_ms) {
I->op = AGX_OPCODE_TEXTURE_LOAD;
b->shader->out->uses_txf = true;
b->shader->out->sampler_state_count =
MAX2(b->shader->out->sampler_state_count, 1);
}
/* Destination masking doesn't seem to work properly for gathers (because

View file

@ -140,8 +140,8 @@ struct agx_shader_info {
/* Uses txf and hence needs a txf sampler mapped */
bool uses_txf;
/* Number of texture state registers pushed by the preamble. */
uint8_t texture_state_count;
/* Number of texture/sampler state registers pushed by the preamble. */
uint8_t texture_state_count, sampler_state_count;
/* Number of 16-bit registers used by the main shader and preamble
* respectively.