Skip to content

nvk: Use the MME for more things

Faith Ekstrand requested to merge gfxstrand/mesa:nvk/more-mme into main

In preparation for implementing the device-generated commands feature, we need to...

image

These might make the driver a little faster as it reduces state dirtying but that's not really the primary goal. The real here is to effectively split up the HW state. There are several HW states which depend on more than one piece of state. Sometimes that's fairly simple such as if it combines two dynamic states. However, sometimes it's much more complicated such as when some of the state comes from a shader and some comes from dynamic state or elsewhere. The big, crazy example of this is SET_HYBRID_ANTI_ALIAS_CONTROL and the sample masks which depend on both minSampleShading, which we get as a side-effect of the pipeline/shader compile and rasterizationSamples, which is a dynamic state. To make matters worse, this one nominally depends on floating-point math. Naturally, this macro is a little bit complicated, so...

This merge request also adds a simple unit testing framework to NVK which runs the macro against simulated state and checks that the methods emitted from the macro match an expected method/data array. This also makes it way easier to develop new macros because we can reliably test them and single-step through the simulator if needed. It also provides some sense of security because the unit tests run at compile time and against both the Fermi and Turing MME simulators.

There are also some bugs to fix with the MME builder which are hit by the new macros.

Edited by Faith Ekstrand

Merge request reports

Loading