diff options
author | Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com> | 2016-02-22 16:58:22 -0800 |
---|---|---|
committer | Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com> | 2016-02-22 16:58:22 -0800 |
commit | c1e510a9ec1155f68ae91a93ab53cbd71f57c959 (patch) | |
tree | 1f1c37e25fc2886f61512ac3cb926430094cca0e | |
parent | 206f999f575d8a9b95703aac5c6dd6516c6df865 (diff) |
lots-of-surface-state: Use a descriptor pool
This test needs big descriptor sets. Use a custom pool.
-rw-r--r-- | src/tests/stress/lots-of-surface-state.c | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/src/tests/stress/lots-of-surface-state.c b/src/tests/stress/lots-of-surface-state.c index 13528e7..50e7fa2 100644 --- a/src/tests/stress/lots-of-surface-state.c +++ b/src/tests/stress/lots-of-surface-state.c @@ -178,11 +178,39 @@ test_lots_of_surface_state(VkShaderModule vs, VkShaderModule fs, (VkBuffer[]) { vbo }, (VkDeviceSize[]) { 0 }); + const VkDescriptorPoolSize pool_sizes[2] = { + { + .type = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, + .descriptorCount = 12 + }, + { + .type = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, + .descriptorCount = 12 + } + }; + + const VkDescriptorPoolCreateInfo create_info = { + .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO, + .pNext = NULL, + .flags = 0, + .maxSets = 1024, + .poolSizeCount = 2, + .pPoolSizes = pool_sizes + }; + + VkDescriptorPool desc_pool; + VkResult res = vkCreateDescriptorPool(t_device, &create_info, NULL, + &desc_pool); + t_assert(res == VK_SUCCESS); + t_cleanup_push_vk_descriptor_pool(t_device, desc_pool); + VkDescriptorSet set[1024]; if (use_dynamic_offsets) { // Allocate and set up a single descriptor set. We'll just re-bind // it with new dynamic offsets each time. - set[0] = qoAllocateDescriptorSet(t_device, .pSetLayouts = &set_layout); + set[0] = qoAllocateDescriptorSet(t_device, + .descriptorPool = desc_pool, + .pSetLayouts = &set_layout); VkDescriptorBufferInfo buffer_info[12]; for (int i = 0; i < 12; i++) { @@ -214,7 +242,7 @@ test_lots_of_surface_state(VkShaderModule vs, VkShaderModule fs, VkResult result = vkAllocateDescriptorSets(t_device, &(VkDescriptorSetAllocateInfo) { .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO, - .descriptorPool = VK_NULL_HANDLE, + .descriptorPool = desc_pool, .descriptorSetCount = 1024, .pSetLayouts = layouts, }, set); |