Skip to content

pan/bi: Fix dual texturing with uniforms

Alyssa Rosenzweig requested to merge alyssa/mesa:bifrost/dual-tex into main

The GLSL code sequence:

texture2D(tex0, u_coords) + texture2D(tex1, u_coords)

will be optimized to

TEXC_DUAL tex0/tex1, u_coords, #texture_descriptor

If this optimization happens after lowering FAU, the resulting TEXC instruction is unschedulable: both the uniform and the constant descriptor fight for the same FAU slot.

However, if this optimization happens before lowering FAU, then the FAU lowering will move the descriptor into a register, complicating the dual texturing fixup in RA.

To fix this interaction, fuse dual texturing before lowering FAU and keep texture descriptors as constants when lowering FAU of TEXC.

Fixes scheduling failure in piglit drawoverhead -test 3 with uniform reordering.

Fixes: a4d3a296 ("pan/bi: Enable dual texture fusing pass") Fixes: 6b2eda6b ("pan/bi: Reorder pushed uniforms to avoid moves") Signed-off-by: Alyssa Rosenzweig alyssa@collabora.com

Merge request reports