diff options
Diffstat (limited to 'runtime/src/vulkan_scratch.h')
| -rw-r--r-- | runtime/src/vulkan_scratch.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/runtime/src/vulkan_scratch.h b/runtime/src/vulkan_scratch.h index 3e6a8eab8..958f27ca5 100644 --- a/runtime/src/vulkan_scratch.h +++ b/runtime/src/vulkan_scratch.h | |||
| @@ -44,10 +44,13 @@ public: | |||
| 44 | 44 | ||
| 45 | // `usage` is what the chunks are created with. A chunk that declares VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT | 45 | // `usage` is what the chunks are created with. A chunk that declares VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT |
| 46 | // gets its device address from get() as well, and its memory must have been allocated with | 46 | // gets its device address from get() as well, and its memory must have been allocated with |
| 47 | // VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT (the allocate callback's job). | 47 | // VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT (the allocate callback's job). `families` keeps retired chunks shareable |
| 48 | // across queue families (graphics + async compute). | ||
| 48 | ScratchBuffers(PFN_vkGetDeviceProcAddr get, VkDevice device, Allocate allocate, | 49 | ScratchBuffers(PFN_vkGetDeviceProcAddr get, VkDevice device, Allocate allocate, |
| 49 | DeviceFaultDiagnostics* diagnostics, VkBufferUsageFlags usage) | 50 | DeviceFaultDiagnostics* diagnostics, VkBufferUsageFlags usage, |
| 51 | std::vector<std::uint32_t> families = {}) | ||
| 50 | : device_(device), diagnostics_(diagnostics), allocate_(std::move(allocate)), usage_(usage), | 52 | : device_(device), diagnostics_(diagnostics), allocate_(std::move(allocate)), usage_(usage), |
| 53 | families_(std::move(families)), | ||
| 51 | addressable_((usage & VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT) != 0) { | 54 | addressable_((usage & VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT) != 0) { |
| 52 | loaded_ = vk_.load(get, device, addressable_); | 55 | loaded_ = vk_.load(get, device, addressable_); |
| 53 | } | 56 | } |