ir3, nir: Add descriptor prefetching optimization for a7xx
Since a7xx, the old method of prefetching descriptors via CP_LOAD_STATE
has been superseded by prefetching them in the early preamble. Early preambles execute on HLSQ, where CP_LOAD_STATE
also executes, and at least since a7xx any descriptors fetched in the early preamble are handled just like CP_LOAD_STATE
was before. We emit dummy sam
/resinfo
/ldc
instructions corresponding to operations using descriptors in the original shader, following the blob.
I've made it possible to handle cases where the app computes a simple dynamic offset to the descriptor, which should allow us to prefetch descriptors in DX12 apps with vkd3d-proton. In order to do this I had to extend the nir_instr_set
interface a bit in the first two commits.