Crash creating vertex-input only graphics pipeline library with no renderpass
Description
I ran into a crash running some of my tests, and narrowed it down to creating a graphics pipeline library with no renderpass/dynamic rendering information and only vertex input state (only VERTEX_INPUT_INTERFACE_BIT_EXT
in VkGraphicsPipelineLibraryCreateInfoEXT
).
I get a crash in radv_pipeline_has_color_attachments
when creating the library even though I believe the setup is valid, and validation layers don't produce any errors.
As far as I can tell the problem seems to be that state->rp
is NULL because there's no renderpass information, which seems sensible, but then that is accessed unconditionally to determine whether color attachments are in use or not.
Log files (for system lockups / game freezes / crashes)
Backtrace:
#0 0x00007ffff6787a43 in radv_pipeline_has_color_attachments (rp=0x0) at ../src/amd/vulkan/radv_pipeline_graphics.c:89
#1 0x00007ffff6788717 in radv_pipeline_needed_dynamic_state (device=0x555556e04890, pipeline=0x555556f7a8c0, state=0x7fffffffcdd0)
at ../src/amd/vulkan/radv_pipeline_graphics.c:512
#2 0x00007ffff67892d0 in radv_pipeline_init_dynamic_state (device=0x555556e04890, pipeline=0x555556f7a8c0, state=0x7fffffffcdd0,
pCreateInfo=0x7fffffffd600) at ../src/amd/vulkan/radv_pipeline_graphics.c:834
#3 0x00007ffff6796d2f in radv_graphics_pipeline_init (pipeline=0x555556f7a8c0, device=0x555556e04890, cache=0x0, pCreateInfo=0x7fffffffd600, extra=0x0)
at ../src/amd/vulkan/radv_pipeline_graphics.c:4000
#4 0x00007ffff6797260 in radv_graphics_pipeline_create (_device=0x555556e04890, _cache=0x0, pCreateInfo=0x7fffffffd600, extra=0x0, pAllocator=0x0,
pPipeline=0x7fffffffd428) at ../src/amd/vulkan/radv_pipeline_graphics.c:4085
#5 0x00007ffff67979d5 in radv_CreateGraphicsPipelines (_device=0x555556e04890, pipelineCache=0x0, count=1, pCreateInfos=0x7fffffffd600, pAllocator=0x0,
pPipelines=0x7fffffffd428) at ../src/amd/vulkan/radv_pipeline_graphics.c:4228
#6 0x0000555555792b54 in VulkanGraphicsTest::createGraphicsPipeline (this=0x555555a1e7e8 <(anonymous namespace)::Anon__LINE__>, info=0x7fffffffd600)
at /p/renderdoc/util/test/demos/vk/vk_test.cpp:1177
#7 0x0000555555842680 in VK_Parameter_Zoo::main (this=0x555555a1e7e8 <(anonymous namespace)::Anon__LINE__>)
at /p/renderdoc/util/test/demos/vk/vk_parameter_zoo.cpp:1493
#8 0x0000555555709fca in main (argc=2, argv=0x7fffffffde58) at /p/renderdoc/util/test/demos/main.cpp:691
Steps to reproduce
I reproduced this originally by running demos_x64 VK_Parameter_Zoo
after building from RenderDoc's demo project. This will need glslc/glslangValidator in the path.
I've also attached a fossilize database below.
System information
System:
Host: lupino2 Kernel: 6.2.0-36-generic arch: x86_64 bits: 64 compiler: N/A
Desktop: Fluxbox v: 1.3.5 dm: GDM3 Distro: Ubuntu 23.04 (Lunar Lobster)
CPU:
Info: 12-core model: AMD Ryzen 9 7900X bits: 64 type: MT MCP arch: Zen 4
rev: 2 cache: L1: 768 KiB L2: 12 MiB L3: 64 MiB
Speed (MHz): avg: 3927 high: 5494 min/max: 3000/5733 boost: enabled cores:
1: 3495 2: 3000 3: 4486 4: 4700 5: 4700 6: 4700 7: 4295 8: 4548 9: 2742
10: 4827 11: 3000 12: 5363 13: 4700 14: 3204 15: 3222 16: 3000 17: 3262
18: 4962 19: 3486 20: 4326 21: 2749 22: 3000 23: 3000 24: 5494
bogomips: 225613
Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
Graphics:
Device-1: AMD Navi 31 [Radeon RX 7900 XT/7900 XTX] vendor: ASUSTeK
driver: amdgpu v: kernel arch: RDNA-3 pcie: speed: 16 GT/s lanes: 16 ports:
active: HDMI-A-1 empty: DP-1,DP-2,DP-3 bus-ID: 03:00.0 chip-ID: 1002:744c
Device-2: AMD Raphael driver: amdgpu v: kernel arch: RDNA-2 pcie:
speed: 16 GT/s lanes: 16 ports: active: none empty: DP-4,HDMI-A-2
bus-ID: 13:00.0 chip-ID: 1002:164e temp: 40.0 C
Device-3: Valve 3D Camera type: USB driver: uvcvideo bus-ID: 8-2.1:3
chip-ID: 28de:2400
Display: x11 server: X.Org v: 1.21.1.7 with: Xwayland v: 22.1.8 driver: X:
loaded: modesetting alternate: fbdev,vesa dri: radeonsi gpu: amdgpu
display-ID: :0 screens: 1
Screen-1: 0 s-res: 2560x1440 s-dpi: 96
Monitor-1: HDMI-A-1 mapped: HDMI-1 model: HP X27q res: 2560x1440 dpi: 109
diag: 685mm (27")
API: OpenGL v: 4.6 Mesa 24.0.0-devel (git-02fe92c908) renderer: AMD
Radeon RX 7900 XTX (radeonsi navi31 LLVM 15.0.7 DRM 3.49
6.2.0-36-generic) direct-render: Yes
If applicable
- Xserver version:
X.Org X Server 1.21.1.7
X Protocol Version 11, Revision 0
Current Operating System: Linux lupino2 6.2.0-36-generic #37-Ubuntu SMP PREEMPT_DYNAMIC Wed Oct 4 10:14:28 UTC 2023 x86_64
Kernel command line: BOOT_IMAGE=/vmlinuz-6.2.0-36-generic root=UUID=1c8c1d9c-9d72-44bb-b249-9e90aeadcfd6 ro quiet splash video=DP-3:d vt.handoff=7
xorg-server 2:21.1.7-1ubuntu3.1 (For technical support please see http://www.ubuntu.com/support)
Current version of pixman: 0.42.2
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
API captures (if applicable, optional)
Fossilize database: fossilize.d18bfe20c29e8c32.1.foz