radv: (Using mesh shader) NIR validation failed after nir_lower_io_to_scalar_early
Description
When the graphics pipeline is being built, the attached SPIR-V mesh shader results in a "NIR validation failed" error.
The shader passes spirv-val --scalar-block-layout
and Vulkan's validation layers with no errors reported.
(Although you should use the latest version of Vulkan SDK (v1.3.239.0 or newer) - versions as recent as v1.3.231.1 did not validate VK_EXT_mesh_shader, VK_SHADER_STAGE_MESH_BIT_EXT, etc. correctly and would mistakenly report validation errors.)
Attached Files
- The NIR validation error text
- A fossilization of the pipeline state object (test.9ca84510ad7f3b51.1.foz)
- The mesh shader SPIR-V code (shader.mesh.spv)
Steps to reproduce
My understanding is that it should be straightforward to reproduce the issue by replaying the attached fossilized pipeline state object. Please let me know if more is needed to reproduce the issue.
System information
- OS: Debian GNU/Linux bookworm/sid (testing branch)
- GPU: RX 6700 XT
- Kernel version: 6.1.0-2-amd64
- Mesa version: Mesa 23.1.0-devel (git-2f467fb1)
- Desktop environment: Budgie:GNOME
- Xserver version: 1.21.1.6
Regression
Did it used to work in a previous Mesa version? It can greatly help to know when the issue started.
It might be worth noting that as the author of this shader, I found the conditions that would cause the NIR validation error to be arbitrary.
For example, writing some_vec_3.y = -some_vec_3.y;
in the GLSL source that was converted to SPIR-V would sometimes result in a NIR validation error, but re-writing the code to some_vec_3.y = some_vec_3.y*vec3(1.f,-1.f,1.f)
would oftentimes work just fine, avoiding the NIR validation failure.
Further information (optional)
Does your environment set any of the variables
ACO_DEBUG
,RADV_DEBUG
, andRADV_PERFTEST
?
It may be worth noting my environment sets RADV_PERFTEST=ext_ms, although in Linux 6.1 with gang submit this may no longer be necessary (rt
is not set since only ray queries are used, which don't require RADV_PERFTREST=rt)