Mesa i965 CI runs tests in a mode designed to detect problems with our use of NIR. The following environment variables are set: NIR_TEST_CLONE=true NIR_TEST_SERIALIZE=true With the addition of VkRunner tests to piglit, the following tests began to fail in this mode: piglit.vulkan.glsl450.face-forward-double piglit.vulkan.glsl450.frexp-double piglit.vulkan.glsl450.isinf-double piglit.vulkan.glsl450.reflect-double piglit.vulkan.glsl450.refract-double piglit.vulkan.shaders.fs-large-local-array piglit.vulkan.shaders.fs-large-local-array-vec2 piglit.vulkan.shaders.fs-large-local-array-vec3 piglit.vulkan.shaders.fs-large-local-array-vec4 piglit.vulkan.shaders.fs-multiple-large-local-array stderr: /tmp/vkrunner-1E4K6k 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.
There's a MR to attempt to fix this one https://gitlab.freedesktop.org/mesa/mesa/merge_requests/912
That MR was replaced with https://gitlab.freedesktop.org/mesa/mesa/merge_requests/1012
Fixed by the following two commits in master: commit fe2fc30cb559f7ef99c07bd219c057b011242cb4 Author: Jason Ekstrand <jason@jlekstrand.net> Date: Tue Jun 4 17:50:22 2019 -0500 nir: Don't replace the nir_shader when NIR_TEST_SERIALIZE=1 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108957 Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Rob Clark <robdclark@chromium.org> commit 9eba6d9a880558c89a72cbafd873d4fe1247928d Author: Jason Ekstrand <jason@jlekstrand.net> Date: Tue Jun 4 17:48:33 2019 -0500 nir: Don't replace the nir_shader when NIR_TEST_CLONE=1 Instead, we add a new helper which stomps one nir_shader and replaces it with another. The new helper effectively just changes which pointer gets used for the base nir_shader. It should be 99% as good at testing cloning but without requiring that everything handle having the shader swapped out from under it constantly. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108957 Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Rob Clark <robdclark@chromium.org>
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.