"unknown intrinsic" assertion triggered by multiview shader in non-multiview renderpass in Vulkan on intel
System information
Please post inxi -GSC -xx
output (fenced with triple backticks) OR fill information below manually
- OS: NixOS 20.09 (Nightingale)
- GPU: 00:02.0 VGA compatible controller [0300]: Intel Corporation UHD Graphics 620 [8086:5917] (rev 07)
- Kernel version: Linux flow 5.10.21 #1 (closed)-NixOS SMP Sun Mar 7 11:34:17 UTC 2021 x86_64 GNU/Linux
- Mesa version: 20.3.4
- Xserver version (if applicable): 1.20.10
- Desktop manager and compositor: i3, n/a
Describe the issue
When creating a graphics pipeline for a renderpass that was not configured for multiview, using a vertex shader that uses multiview and in particular accesses gl_ViewIndex
, a debug build of mesa fails with an assert:
client: ../src/intel/compiler/brw_fs_nir.cpp:5468: void fs_visitor::nir_emit_intrinsic(const brw::fs_builder&, nir_intrinsic_instr*): Assertion `!"unknown intrinsic"' failed.
Backtrace
#4 0x00007ffff6721871 in fs_visitor::nir_emit_intrinsic (this=this@entry=0x7ffffffe6670, bld=..., instr=instr@entry=0x5555569d9d90) at ../src/intel/compiler/brw_fs_nir.cpp:5468
#5 0x00007ffff672197f in fs_visitor::nir_emit_vs_intrinsic (this=0x7ffffffe6670, bld=..., instr=instr@entry=0x5555569d9d90) at ../src/intel/compiler/brw_fs_nir.cpp:2613
#6 0x00007ffff6727c8a in fs_visitor::nir_emit_instr (this=this@entry=0x7ffffffe6670, instr=instr@entry=0x5555569d9d90) at ../src/compiler/nir/nir.h:2611
#7 0x00007ffff6727ebf in fs_visitor::nir_emit_block (this=this@entry=0x7ffffffe6670, block=block@entry=0x5555569b4220) at ../src/intel/compiler/brw_fs_nir.cpp:461
#8 0x00007ffff67280a2 in fs_visitor::nir_emit_cf_list (this=this@entry=0x7ffffffe6670, list=list@entry=0x5555569dce38) at ../src/compiler/nir/nir.h:3111
#9 0x00007ffff6728409 in fs_visitor::nir_emit_impl (this=this@entry=0x7ffffffe6670, impl=0x5555569dce10) at ../src/intel/compiler/brw_fs_nir.cpp:377
#10 0x00007ffff67284b2 in fs_visitor::emit_nir_code (this=this@entry=0x7ffffffe6670) at ../src/compiler/nir/nir.h:3605
#11 0x00007ffff66e4c0f in fs_visitor::run_vs (this=this@entry=0x7ffffffe6670) at ../src/intel/compiler/brw_fs.cpp:8091
#12 0x00007ffff67a7953 in brw_compile_vs (compiler=compiler@entry=0x555556216b60, log_data=0x55555689ee60, mem_ctx=mem_ctx@entry=0x55555697d5f0, key=key@entry=0x7ffffffea248, prog_data=prog_data@entry=0x7ffffffeb430, nir=0x5555569a16f0, shader_time_index=-1, stats=0x7ffffffeb69c, error_str=0x0)
at ../src/intel/compiler/brw_vec4.cpp:2945
#13 0x00007ffff60e3fb8 in anv_pipeline_compile_vs (compiler=compiler@entry=0x555556216b60, mem_ctx=mem_ctx@entry=0x55555697d5f0, pipeline=pipeline@entry=0x555556992860, vs_stage=vs_stage@entry=0x7ffffffea210) at ../src/intel/vulkan/anv_pipeline.c:825
#14 0x00007ffff60e8be2 in anv_pipeline_compile_graphics (pipeline=pipeline@entry=0x555556992860, cache=cache@entry=0x5555567cd930, info=info@entry=0x55555697ce78) at ../src/intel/vulkan/anv_pipeline.c:1549
#15 0x00007ffff60ea7b8 in anv_graphics_pipeline_init (pipeline=pipeline@entry=0x555556992860, device=device@entry=0x55555689ee60, cache=cache@entry=0x5555567cd930, pCreateInfo=pCreateInfo@entry=0x55555697ce78, alloc=alloc@entry=0x0) at ../src/intel/vulkan/anv_pipeline.c:2169
#16 0x00007ffff644ff40 in gen9_graphics_pipeline_create (_device=_device@entry=0x55555689ee60, cache=cache@entry=0x5555567cd930, pCreateInfo=pCreateInfo@entry=0x55555697ce78, pAllocator=pAllocator@entry=0x0, pPipeline=pPipeline@entry=0x555556995350) at ../src/intel/vulkan/genX_pipeline.c:2250
#17 0x00007ffff64504ec in gen9_CreateGraphicsPipelines (_device=0x55555689ee60, pipelineCache=0x5555567cd930, count=1, pCreateInfos=0x55555697ce78, pAllocator=0x0, pPipelines=0x555556995350) at ../src/intel/vulkan/genX_pipeline.c:2535
#18 0x00007ffff51abced in DispatchCreateGraphicsPipelines(VkDevice_T*, VkPipelineCache_T*, unsigned int, VkGraphicsPipelineCreateInfo const*, VkAllocationCallbacks const*, VkPipeline_T**) () from /nix/store/j9gzjsqs7hx1ppal7zv2w5qjsb6cknjj-vulkan-validation-layers-1.2.170.0/lib/libVkLayer_khronos_validation.so
Value of instr
argument to the asserting function:
{instr = {node = {next = 0x5555569fb9c0, prev = 0x555556a01a40}, block = 0x5555569b4220, type = nir_instr_type_intrinsic, pass_flags = 1 '\001', index = 179}, intrinsic = nir_intrinsic_load_view_index, dest = {{reg = {parent_instr = 0x0, def_link = {prev = 0x5555569d9d90, next = 0x5555569fbad8},
reg = 0x5555569fbad8, indirect = 0x5555569d9dd8, base_offset = 1453170136}, ssa = {name = 0x0, parent_instr = 0x5555569d9d90, uses = {prev = 0x5555569fbad8, next = 0x5555569fbad8}, if_uses = {prev = 0x5555569d9dd8, next = 0x5555569d9dd8}, index = 200, num_components = 1 '\001', bit_size = 32 ' ',
divergent = true}}, is_ssa = true}, num_components = 0 '\000', const_index = {0, 0, 0, 0, 0}, src = 0x5555569d9e10}
Note intrinsic = nir_intrinsic_load_view_index
.
The Vulkan spec says:
If multiview is enabled in the render pass, this value will be one of the bits set in the view mask of the subpass the pipeline is compiled against. If multiview is not enabled in the render pass, this value will be zero.
(emphasis added)
It looks like the driver is incorrectly assuming that gl_ViewIndex
is undefined when multiview is not enabled.