radv_AllocateDescriptorSets: validation on variable description count is too strict
Description
radv_AllocateDescriptorSets
has an assertion that is too strict regarding VkDescriptorSetVariableDescriptorCountAllocateInfo
.
Application can pass in VkDescriptorSetVariableDescriptorCountAllocateInfo
even if variable descriptor count isn't used in the corresponding set layout, as long as descriptorSetCount
matches VkDescriptorSetAllocateInfo::descriptorSetCount
or is 0. This behavior is not prohibited by the Vulkan specification.
The reason behind passing a redundant count is simply coding laziness (the app used for reproduction has some variable descriptor set count pipelines while the others are not), but this should not make the driver crash.
Log
../src/amd/vulkan/radv_descriptor_set.c:573: radv_descriptor_set_create: Assertion `layout->has_variable_descriptors' failed.
Steps to reproduce
- Clone https://github.com/linebender/piet-gpu/
- Checkout 090c99e2771bb3c211e87a2c88a9701002e88a6b
-
cargo run --release --bin winit
(with RADV set as the preferred driver)
System information
System: Host: ishitatsuyuki-ryzen Kernel: 5.11.12-rt11-xanmod1-1-rt x86_64 bits: 64 compiler: gcc v: 10.2.0
Desktop: GNOME 40.2 tk: GTK 3.24.29 wm: gnome-shell dm: GDM Distro: Arch Linux
CPU: Info: 8-Core model: AMD Ryzen 7 3700X bits: 64 type: MT MCP arch: Zen 2 rev: 0 cache: L2: 4 MiB
flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm bogomips: 114993
Speed: 4048 MHz min/max: 2200/3600 MHz boost: enabled Core speeds (MHz): 1: 4048 2: 4143 3: 3895 4: 3820 5: 3937
6: 3806 7: 3831 8: 3927 9: 3624 10: 4064 11: 3925 12: 4321 13: 3098 14: 3970 15: 4250 16: 3514
Graphics: Device-1: Advanced Micro Devices [AMD/ATI] Navi 10 [Radeon RX 5600 OEM/5600 XT / 5700/5700 XT] vendor: Tul
driver: amdgpu v: kernel bus-ID: 0a:00.0 chip-ID: 1002:731f
Display: wayland server: X.org 1.20.11 compositor: gnome-shell driver: loaded: amdgpu
resolution: <missing: xdpyinfo>
OpenGL: renderer: AMD Radeon RX 5700 XT (NAVI10 DRM 3.40.0 5.11.12-rt11-xanmod1-1-rt LLVM 12.0.0)
v: 4.6 Mesa 21.1.3 direct render: Yes
The Vulkan driver is overriden to Mesa 21.2.0-devel (git-9aff548ff4)
installed in /usr/local.
Regression
Appears to be a regression. Did not crash with mesa 21.1.3-1 (Arch).
Notes
I plan to file a fix MR soon.