| 296 | } |
| 297 | }; |
| 298 | VulkanRadixSort::VulkanRadixSort(Backend* bn, int needBit) : mBackend(bn), mNeedBits(needBit) { |
| 299 | mContent = new Content(static_cast<VulkanBackend*>(bn)); |
| 300 | auto extra = static_cast<VulkanBackend*>(bn); |
| 301 | { |
| 302 | std::vector<uint32_t> spc = {(uint32_t)mLocalSize, 1, 1, (uint32_t)128, (uint32_t)mLocalSize}; |
| 303 | std::vector<VkDescriptorType> types { |
| 304 | VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, |
| 305 | VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, |
| 306 | VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER |
| 307 | }; |
| 308 | if (extra->device().getLocalMemorySize() > 0) { |
| 309 | mContent->cumsum = extra->getPipelineFactory()->getPipeline("glsl_cumsum_comp", types, spc, {}, true); |
| 310 | } else { |
| 311 | mContent->cumsum = extra->getPipelineFactory()->getPipeline("glsl_cumsum_single_comp", types, spc, {}, true); |
| 312 | } |
| 313 | } |
| 314 | { |
| 315 | std::vector<uint32_t> spc = {(uint32_t)mLocalSize, 1, 1, (uint32_t)(1<<mPerSortBit), (uint32_t)mLocalSize}; |
| 316 | std::vector<VkDescriptorType> types { |
| 317 | VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, |
| 318 | VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, |
| 319 | VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, |
| 320 | VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, |
| 321 | VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER |
| 322 | }; |
| 323 | mContent->radixsort_reorder = extra->getPipelineFactory()->getPipeline("glsl_radixsort_reorder_comp", types, spc, {}, true); |
| 324 | } |
| 325 | { |
| 326 | std::vector<uint32_t> spc = {(uint32_t)mLocalSize, 1, 1, (uint32_t)(1<<mPerSortBit), (uint32_t)mLocalSize}; |
| 327 | std::vector<VkDescriptorType> types { |
| 328 | VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, |
| 329 | VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, |
| 330 | VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, |
| 331 | VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER |
| 332 | }; |
| 333 | mContent->radixsort_histogram = extra->getPipelineFactory()->getPipeline("glsl_radixsort_histogram_comp", types, spc, {}, true); |
| 334 | } |
| 335 | } |
| 336 | VulkanRadixSort:: ~VulkanRadixSort() { |
| 337 | delete mContent; |
| 338 | } |
nothing calls this directly
no test coverage detected