Summary
In a task + mesh + fragment graphics pipeline, the task shader reads the descriptors of the mesh shader’s descriptor set instead of its own set when all of the following are true:
- The task set layout uses
stageFlags = VK_SHADER_STAGE_TASK_BIT_EXTonly. - The mesh set layout uses
stageFlags = VK_SHADER_STAGE_MESH_BIT_EXTonly. - The set layouts and the descriptor pool use
UPDATE_AFTER_BIND(VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT,VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT,VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT).
Validation layers (core, GPU-AV, synchronization) report no errors. Giving both layouts VK_SHADER_STAGE_TASK_BIT_EXT | VK_SHADER_STAGE_MESH_BIT_EXT, or leaving UPDATE_AFTER_BIND off, makes every binding read the correct buffer.
The same misread also happens in our renderer with VK_EXT_descriptor_buffer. The attached repro covers classic descriptor sets only.
Environment
- NVIDIA GeForce RTX 4080 Laptop GPU, driver 616.56
- Also reproduced by a colleague on the latest driver
- Driver Version 595.79 didn’t have the bug
- Windows 11
- Vulkan 1.4.351, Vulkan SDK 1.4.363
- The repro requests Vulkan 1.3 and
VK_EXT_mesh_shader
Repro
Pipeline layout:
- Set 0: mesh shader, 9 storage-buffer bindings
- Set 1: task shader, 11 storage-buffer bindings
Each binding points at its own buffer range. The range is filled with a unique marker 0x5E70RRBB (RR = 1 for the mesh set, 2 for the task set, BB = binding) and has a unique size. The task shader writes .length() and the first element of each of its bindings into a result buffer addressed by a buffer device address in the push constants, so the recorded output does not go through a descriptor. The host then checks that each task binding saw its own marker and length.
Four variants are run:
| stage flags on the two layouts | UpdateAfterBind | result |
|---|---|---|
TASK / MESH |
yes | FAIL |
TASK | MESH on both |
yes | PASS |
TASK / MESH |
no | PASS |
TASK | MESH on both |
no | PASS |
Build and run (Vulkan SDK with VULKAN_SDK set, CMake >= 3.24, C++20):
NvidiaRepro.zip (11.8 KB)