Mesa i965 CI runs tests in a mode designed to detect problems with our use of NIR. The following environment variables are set:
With the addition of VkRunner tests to piglit, the following tests began to fail in this mode:
vkrunner: ../src/intel/vulkan/anv_pipeline.c:193: anv_shader_compile_to_nir: Assertion `exec_list_length(&nir->functions) == 1' failed.
This is entirely due to the way we handle hanging onto the entrypoint we get out of SPIR-V. The spirv_to_nir pass returns a nir_function_impl instead of a nir_shader and we hang on to it while we do a couple of passes such as function inlining. We then go to delete all but the main entrypoint assuming that the nir_function_impl pointer we're hanging on to is still valid. If NIR_TEST_CLONE is set, it won't be valid because it will have been cloned out from under us. This isn't an actual issue in production, but we should probably sort out what to do about it one of these days.