Skip to content

lima/ppir: support texture perspective

Erico Nunes requested to merge enunes/mesa:lima-ppir-tex-proj into master

This adds support to texture perspective (texture2DProj) to lima ppir.

A refactor on the way ppir deals with source coordinates on textures is made. Even though pp uses a 'varying fetch' type instruction to prepare texture coordinates to a 'texture fetch' instruction, the first does not necessarily have to come from a varying, but can come from a register or const. This gets further complicated when texture perspective is used, as the texture coordinates and the perspective divider can come from different sources. To make things simpler, we now always include the 'varying fetch' preceding the 'texture fetch', independent of where the sources come from.

The 'varying fetch' pp instruction deals only with coordinates, and 'texture fetch' deals only with the sampler index. Previously it was not possible to clearly map ppir_op_load_coords and ppir_op_load_texture to pp instructions as the source coordinates were kept in the ppir_op_load_texture node, making this harder to maintain. So another refactor is made with the attempt to clearly map ppir_op_load_coords to the 'varying fetch' and ppir_op_load_texture to the 'texture fetch'. The coordinates are still temporarily kept in the ppir_op_load_texture node as nir has both sampler and coordinates in a single instruction and it is only possible to output one ppir node during emit. But now after lowering, the sources are transferred to the (always) created ppir_op_load_coords node, and it should be possible to directly map them to their pp instructions from there onwards.

Edited by Erico Nunes

Merge request reports