agx: report uses_txf
so driver can optimize usc binding. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29179>
This commit is contained in:
committed by
Marge Bot
parent
54ec9512ef
commit
5a3ac73747
@@ -1063,6 +1063,8 @@ agx_emit_image_load(agx_builder *b, agx_index dst, nir_intrinsic_instr *intr)
|
||||
b, tmp, coords, lod, bindless, texture, agx_immediate(0), agx_null(),
|
||||
agx_tex_dim(dim, is_array), lod_mode, 0, false);
|
||||
I->mask = agx_expand_tex_to(b, &intr->def, tmp, true);
|
||||
|
||||
b->shader->out->uses_txf = true;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -2098,8 +2100,10 @@ agx_emit_tex(agx_builder *b, nir_tex_instr *instr)
|
||||
!agx_is_null(packed_offset), !agx_is_null(compare),
|
||||
instr->op == nir_texop_lod, agx_gather_for_nir(instr));
|
||||
|
||||
if (instr->op == nir_texop_txf || instr->op == nir_texop_txf_ms)
|
||||
if (instr->op == nir_texop_txf || instr->op == nir_texop_txf_ms) {
|
||||
I->op = AGX_OPCODE_TEXTURE_LOAD;
|
||||
b->shader->out->uses_txf = true;
|
||||
}
|
||||
|
||||
/* Destination masking doesn't seem to work properly for gathers (because
|
||||
* it's mostly pointless), but it does show up in the lowering of
|
||||
|
||||
@@ -112,6 +112,9 @@ struct agx_shader_info {
|
||||
/* Reads base vertex/instance */
|
||||
bool uses_base_param;
|
||||
|
||||
/* Uses txf and hence needs a txf sampler mapped */
|
||||
bool uses_txf;
|
||||
|
||||
/* Number of 16-bit registers used by the main shader and preamble
|
||||
* respectively.
|
||||
*/
|
||||
|
||||
@@ -110,6 +110,7 @@ agx_fast_link(void *memctx, struct agx_device *dev, bool fragment,
|
||||
writes_sample_mask |= part->info.writes_sample_mask;
|
||||
disable_tri_merging |= part->info.disable_tri_merging;
|
||||
linked->uses_base_param |= part->info.uses_base_param;
|
||||
linked->uses_txf |= part->info.uses_txf;
|
||||
tag_write_disable &= part->info.tag_write_disable;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,11 @@ struct agx_linked_shader {
|
||||
*/
|
||||
bool uses_base_param;
|
||||
|
||||
/* Set if the linked shader uses txf. The epilog may even if the main shader
|
||||
* does not, in the case of spilled render targets.
|
||||
*/
|
||||
bool uses_txf;
|
||||
|
||||
/* Coefficient register bindings */
|
||||
struct agx_varyings_fs cf;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user