mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
Currently, when using Vulkan heaps, we create descriptor set layouts with as many descriptors as allowed by the Vulkan implementation limits. For some implementations this can mean hundreds of millions of descriptors or more, which is wasteful, given that even on the best resource binding tier Direct3D 12 applications should not expect to have more than a million usable descriptors. Recently this began being a problem, because since Mesa 24.2.7 the Intel driver advertises more than 200 million descriptors, but pipeline compilation takes linear RAM in the number of descriptors declared in the pipeline layout. This means that compiling even a simple shader requires 10-20 GB of RAM. In order to avoid using too much memory, with this commit we clamp the number of descriptors declared in the set layouts to how many we actually need to guarantee tier 3 resource binding support.