ReactOS 0.4.17-dev-934-g091855f
vkd3d_shaders.h
Go to the documentation of this file.
1/*
2 * Copyright 2019 Philip Rebohle
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 */
18
19#ifndef __VKD3D_SHADERS_H
20#define __VKD3D_SHADERS_H
21
22static const char cs_uav_clear_buffer_float_code[] =
23 "RWBuffer<float4> dst;\n"
24 "\n"
25 "struct\n"
26 "{\n"
27 " float4 clear_value;\n"
28 " int2 dst_offset;\n"
29 " int2 dst_extent;\n"
30 "} u_info;\n"
31 "\n"
32 "[numthreads(128, 1, 1)]\n"
33 "void main(int3 thread_id : SV_DispatchThreadID)\n"
34 "{\n"
35 " if (thread_id.x < u_info.dst_extent.x)\n"
36 " dst[u_info.dst_offset.x + thread_id.x] = u_info.clear_value;\n"
37 "}\n";
38
39static const char cs_uav_clear_buffer_uint_code[] =
40 "RWBuffer<uint4> dst;\n"
41 "\n"
42 "struct\n"
43 "{\n"
44 " uint4 clear_value;\n"
45 " int2 dst_offset;\n"
46 " int2 dst_extent;\n"
47 "} u_info;\n"
48 "\n"
49 "[numthreads(128, 1, 1)]\n"
50 "void main(int3 thread_id : SV_DispatchThreadID)\n"
51 "{\n"
52 " if (thread_id.x < u_info.dst_extent.x)\n"
53 " dst[u_info.dst_offset.x + thread_id.x] = u_info.clear_value;\n"
54 "}\n";
55
57 "RWTexture1DArray<float4> dst;\n"
58 "\n"
59 "struct\n"
60 "{\n"
61 " float4 clear_value;\n"
62 " int2 dst_offset;\n"
63 " int2 dst_extent;\n"
64 "} u_info;\n"
65 "\n"
66 "[numthreads(64, 1, 1)]\n"
67 "void main(int3 thread_id : SV_DispatchThreadID)\n"
68 "{\n"
69 " if (thread_id.x < u_info.dst_extent.x)\n"
70 " dst[int2(u_info.dst_offset.x + thread_id.x, thread_id.y)] = u_info.clear_value;\n"
71 "}\n";
72
74 "RWTexture1DArray<uint4> dst;\n"
75 "\n"
76 "struct\n"
77 "{\n"
78 " uint4 clear_value;\n"
79 " int2 dst_offset;\n"
80 " int2 dst_extent;\n"
81 "} u_info;\n"
82 "\n"
83 "[numthreads(64, 1, 1)]\n"
84 "void main(int3 thread_id : SV_DispatchThreadID)\n"
85 "{\n"
86 " if (thread_id.x < u_info.dst_extent.x)\n"
87 " dst[int2(u_info.dst_offset.x + thread_id.x, thread_id.y)] = u_info.clear_value;\n"
88 "}\n";
89
90static const char cs_uav_clear_1d_float_code[] =
91 "RWTexture1D<float4> dst;\n"
92 "\n"
93 "struct\n"
94 "{\n"
95 " float4 clear_value;\n"
96 " int2 dst_offset;\n"
97 " int2 dst_extent;\n"
98 "} u_info;\n"
99 "\n"
100 "[numthreads(64, 1, 1)]\n"
101 "void main(int3 thread_id : SV_DispatchThreadID)\n"
102 "{\n"
103 " if (thread_id.x < u_info.dst_extent.x)\n"
104 " dst[u_info.dst_offset.x + thread_id.x] = u_info.clear_value;\n"
105 "}\n";
106
107static const char cs_uav_clear_1d_uint_code[] =
108 "RWTexture1D<uint4> dst;\n"
109 "\n"
110 "struct\n"
111 "{\n"
112 " uint4 clear_value;\n"
113 " int2 dst_offset;\n"
114 " int2 dst_extent;\n"
115 "} u_info;\n"
116 "\n"
117 "[numthreads(64, 1, 1)]\n"
118 "void main(int3 thread_id : SV_DispatchThreadID)\n"
119 "{\n"
120 " if (thread_id.x < u_info.dst_extent.x)\n"
121 " dst[u_info.dst_offset.x + thread_id.x] = u_info.clear_value;\n"
122 "}\n";
123
125 "RWTexture2DArray<float4> dst;\n"
126 "\n"
127 "struct\n"
128 "{\n"
129 " float4 clear_value;\n"
130 " int2 dst_offset;\n"
131 " int2 dst_extent;\n"
132 "} u_info;\n"
133 "\n"
134 "[numthreads(8, 8, 1)]\n"
135 "void main(int3 thread_id : SV_DispatchThreadID)\n"
136 "{\n"
137 " if (all(thread_id.xy < u_info.dst_extent.xy))\n"
138 " dst[int3(u_info.dst_offset.xy + thread_id.xy, thread_id.z)] = u_info.clear_value;\n"
139 "}\n";
140
142 "RWTexture2DArray<uint4> dst;\n"
143 "\n"
144 "struct\n"
145 "{\n"
146 " uint4 clear_value;\n"
147 " int2 dst_offset;\n"
148 " int2 dst_extent;\n"
149 "} u_info;\n"
150 "\n"
151 "[numthreads(8, 8, 1)]\n"
152 "void main(int3 thread_id : SV_DispatchThreadID)\n"
153 "{\n"
154 " if (all(thread_id.xy < u_info.dst_extent.xy))\n"
155 " dst[int3(u_info.dst_offset.xy + thread_id.xy, thread_id.z)] = u_info.clear_value;\n"
156 "}\n";
157
158static const char cs_uav_clear_2d_float_code[] =
159 "RWTexture2D<float4> dst;\n"
160 "\n"
161 "struct\n"
162 "{\n"
163 " float4 clear_value;\n"
164 " int2 dst_offset;\n"
165 " int2 dst_extent;\n"
166 "} u_info;\n"
167 "\n"
168 "[numthreads(8, 8, 1)]\n"
169 "void main(int3 thread_id : SV_DispatchThreadID)\n"
170 "{\n"
171 " if (all(thread_id.xy < u_info.dst_extent.xy))\n"
172 " dst[u_info.dst_offset.xy + thread_id.xy] = u_info.clear_value;\n"
173 "}\n";
174
175static const char cs_uav_clear_2d_uint_code[] =
176 "RWTexture2D<uint4> dst;\n"
177 "\n"
178 "struct\n"
179 "{\n"
180 " uint4 clear_value;\n"
181 " int2 dst_offset;\n"
182 " int2 dst_extent;\n"
183 "} u_info;\n"
184 "\n"
185 "[numthreads(8, 8, 1)]\n"
186 "void main(int3 thread_id : SV_DispatchThreadID)\n"
187 "{\n"
188 " if (all(thread_id.xy < u_info.dst_extent.xy))\n"
189 " dst[u_info.dst_offset.xy + thread_id.xy] = u_info.clear_value;\n"
190 "}\n";
191
192static const char cs_uav_clear_3d_float_code[] =
193 "RWTexture3D<float4> dst;\n"
194 "\n"
195 "struct\n"
196 "{\n"
197 " float4 clear_value;\n"
198 " int2 dst_offset;\n"
199 " int2 dst_extent;\n"
200 "} u_info;\n"
201 "\n"
202 "[numthreads(8, 8, 1)]\n"
203 "void main(int3 thread_id : SV_DispatchThreadID)\n"
204 "{\n"
205 " if (all(thread_id.xy < u_info.dst_extent.xy))\n"
206 " dst[int3(u_info.dst_offset.xy, 0) + thread_id.xyz] = u_info.clear_value;\n"
207 "}\n";
208
209static const char cs_uav_clear_3d_uint_code[] =
210 "RWTexture3D<uint4> dst;\n"
211 "\n"
212 "struct\n"
213 "{\n"
214 " uint4 clear_value;\n"
215 " int2 dst_offset;\n"
216 " int2 dst_extent;\n"
217 "} u_info;\n"
218 "\n"
219 "[numthreads(8, 8, 1)]\n"
220 "void main(int3 thread_id : SV_DispatchThreadID)\n"
221 "{\n"
222 " if (all(thread_id.xy < u_info.dst_extent.xy))\n"
223 " dst[int3(u_info.dst_offset.xy, 0) + thread_id.xyz] = u_info.clear_value;\n"
224 "}\n";
225
226#endif /* __VKD3D_SHADERS_H */
static const char cs_uav_clear_3d_uint_code[]
static const char cs_uav_clear_1d_array_float_code[]
Definition: vkd3d_shaders.h:56
static const char cs_uav_clear_2d_array_uint_code[]
static const char cs_uav_clear_1d_array_uint_code[]
Definition: vkd3d_shaders.h:73
static const char cs_uav_clear_1d_float_code[]
Definition: vkd3d_shaders.h:90
static const char cs_uav_clear_buffer_float_code[]
Definition: vkd3d_shaders.h:22
static const char cs_uav_clear_2d_uint_code[]
static const char cs_uav_clear_3d_float_code[]
static const char cs_uav_clear_buffer_uint_code[]
Definition: vkd3d_shaders.h:39
static const char cs_uav_clear_1d_uint_code[]
static const char cs_uav_clear_2d_array_float_code[]
static const char cs_uav_clear_2d_float_code[]