Commit a1a661f
Bind acceleration structures and enable the InlineRT tests
Wire up acceleration-structure descriptor binding end-to-end across
all three backends so shaders can actually consume the TLAS that
buildPipelineAccelerationStructures produced — completing the stack
and promoting the three InlineRT tests from XFAIL to passing.
Vulkan: createDescriptorPool counts AS descriptors in a separate
scalar (the KHR enum value 1000150000 doesn't fit in the indexed
array used for the core types) and emits one VkDescriptorPoolSize
for them. createDescriptorSets resolves each AS resource via
Resource::TLASPtr, locates the matching VulkanAccelerationStructure
in InvocationState::AccelStructs (BLASes-then-TLASes layout, matching
the helper's documented declaration order), and writes the handle
through a VkWriteDescriptorSetAccelerationStructureKHR chained on the
descriptor write's pNext. The dispatch's pre-barrier dst access now
includes VK_ACCESS_ACCELERATION_STRUCTURE_READ_BIT_KHR so the prior
AS-build's writes are made visible to the shader's RayQuery reads.
Device creation also enables VK_KHR_ray_query when supported so the
RayQuery shader instructions actually function.
DX12: writes a D3D12_SRV_DIMENSION_RAYTRACING_ACCELERATION_STRUCTURE
SRV with the AS GPU virtual address as Location into the heap slot
that createBuffers reserved (CreateShaderResourceView with a null
resource — the AS data lives in the buffer pointed to by Location).
Metal: the Metal shader converter doesn't bind the AS directly; the
shader reads a buffer containing an IRRaytracingAccelerationStructure-
GPUHeader that holds the AS's gpuResourceID plus a pointer to an
instance-contributions array. createBuffers allocates and fills both
buffers per AS-descriptor entry, then points the descriptor at the
header buffer's GPU address. The TLAS itself is built with the UserID
instance-descriptor variant so HLSL CommittedInstanceID() returns the
YAML-specified per-instance ID instead of the array index.
The three InlineRT tests now actually exercise the AS end-to-end:
TraceRayInline issues a RayQuery against `Scene` and writes a
hit-dependent value into `Output` (the instance ID for multi-instance,
1/0 otherwise). The catch-all `XFAIL: *` is dropped; `XFAIL: Clang`
remains. The test shaders gain explicit `[[vk::binding]]` annotations
since their `t0`/`u0` registers would otherwise collide under the
default dxc HLSL→SPIR-V mapping.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent a3b5e99 commit a1a661f
6 files changed
Lines changed: 235 additions & 27 deletions
File tree
- lib/API
- DX
- MTL
- VK
- test/Feature/InlineRT
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2169 | 2169 | | |
2170 | 2170 | | |
2171 | 2171 | | |
| 2172 | + | |
| 2173 | + | |
| 2174 | + | |
| 2175 | + | |
| 2176 | + | |
| 2177 | + | |
2172 | 2178 | | |
2173 | 2179 | | |
2174 | 2180 | | |
| |||
2209 | 2215 | | |
2210 | 2216 | | |
2211 | 2217 | | |
| 2218 | + | |
| 2219 | + | |
2212 | 2220 | | |
2213 | 2221 | | |
| 2222 | + | |
| 2223 | + | |
| 2224 | + | |
| 2225 | + | |
| 2226 | + | |
| 2227 | + | |
| 2228 | + | |
| 2229 | + | |
| 2230 | + | |
| 2231 | + | |
| 2232 | + | |
| 2233 | + | |
| 2234 | + | |
| 2235 | + | |
| 2236 | + | |
| 2237 | + | |
| 2238 | + | |
| 2239 | + | |
| 2240 | + | |
| 2241 | + | |
| 2242 | + | |
| 2243 | + | |
| 2244 | + | |
| 2245 | + | |
| 2246 | + | |
| 2247 | + | |
2214 | 2248 | | |
2215 | 2249 | | |
2216 | 2250 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
20 | 23 | | |
21 | 24 | | |
22 | 25 | | |
| |||
962 | 965 | | |
963 | 966 | | |
964 | 967 | | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
965 | 972 | | |
966 | 973 | | |
967 | 974 | | |
| |||
1301 | 1308 | | |
1302 | 1309 | | |
1303 | 1310 | | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
1304 | 1317 | | |
1305 | 1318 | | |
1306 | 1319 | | |
| |||
1343 | 1356 | | |
1344 | 1357 | | |
1345 | 1358 | | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
1346 | 1404 | | |
1347 | 1405 | | |
1348 | 1406 | | |
| |||
1402 | 1460 | | |
1403 | 1461 | | |
1404 | 1462 | | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
1405 | 1469 | | |
1406 | 1470 | | |
1407 | 1471 | | |
| |||
1534 | 1598 | | |
1535 | 1599 | | |
1536 | 1600 | | |
| 1601 | + | |
| 1602 | + | |
| 1603 | + | |
1537 | 1604 | | |
1538 | 1605 | | |
1539 | 1606 | | |
| |||
2122 | 2189 | | |
2123 | 2190 | | |
2124 | 2191 | | |
| 2192 | + | |
| 2193 | + | |
| 2194 | + | |
| 2195 | + | |
| 2196 | + | |
2125 | 2197 | | |
2126 | 2198 | | |
2127 | 2199 | | |
| |||
2436 | 2508 | | |
2437 | 2509 | | |
2438 | 2510 | | |
2439 | | - | |
2440 | | - | |
| 2511 | + | |
| 2512 | + | |
| 2513 | + | |
2441 | 2514 | | |
2442 | 2515 | | |
2443 | | - | |
| 2516 | + | |
2444 | 2517 | | |
2445 | 2518 | | |
2446 | 2519 | | |
2447 | 2520 | | |
2448 | 2521 | | |
2449 | 2522 | | |
2450 | 2523 | | |
2451 | | - | |
| 2524 | + | |
2452 | 2525 | | |
2453 | 2526 | | |
2454 | 2527 | | |
| |||
2462 | 2535 | | |
2463 | 2536 | | |
2464 | 2537 | | |
| 2538 | + | |
2465 | 2539 | | |
2466 | 2540 | | |
2467 | 2541 | | |
2468 | 2542 | | |
2469 | 2543 | | |
2470 | 2544 | | |
| 2545 | + | |
| 2546 | + | |
2471 | 2547 | | |
2472 | 2548 | | |
2473 | 2549 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
837 | 837 | | |
838 | 838 | | |
839 | 839 | | |
| 840 | + | |
| 841 | + | |
840 | 842 | | |
841 | | - | |
| 843 | + | |
| 844 | + | |
842 | 845 | | |
843 | 846 | | |
844 | 847 | | |
| |||
1390 | 1393 | | |
1391 | 1394 | | |
1392 | 1395 | | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
1393 | 1399 | | |
1394 | 1400 | | |
1395 | 1401 | | |
1396 | 1402 | | |
1397 | 1403 | | |
1398 | 1404 | | |
| 1405 | + | |
1399 | 1406 | | |
1400 | 1407 | | |
1401 | 1408 | | |
| |||
1407 | 1414 | | |
1408 | 1415 | | |
1409 | 1416 | | |
| 1417 | + | |
| 1418 | + | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
1410 | 1423 | | |
1411 | 1424 | | |
1412 | 1425 | | |
| |||
1479 | 1492 | | |
1480 | 1493 | | |
1481 | 1494 | | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
1482 | 1503 | | |
1483 | 1504 | | |
1484 | 1505 | | |
| |||
3009 | 3030 | | |
3010 | 3031 | | |
3011 | 3032 | | |
| 3033 | + | |
| 3034 | + | |
| 3035 | + | |
| 3036 | + | |
| 3037 | + | |
| 3038 | + | |
| 3039 | + | |
| 3040 | + | |
3012 | 3041 | | |
3013 | 3042 | | |
3014 | 3043 | | |
| |||
3170 | 3199 | | |
3171 | 3200 | | |
3172 | 3201 | | |
| 3202 | + | |
| 3203 | + | |
| 3204 | + | |
3173 | 3205 | | |
3174 | 3206 | | |
| 3207 | + | |
| 3208 | + | |
| 3209 | + | |
| 3210 | + | |
3175 | 3211 | | |
3176 | 3212 | | |
3177 | 3213 | | |
| |||
3189 | 3225 | | |
3190 | 3226 | | |
3191 | 3227 | | |
| 3228 | + | |
| 3229 | + | |
| 3230 | + | |
| 3231 | + | |
| 3232 | + | |
| 3233 | + | |
3192 | 3234 | | |
3193 | 3235 | | |
3194 | 3236 | | |
| |||
3232 | 3274 | | |
3233 | 3275 | | |
3234 | 3276 | | |
| 3277 | + | |
| 3278 | + | |
3235 | 3279 | | |
3236 | 3280 | | |
| 3281 | + | |
| 3282 | + | |
| 3283 | + | |
| 3284 | + | |
| 3285 | + | |
3237 | 3286 | | |
3238 | 3287 | | |
3239 | 3288 | | |
| |||
3255 | 3304 | | |
3256 | 3305 | | |
3257 | 3306 | | |
| 3307 | + | |
| 3308 | + | |
3258 | 3309 | | |
3259 | 3310 | | |
3260 | 3311 | | |
| 3312 | + | |
| 3313 | + | |
3261 | 3314 | | |
3262 | 3315 | | |
3263 | 3316 | | |
3264 | | - | |
| 3317 | + | |
3265 | 3318 | | |
3266 | 3319 | | |
3267 | 3320 | | |
3268 | 3321 | | |
3269 | 3322 | | |
3270 | 3323 | | |
3271 | 3324 | | |
| 3325 | + | |
| 3326 | + | |
| 3327 | + | |
| 3328 | + | |
| 3329 | + | |
| 3330 | + | |
| 3331 | + | |
| 3332 | + | |
| 3333 | + | |
| 3334 | + | |
| 3335 | + | |
| 3336 | + | |
| 3337 | + | |
| 3338 | + | |
| 3339 | + | |
| 3340 | + | |
| 3341 | + | |
| 3342 | + | |
| 3343 | + | |
| 3344 | + | |
| 3345 | + | |
| 3346 | + | |
| 3347 | + | |
| 3348 | + | |
| 3349 | + | |
| 3350 | + | |
| 3351 | + | |
| 3352 | + | |
| 3353 | + | |
| 3354 | + | |
3272 | 3355 | | |
3273 | 3356 | | |
3274 | 3357 | | |
| |||
0 commit comments