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 22 static const uint32_t cs_uav_clear_buffer_float_code[] = 23 { 24 #if 0 25 RWBuffer<float4> dst; 26 27 struct 28 { 29 float4 clear_value; 30 int2 dst_offset; 31 int2 dst_extent; 32 } u_info; 33 34 [numthreads(128, 1, 1)] 35 void main(int3 thread_id : SV_DispatchThreadID) 36 { 37 if (thread_id.x < u_info.dst_extent.x) 38 dst[u_info.dst_offset.x + thread_id.x] = u_info.clear_value; 39 } 40 #endif 41 0x43425844, 0xe114ba61, 0xff6a0d0b, 0x7b25c8f4, 0xfcf7cf22, 0x00000001, 0x0000010c, 0x00000003, 42 0x0000002c, 0x0000003c, 0x0000004c, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f, 43 0x00000008, 0x00000000, 0x00000008, 0x58454853, 0x000000b8, 0x00050050, 0x0000002e, 0x0100086a, 44 0x04000059, 0x00208e46, 0x00000000, 0x00000002, 0x0400089c, 0x0011e000, 0x00000000, 0x00005555, 45 0x0200005f, 0x00020012, 0x02000068, 0x00000001, 0x0400009b, 0x00000080, 0x00000001, 0x00000001, 46 0x07000022, 0x00100012, 0x00000000, 0x0002000a, 0x0020802a, 0x00000000, 0x00000001, 0x0304001f, 47 0x0010000a, 0x00000000, 0x0700001e, 0x00100012, 0x00000000, 0x0002000a, 0x0020800a, 0x00000000, 48 0x00000001, 0x080000a4, 0x0011e0f2, 0x00000000, 0x00100006, 0x00000000, 0x00208e46, 0x00000000, 49 0x00000000, 0x01000015, 0x0100003e, 50 }; 51 52 static const uint32_t cs_uav_clear_buffer_uint_code[] = 53 { 54 #if 0 55 RWBuffer<uint4> dst; 56 57 struct 58 { 59 uint4 clear_value; 60 int2 dst_offset; 61 int2 dst_extent; 62 } u_info; 63 64 [numthreads(128, 1, 1)] 65 void main(int3 thread_id : SV_DispatchThreadID) 66 { 67 if (thread_id.x < u_info.dst_extent.x) 68 dst[u_info.dst_offset.x + thread_id.x] = u_info.clear_value; 69 } 70 #endif 71 0x43425844, 0x3afd0cfd, 0x5145c166, 0x5b9f76b8, 0xa73775cd, 0x00000001, 0x0000010c, 0x00000003, 72 0x0000002c, 0x0000003c, 0x0000004c, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f, 73 0x00000008, 0x00000000, 0x00000008, 0x58454853, 0x000000b8, 0x00050050, 0x0000002e, 0x0100086a, 74 0x04000059, 0x00208e46, 0x00000000, 0x00000002, 0x0400089c, 0x0011e000, 0x00000000, 0x00004444, 75 0x0200005f, 0x00020012, 0x02000068, 0x00000001, 0x0400009b, 0x00000080, 0x00000001, 0x00000001, 76 0x07000022, 0x00100012, 0x00000000, 0x0002000a, 0x0020802a, 0x00000000, 0x00000001, 0x0304001f, 77 0x0010000a, 0x00000000, 0x0700001e, 0x00100012, 0x00000000, 0x0002000a, 0x0020800a, 0x00000000, 78 0x00000001, 0x080000a4, 0x0011e0f2, 0x00000000, 0x00100006, 0x00000000, 0x00208e46, 0x00000000, 79 0x00000000, 0x01000015, 0x0100003e, 80 }; 81 82 static const uint32_t cs_uav_clear_1d_array_float_code[] = 83 { 84 #if 0 85 RWTexture1DArray<float4> dst; 86 87 struct 88 { 89 float4 clear_value; 90 int2 dst_offset; 91 int2 dst_extent; 92 } u_info; 93 94 [numthreads(64, 1, 1)] 95 void main(int3 thread_id : SV_DispatchThreadID) 96 { 97 if (thread_id.x < u_info.dst_extent.x) 98 dst[int2(u_info.dst_offset.x + thread_id.x, thread_id.y)] = u_info.clear_value; 99 } 100 #endif 101 0x43425844, 0x3d73bc2d, 0x2b635f3d, 0x6bf98e92, 0xbe0aa5d9, 0x00000001, 0x0000011c, 0x00000003, 102 0x0000002c, 0x0000003c, 0x0000004c, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f, 103 0x00000008, 0x00000000, 0x00000008, 0x58454853, 0x000000c8, 0x00050050, 0x00000032, 0x0100086a, 104 0x04000059, 0x00208e46, 0x00000000, 0x00000002, 0x0400389c, 0x0011e000, 0x00000000, 0x00005555, 105 0x0200005f, 0x00020032, 0x02000068, 0x00000001, 0x0400009b, 0x00000040, 0x00000001, 0x00000001, 106 0x07000022, 0x00100012, 0x00000000, 0x0002000a, 0x0020802a, 0x00000000, 0x00000001, 0x0304001f, 107 0x0010000a, 0x00000000, 0x0700001e, 0x00100012, 0x00000000, 0x0002000a, 0x0020800a, 0x00000000, 108 0x00000001, 0x04000036, 0x001000e2, 0x00000000, 0x00020556, 0x080000a4, 0x0011e0f2, 0x00000000, 109 0x00100e46, 0x00000000, 0x00208e46, 0x00000000, 0x00000000, 0x01000015, 0x0100003e, 110 }; 111 112 static const uint32_t cs_uav_clear_1d_array_uint_code[] = 113 { 114 #if 0 115 RWTexture1DArray<uint4> dst; 116 117 struct 118 { 119 uint4 clear_value; 120 int2 dst_offset; 121 int2 dst_extent; 122 } u_info; 123 124 [numthreads(64, 1, 1)] 125 void main(int3 thread_id : SV_DispatchThreadID) 126 { 127 if (thread_id.x < u_info.dst_extent.x) 128 dst[int2(u_info.dst_offset.x + thread_id.x, thread_id.y)] = u_info.clear_value; 129 } 130 #endif 131 0x43425844, 0x2f0ca457, 0x72068b34, 0xd9dadc2b, 0xd3178c3e, 0x00000001, 0x0000011c, 0x00000003, 132 0x0000002c, 0x0000003c, 0x0000004c, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f, 133 0x00000008, 0x00000000, 0x00000008, 0x58454853, 0x000000c8, 0x00050050, 0x00000032, 0x0100086a, 134 0x04000059, 0x00208e46, 0x00000000, 0x00000002, 0x0400389c, 0x0011e000, 0x00000000, 0x00004444, 135 0x0200005f, 0x00020032, 0x02000068, 0x00000001, 0x0400009b, 0x00000040, 0x00000001, 0x00000001, 136 0x07000022, 0x00100012, 0x00000000, 0x0002000a, 0x0020802a, 0x00000000, 0x00000001, 0x0304001f, 137 0x0010000a, 0x00000000, 0x0700001e, 0x00100012, 0x00000000, 0x0002000a, 0x0020800a, 0x00000000, 138 0x00000001, 0x04000036, 0x001000e2, 0x00000000, 0x00020556, 0x080000a4, 0x0011e0f2, 0x00000000, 139 0x00100e46, 0x00000000, 0x00208e46, 0x00000000, 0x00000000, 0x01000015, 0x0100003e, 140 }; 141 142 static const uint32_t cs_uav_clear_1d_float_code[] = 143 { 144 #if 0 145 RWTexture1D<float4> dst; 146 147 struct 148 { 149 float4 clear_value; 150 int2 dst_offset; 151 int2 dst_extent; 152 } u_info; 153 154 [numthreads(64, 1, 1)] 155 void main(int3 thread_id : SV_DispatchThreadID) 156 { 157 if (thread_id.x < u_info.dst_extent.x) 158 dst[u_info.dst_offset.x + thread_id.x] = u_info.clear_value; 159 } 160 #endif 161 0x43425844, 0x05266503, 0x4b97006f, 0x01a5cc63, 0xe617d0a1, 0x00000001, 0x0000010c, 0x00000003, 162 0x0000002c, 0x0000003c, 0x0000004c, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f, 163 0x00000008, 0x00000000, 0x00000008, 0x58454853, 0x000000b8, 0x00050050, 0x0000002e, 0x0100086a, 164 0x04000059, 0x00208e46, 0x00000000, 0x00000002, 0x0400109c, 0x0011e000, 0x00000000, 0x00005555, 165 0x0200005f, 0x00020012, 0x02000068, 0x00000001, 0x0400009b, 0x00000040, 0x00000001, 0x00000001, 166 0x07000022, 0x00100012, 0x00000000, 0x0002000a, 0x0020802a, 0x00000000, 0x00000001, 0x0304001f, 167 0x0010000a, 0x00000000, 0x0700001e, 0x00100012, 0x00000000, 0x0002000a, 0x0020800a, 0x00000000, 168 0x00000001, 0x080000a4, 0x0011e0f2, 0x00000000, 0x00100006, 0x00000000, 0x00208e46, 0x00000000, 169 0x00000000, 0x01000015, 0x0100003e, 170 }; 171 172 static const uint32_t cs_uav_clear_1d_uint_code[] = 173 { 174 #if 0 175 RWTexture1D<uint4> dst; 176 177 struct 178 { 179 uint4 clear_value; 180 int2 dst_offset; 181 int2 dst_extent; 182 } u_info; 183 184 [numthreads(64, 1, 1)] 185 void main(int3 thread_id : SV_DispatchThreadID) 186 { 187 if (thread_id.x < u_info.dst_extent.x) 188 dst[u_info.dst_offset.x + thread_id.x] = u_info.clear_value; 189 } 190 #endif 191 0x43425844, 0x19d5c8f2, 0x3ca4ac24, 0x9e258499, 0xf0463fd6, 0x00000001, 0x0000010c, 0x00000003, 192 0x0000002c, 0x0000003c, 0x0000004c, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f, 193 0x00000008, 0x00000000, 0x00000008, 0x58454853, 0x000000b8, 0x00050050, 0x0000002e, 0x0100086a, 194 0x04000059, 0x00208e46, 0x00000000, 0x00000002, 0x0400109c, 0x0011e000, 0x00000000, 0x00004444, 195 0x0200005f, 0x00020012, 0x02000068, 0x00000001, 0x0400009b, 0x00000040, 0x00000001, 0x00000001, 196 0x07000022, 0x00100012, 0x00000000, 0x0002000a, 0x0020802a, 0x00000000, 0x00000001, 0x0304001f, 197 0x0010000a, 0x00000000, 0x0700001e, 0x00100012, 0x00000000, 0x0002000a, 0x0020800a, 0x00000000, 198 0x00000001, 0x080000a4, 0x0011e0f2, 0x00000000, 0x00100006, 0x00000000, 0x00208e46, 0x00000000, 199 0x00000000, 0x01000015, 0x0100003e, 200 }; 201 202 static const uint32_t cs_uav_clear_2d_array_float_code[] = 203 { 204 #if 0 205 RWTexture2DArray<float4> dst; 206 207 struct 208 { 209 float4 clear_value; 210 int2 dst_offset; 211 int2 dst_extent; 212 } u_info; 213 214 [numthreads(8, 8, 1)] 215 void main(int3 thread_id : SV_DispatchThreadID) 216 { 217 if (all(thread_id.xy < u_info.dst_extent.xy)) 218 dst[int3(u_info.dst_offset.xy + thread_id.xy, thread_id.z)] = u_info.clear_value; 219 } 220 #endif 221 0x43425844, 0x924d2d2c, 0xb9166376, 0x99f83871, 0x8ef65025, 0x00000001, 0x00000138, 0x00000003, 222 0x0000002c, 0x0000003c, 0x0000004c, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f, 223 0x00000008, 0x00000000, 0x00000008, 0x58454853, 0x000000e4, 0x00050050, 0x00000039, 0x0100086a, 224 0x04000059, 0x00208e46, 0x00000000, 0x00000002, 0x0400409c, 0x0011e000, 0x00000000, 0x00005555, 225 0x0200005f, 0x00020072, 0x02000068, 0x00000001, 0x0400009b, 0x00000008, 0x00000008, 0x00000001, 226 0x07000022, 0x00100032, 0x00000000, 0x00020046, 0x00208ae6, 0x00000000, 0x00000001, 0x07000001, 227 0x00100012, 0x00000000, 0x0010001a, 0x00000000, 0x0010000a, 0x00000000, 0x0304001f, 0x0010000a, 228 0x00000000, 0x0700001e, 0x00100032, 0x00000000, 0x00020046, 0x00208046, 0x00000000, 0x00000001, 229 0x04000036, 0x001000c2, 0x00000000, 0x00020aa6, 0x080000a4, 0x0011e0f2, 0x00000000, 0x00100e46, 230 0x00000000, 0x00208e46, 0x00000000, 0x00000000, 0x01000015, 0x0100003e, 231 }; 232 233 static const uint32_t cs_uav_clear_2d_array_uint_code[] = 234 { 235 #if 0 236 RWTexture2DArray<uint4> dst; 237 238 struct 239 { 240 uint4 clear_value; 241 int2 dst_offset; 242 int2 dst_extent; 243 } u_info; 244 245 [numthreads(8, 8, 1)] 246 void main(int3 thread_id : SV_DispatchThreadID) 247 { 248 if (all(thread_id.xy < u_info.dst_extent.xy)) 249 dst[int3(u_info.dst_offset.xy + thread_id.xy, thread_id.z)] = u_info.clear_value; 250 } 251 #endif 252 0x43425844, 0xa92219d4, 0xa2c5e47d, 0x0d308500, 0xf32197b4, 0x00000001, 0x00000138, 0x00000003, 253 0x0000002c, 0x0000003c, 0x0000004c, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f, 254 0x00000008, 0x00000000, 0x00000008, 0x58454853, 0x000000e4, 0x00050050, 0x00000039, 0x0100086a, 255 0x04000059, 0x00208e46, 0x00000000, 0x00000002, 0x0400409c, 0x0011e000, 0x00000000, 0x00004444, 256 0x0200005f, 0x00020072, 0x02000068, 0x00000001, 0x0400009b, 0x00000008, 0x00000008, 0x00000001, 257 0x07000022, 0x00100032, 0x00000000, 0x00020046, 0x00208ae6, 0x00000000, 0x00000001, 0x07000001, 258 0x00100012, 0x00000000, 0x0010001a, 0x00000000, 0x0010000a, 0x00000000, 0x0304001f, 0x0010000a, 259 0x00000000, 0x0700001e, 0x00100032, 0x00000000, 0x00020046, 0x00208046, 0x00000000, 0x00000001, 260 0x04000036, 0x001000c2, 0x00000000, 0x00020aa6, 0x080000a4, 0x0011e0f2, 0x00000000, 0x00100e46, 261 0x00000000, 0x00208e46, 0x00000000, 0x00000000, 0x01000015, 0x0100003e, 262 }; 263 264 static const uint32_t cs_uav_clear_2d_float_code[] = 265 { 266 #if 0 267 RWTexture2D<float4> dst; 268 269 struct 270 { 271 float4 clear_value; 272 int2 dst_offset; 273 int2 dst_extent; 274 } u_info; 275 276 [numthreads(8, 8, 1)] 277 void main(int3 thread_id : SV_DispatchThreadID) 278 { 279 if (all(thread_id.xy < u_info.dst_extent.xy)) 280 dst[u_info.dst_offset.xy + thread_id.xy] = u_info.clear_value; 281 } 282 #endif 283 0x43425844, 0x6e735b3f, 0x7348c4fa, 0xb3634e42, 0x50e2d99b, 0x00000001, 0x00000128, 0x00000003, 284 0x0000002c, 0x0000003c, 0x0000004c, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f, 285 0x00000008, 0x00000000, 0x00000008, 0x58454853, 0x000000d4, 0x00050050, 0x00000035, 0x0100086a, 286 0x04000059, 0x00208e46, 0x00000000, 0x00000002, 0x0400189c, 0x0011e000, 0x00000000, 0x00005555, 287 0x0200005f, 0x00020032, 0x02000068, 0x00000001, 0x0400009b, 0x00000008, 0x00000008, 0x00000001, 288 0x07000022, 0x00100032, 0x00000000, 0x00020046, 0x00208ae6, 0x00000000, 0x00000001, 0x07000001, 289 0x00100012, 0x00000000, 0x0010001a, 0x00000000, 0x0010000a, 0x00000000, 0x0304001f, 0x0010000a, 290 0x00000000, 0x0700001e, 0x001000f2, 0x00000000, 0x00020546, 0x00208546, 0x00000000, 0x00000001, 291 0x080000a4, 0x0011e0f2, 0x00000000, 0x00100e46, 0x00000000, 0x00208e46, 0x00000000, 0x00000000, 292 0x01000015, 0x0100003e, 293 }; 294 295 static const uint32_t cs_uav_clear_2d_uint_code[] = 296 { 297 #if 0 298 RWTexture2D<uint4> dst; 299 300 struct 301 { 302 uint4 clear_value; 303 int2 dst_offset; 304 int2 dst_extent; 305 } u_info; 306 307 [numthreads(8, 8, 1)] 308 void main(int3 thread_id : SV_DispatchThreadID) 309 { 310 if (all(thread_id.xy < u_info.dst_extent.xy)) 311 dst[u_info.dst_offset.xy + thread_id.xy] = u_info.clear_value; 312 } 313 #endif 314 0x43425844, 0xf01db5dd, 0xc7dc5e55, 0xb017c1a8, 0x55abd52d, 0x00000001, 0x00000128, 0x00000003, 315 0x0000002c, 0x0000003c, 0x0000004c, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f, 316 0x00000008, 0x00000000, 0x00000008, 0x58454853, 0x000000d4, 0x00050050, 0x00000035, 0x0100086a, 317 0x04000059, 0x00208e46, 0x00000000, 0x00000002, 0x0400189c, 0x0011e000, 0x00000000, 0x00004444, 318 0x0200005f, 0x00020032, 0x02000068, 0x00000001, 0x0400009b, 0x00000008, 0x00000008, 0x00000001, 319 0x07000022, 0x00100032, 0x00000000, 0x00020046, 0x00208ae6, 0x00000000, 0x00000001, 0x07000001, 320 0x00100012, 0x00000000, 0x0010001a, 0x00000000, 0x0010000a, 0x00000000, 0x0304001f, 0x0010000a, 321 0x00000000, 0x0700001e, 0x001000f2, 0x00000000, 0x00020546, 0x00208546, 0x00000000, 0x00000001, 322 0x080000a4, 0x0011e0f2, 0x00000000, 0x00100e46, 0x00000000, 0x00208e46, 0x00000000, 0x00000000, 323 0x01000015, 0x0100003e, 324 }; 325 326 static const uint32_t cs_uav_clear_3d_float_code[] = 327 { 328 #if 0 329 RWTexture3D<float4> dst; 330 331 struct 332 { 333 float4 clear_value; 334 int2 dst_offset; 335 int2 dst_extent; 336 } u_info; 337 338 [numthreads(8, 8, 1)] 339 void main(int3 thread_id : SV_DispatchThreadID) 340 { 341 if (all(thread_id.xy < u_info.dst_extent.xy)) 342 dst[int3(u_info.dst_offset.xy, 0) + thread_id.xyz] = u_info.clear_value; 343 } 344 #endif 345 0x43425844, 0x5d8f36a0, 0x30fa86a5, 0xfec7f2ef, 0xdfd76cbb, 0x00000001, 0x00000138, 0x00000003, 346 0x0000002c, 0x0000003c, 0x0000004c, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f, 347 0x00000008, 0x00000000, 0x00000008, 0x58454853, 0x000000e4, 0x00050050, 0x00000039, 0x0100086a, 348 0x04000059, 0x00208e46, 0x00000000, 0x00000002, 0x0400289c, 0x0011e000, 0x00000000, 0x00005555, 349 0x0200005f, 0x00020072, 0x02000068, 0x00000001, 0x0400009b, 0x00000008, 0x00000008, 0x00000001, 350 0x07000022, 0x00100032, 0x00000000, 0x00020046, 0x00208ae6, 0x00000000, 0x00000001, 0x07000001, 351 0x00100012, 0x00000000, 0x0010001a, 0x00000000, 0x0010000a, 0x00000000, 0x0304001f, 0x0010000a, 352 0x00000000, 0x0700001e, 0x00100032, 0x00000000, 0x00020046, 0x00208046, 0x00000000, 0x00000001, 353 0x04000036, 0x001000c2, 0x00000000, 0x00020aa6, 0x080000a4, 0x0011e0f2, 0x00000000, 0x00100e46, 354 0x00000000, 0x00208e46, 0x00000000, 0x00000000, 0x01000015, 0x0100003e, 355 }; 356 357 static const uint32_t cs_uav_clear_3d_uint_code[] = 358 { 359 #if 0 360 RWTexture3D<uint4> dst; 361 362 struct 363 { 364 uint4 clear_value; 365 int2 dst_offset; 366 int2 dst_extent; 367 } u_info; 368 369 [numthreads(8, 8, 1)] 370 void main(int3 thread_id : SV_DispatchThreadID) 371 { 372 if (all(thread_id.xy < u_info.dst_extent.xy)) 373 dst[int3(u_info.dst_offset.xy, 0) + thread_id.xyz] = u_info.clear_value; 374 } 375 #endif 376 0x43425844, 0x5b9c95b1, 0xc9bde4e3, 0x9aaff806, 0x24a1d264, 0x00000001, 0x00000138, 0x00000003, 377 0x0000002c, 0x0000003c, 0x0000004c, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f, 378 0x00000008, 0x00000000, 0x00000008, 0x58454853, 0x000000e4, 0x00050050, 0x00000039, 0x0100086a, 379 0x04000059, 0x00208e46, 0x00000000, 0x00000002, 0x0400289c, 0x0011e000, 0x00000000, 0x00004444, 380 0x0200005f, 0x00020072, 0x02000068, 0x00000001, 0x0400009b, 0x00000008, 0x00000008, 0x00000001, 381 0x07000022, 0x00100032, 0x00000000, 0x00020046, 0x00208ae6, 0x00000000, 0x00000001, 0x07000001, 382 0x00100012, 0x00000000, 0x0010001a, 0x00000000, 0x0010000a, 0x00000000, 0x0304001f, 0x0010000a, 383 0x00000000, 0x0700001e, 0x00100032, 0x00000000, 0x00020046, 0x00208046, 0x00000000, 0x00000001, 384 0x04000036, 0x001000c2, 0x00000000, 0x00020aa6, 0x080000a4, 0x0011e0f2, 0x00000000, 0x00100e46, 385 0x00000000, 0x00208e46, 0x00000000, 0x00000000, 0x01000015, 0x0100003e, 386 }; 387 388 #endif /* __VKD3D_SHADERS_H */ 389