Commit c822105
Fold the AS pointer into ResourceSet / ResourceRef
The AS-binding commit immediately above had each backend cross-reference
IS.AccelStructs by index arithmetic (R.TLASPtr - &P.AccelStructs.TLAS[0]
plus the BLAS-count offset) every time the binding loop hit an AS
resource. Pull that lookup into createBuffers / createResource (where
the per-resource record is built) and cache the resulting TLAS pointer
on the per-array-element struct so the binding loop just reads
Bundle[0].AS.
DX and Metal add an `AS` field to `ResourceSet`; Vulkan adds an `AS`
field to `ResourceRef`. The bundle stays a plain
`SmallVector<ResourceSet>` typedef on DX and Metal and the existing
struct on Vulkan — the AS pointer co-locates with its sibling
upload/buffer/image fields at the right granularity (per array
element), which is what the existing tagged-union shape of these
structs already does for buffer-vs-texture-vs-sampler.
`IS.AccelStructs` still owns the AS objects (BLASes need to live
somewhere too, and lifetime stays simple); the per-element record
only carries a non-owning pointer.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent a1a661f commit c822105
3 files changed
Lines changed: 58 additions & 51 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
976 | 976 | | |
977 | 977 | | |
978 | 978 | | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
979 | 982 | | |
980 | 983 | | |
981 | 984 | | |
982 | 985 | | |
983 | 986 | | |
| 987 | + | |
984 | 988 | | |
985 | 989 | | |
986 | 990 | | |
987 | | - | |
| 991 | + | |
988 | 992 | | |
989 | 993 | | |
990 | 994 | | |
991 | 995 | | |
992 | 996 | | |
993 | 997 | | |
| 998 | + | |
994 | 999 | | |
995 | 1000 | | |
996 | 1001 | | |
997 | 1002 | | |
998 | | - | |
999 | | - | |
| 1003 | + | |
1000 | 1004 | | |
1001 | 1005 | | |
1002 | 1006 | | |
| |||
2166 | 2170 | | |
2167 | 2171 | | |
2168 | 2172 | | |
2169 | | - | |
| 2173 | + | |
2170 | 2174 | | |
2171 | 2175 | | |
2172 | | - | |
2173 | | - | |
| 2176 | + | |
| 2177 | + | |
2174 | 2178 | | |
2175 | | - | |
| 2179 | + | |
| 2180 | + | |
| 2181 | + | |
| 2182 | + | |
| 2183 | + | |
| 2184 | + | |
| 2185 | + | |
| 2186 | + | |
2176 | 2187 | | |
2177 | 2188 | | |
2178 | 2189 | | |
| |||
2219 | 2230 | | |
2220 | 2231 | | |
2221 | 2232 | | |
2222 | | - | |
2223 | | - | |
2224 | | - | |
2225 | | - | |
2226 | | - | |
2227 | | - | |
2228 | | - | |
2229 | | - | |
2230 | | - | |
| 2233 | + | |
2231 | 2234 | | |
2232 | 2235 | | |
2233 | 2236 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
931 | 931 | | |
932 | 932 | | |
933 | 933 | | |
| 934 | + | |
| 935 | + | |
934 | 936 | | |
| 937 | + | |
935 | 938 | | |
936 | 939 | | |
937 | | - | |
938 | | - | |
| 940 | + | |
939 | 941 | | |
940 | 942 | | |
941 | 943 | | |
| |||
1305 | 1307 | | |
1306 | 1308 | | |
1307 | 1309 | | |
1308 | | - | |
| 1310 | + | |
1309 | 1311 | | |
1310 | 1312 | | |
1311 | | - | |
1312 | | - | |
| 1313 | + | |
| 1314 | + | |
1313 | 1315 | | |
1314 | | - | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
1315 | 1324 | | |
1316 | 1325 | | |
1317 | 1326 | | |
| |||
1356 | 1365 | | |
1357 | 1366 | | |
1358 | 1367 | | |
1359 | | - | |
1360 | | - | |
1361 | | - | |
1362 | | - | |
1363 | | - | |
1364 | | - | |
1365 | | - | |
1366 | | - | |
1367 | | - | |
1368 | | - | |
| 1368 | + | |
1369 | 1369 | | |
1370 | 1370 | | |
1371 | 1371 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1203 | 1203 | | |
1204 | 1204 | | |
1205 | 1205 | | |
1206 | | - | |
1207 | | - | |
1208 | | - | |
1209 | | - | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
1210 | 1214 | | |
1211 | 1215 | | |
1212 | 1216 | | |
| |||
3029 | 3033 | | |
3030 | 3034 | | |
3031 | 3035 | | |
3032 | | - | |
3033 | | - | |
3034 | | - | |
| 3036 | + | |
| 3037 | + | |
| 3038 | + | |
3035 | 3039 | | |
3036 | | - | |
3037 | | - | |
| 3040 | + | |
| 3041 | + | |
| 3042 | + | |
| 3043 | + | |
| 3044 | + | |
| 3045 | + | |
| 3046 | + | |
| 3047 | + | |
| 3048 | + | |
3038 | 3049 | | |
3039 | 3050 | | |
3040 | 3051 | | |
| |||
3153 | 3164 | | |
3154 | 3165 | | |
3155 | 3166 | | |
3156 | | - | |
| 3167 | + | |
3157 | 3168 | | |
3158 | 3169 | | |
3159 | 3170 | | |
| |||
3322 | 3333 | | |
3323 | 3334 | | |
3324 | 3335 | | |
3325 | | - | |
3326 | | - | |
3327 | | - | |
3328 | | - | |
3329 | | - | |
3330 | | - | |
3331 | | - | |
3332 | | - | |
3333 | | - | |
| 3336 | + | |
| 3337 | + | |
3334 | 3338 | | |
3335 | 3339 | | |
3336 | 3340 | | |
| |||
0 commit comments