I've got what looks like a regression moving from 19.0.6 -> 19.1.0 running the intel vulkan driver on IvyBridge. It seems that calling vkAllocateDescriptorSets with a COMBINED_IMAGE_SAMPLER that uses an immutable sampler causes a segfault.
I can reproduce this as an assert using a debug build from git today (8ea7ee153649ac07c8418cc0d4aa5a4e123d19d1), here is the top of the callstack:
#0 0x00007ffff7bd9755 in raise () from /usr/lib/libc.so.6
#1 0x00007ffff7bc4851 in abort () from /usr/lib/libc.so.6
#2 0x00007ffff7bc4727 in __assert_fail_base.cold () from /usr/lib/libc.so.6
#3 0x00007ffff7bd2026 in __assert_fail () from /usr/lib/libc.so.6
#4 0x00007ffff72f233a in anv_descriptor_set_write_image_view (device=0x5555561e9880, set=0x55555621a668,
info=0x7fffffff8740, type=VK_DESCRIPTOR_TYPE_SAMPLER, binding=0, element=0)
#5 0x00007ffff72f16f9 in anv_descriptor_set_create (device=0x5555561e9880, pool=0x55555621a5d0,
layout=0x5555561220a0, out_set=0x7fffffff87c8) at ../src/intel/vulkan/anv_descriptor_set.c:971
#6 0x00007ffff72f19c8 in anv_AllocateDescriptorSets (_device=0x5555561e9880, pAllocateInfo=0x7fffffff9a58,
pDescriptorSets=0x7fffffff8900) at ../src/intel/vulkan/anv_descriptor_set.c:1030
It seems that anv_descriptor_set_create() calls anv_descriptor_set_write_image_view() to set up some stuff from the immutable sampler, but due to recent changes anv_descriptor_set_write_image_view() assumes that a layout that has the ANV_DESCRIPTOR_TEXTURE_SWIZZLE bit set always has a non-null image_view (which we do not since we are only creating the descriptor set at this stage).
If I patch the ANV_DESCRIPTOR_TEXTURE_SWIZZLE block at the end of anv_descriptor_set_write_image_view() to only update the swizzle descriptors if there is a non-null image_view, then my app goes back to running as expected. I do not know if this is the correct fix for this issue though!
Can you give this MR a try:
Yep that MR is the same change that I tried locally, this seems to fix the issue for me.
Thanks for the extremely fast fix!
Thanks for doing all the debugging work for me. Maybe next time, you should just make the MR since you already wrote the same patch. It's pretty easy to do. :-)