asahi: Optimize lower_resinfo for cube maps
Texture size queries are implemented in Asahi by reading the texture descriptor in shader code (mesa/src/asahi/compiler/agx_lower_resinfo.c
). The width, height, depth, and levels fields of the descriptor are unpacked and processed. Width and height are unpacked from separate fields, but for cube maps, we know that width and height must be equal. Therefore we can load only height (or only width, but that might be more expensive), and just copy it to width. That should be a bit cheaper.
-
Check the dimension of the nir_tex_instr
inagx_lower_resinfo
and avoid generating instruction to calculate the width for cube maps.