1 /*
2 * Copyright © 2024 Valve Corporation
3 * SPDX-License-Identifier: MIT
4 */
5
6 #include "radix_sort_u64.h"
7 #include <assert.h>
8
9 static const uint32_t init_spv[] = {
10 #include "radix_sort/shaders/init.comp.spv.h"
11 };
12
13 static const uint32_t fill_spv[] = {
14 #include "radix_sort/shaders/fill.comp.spv.h"
15 };
16
17 static const uint32_t histogram_spv[] = {
18 #include "radix_sort/shaders/histogram.comp.spv.h"
19 };
20
21 static const uint32_t prefix_spv[] = {
22 #include "radix_sort/shaders/prefix.comp.spv.h"
23 };
24
25 static const uint32_t scatter_0_even_spv[] = {
26 #include "radix_sort/shaders/scatter_0_even.comp.spv.h"
27 };
28
29 static const uint32_t scatter_0_odd_spv[] = {
30 #include "radix_sort/shaders/scatter_0_odd.comp.spv.h"
31 };
32
33 static const uint32_t scatter_1_even_spv[] = {
34 #include "radix_sort/shaders/scatter_1_even.comp.spv.h"
35 };
36
37 static const uint32_t scatter_1_odd_spv[] = {
38 #include "radix_sort/shaders/scatter_1_odd.comp.spv.h"
39 };
40
41
42 radix_sort_vk_t *
vk_create_radix_sort_u64(VkDevice device,VkAllocationCallbacks const * ac,VkPipelineCache pc,struct radix_sort_vk_target_config config)43 vk_create_radix_sort_u64(VkDevice device, VkAllocationCallbacks const *ac,
44 VkPipelineCache pc,
45 struct radix_sort_vk_target_config config)
46 {
47 assert(config.keyval_dwords == 2);
48
49 const uint32_t *spv[8] = {
50 init_spv, fill_spv, histogram_spv, prefix_spv,
51 scatter_0_even_spv, scatter_0_odd_spv, scatter_1_even_spv, scatter_1_odd_spv,
52 };
53 const uint32_t spv_sizes[8] = {
54 sizeof(init_spv), sizeof(fill_spv), sizeof(histogram_spv), sizeof(prefix_spv),
55 sizeof(scatter_0_even_spv), sizeof(scatter_0_odd_spv), sizeof(scatter_1_even_spv), sizeof(scatter_1_odd_spv),
56 };
57 return radix_sort_vk_create(device, ac, pc, spv, spv_sizes, config);
58 }
59
60