Skip to content

pan/bi: Make all sysvals explicit in the NIR

Alyssa Rosenzweig requested to merge alyssa/mesa:panfrost/ekstrand-rule into main

Currently, we have a number of NIR system values that are consumed by the compiler, which supplies an ordered list of system values for the driver to upload as part of the ABI. Furthermore we have a few implicit system values which the backend compiler materializes on the fly. This works ok for GL -- it isn't great but it's good enough -- but it's a significant technical debt for Vulkan.

In the future, we will want to lower system values in NIR in the driver. This will allow the GL and VK drivers to lower the same system values in different ways, reflecting the different binding models and available pipeline state and so on. To get there, we need all system values to be explicit in the NIR. This is already the case for the Midgard compiler, but in Bifrost we have 3 implicit sysvals we need to deal with. The way to fix that is simple: move the lowerings early, from backend instruction selection to NIR lowering passes. Then in the future, we'll be able to split up compiling in two phases, allowing the driver to apply its own NIR lowerings in between these lowerings and backend isel.

Draft because this series isn't well tested yet.

Merge request reports