asahi: Use txf for background program

More straightforward (txf instead of tex, with integer coords). No discrernible
performance difference.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23836>
This commit is contained in:
Alyssa Rosenzweig 2023-06-23 11:19:18 -04:00 committed by Marge Bot
parent 05adeb850b
commit d4424950ac

View file

@ -40,15 +40,13 @@ build_background_op(nir_builder *b, enum agx_meta_op op, unsigned rt,
unsigned nr, bool msaa)
{
if (op == AGX_META_OP_LOAD) {
nir_ssa_def *fragcoord = nir_load_frag_coord(b);
nir_ssa_def *coord = nir_trim_vector(b, fragcoord, 2);
nir_tex_instr *tex = nir_tex_instr_create(b->shader, msaa ? 2 : 1);
/* The type doesn't matter as long as it matches the store */
tex->dest_type = nir_type_uint32;
tex->sampler_dim = msaa ? GLSL_SAMPLER_DIM_MS : GLSL_SAMPLER_DIM_2D;
tex->op = nir_texop_tex;
tex->src[0] = nir_tex_src_for_ssa(nir_tex_src_coord, coord);
tex->op = nir_texop_txf;
tex->src[0] = nir_tex_src_for_ssa(nir_tex_src_coord,
nir_u2u32(b, nir_load_pixel_coord(b)));
if (msaa) {
tex->src[1] =