Commit f88ec54
[offloader] Fan a single DXIL library across an RT pipeline's Shaders[]
RayTracing pipelines compile every entry point — raygen, miss,
closest-hit, any-hit, intersection, callable — into a single DXIL
library via `dxc -T lib_6_x` / `clang-dxc -T lib_6_x`. That's the
shape every real DXR app ships: D3D12's CreateStateObject requires a
DXIL-library subobject anyway, and the driver fuses entry points
across the whole library at link time, so writing one .hlsl file and
compiling it once is both idiomatic and the path the framework's
`%dxc_target_lib` substitution emits.
Compute and raster pipelines stay one-to-one (the existing position-
based mapping handles VS+PS, AS+MS+PS, etc.). RT pipelines today need
N positional args even though one library blob holds every entry —
which the foundational `raygen-roundtrip.test` runs straight into:
3 Shaders[] entries vs 1 input file fails the count check before any
GPU work happens.
Detect the RT-pipeline-with-one-input shape and copy the library blob
into every `Shaders[].Shader` slot via `MemoryBuffer::getMemBufferCopy`.
Each entry owns its own buffer copy (DXIL libraries are KBs, no real
memory pressure) keeping the existing `unique_ptr<MemoryBuffer>`
ownership model intact. Non-RT pipelines still go through the
positional path and still enforce the count check.
Verified by re-running `raygen-roundtrip.test`'s pipeline.yaml + the
DXIL library via Wine + vkd3d-proton with a single .o argument — same
0xBEEF result the prior three-arg invocation produced.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent bfcd3a2 commit f88ec54
1 file changed
Lines changed: 23 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
128 | 135 | | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
129 | 140 | | |
130 | 141 | | |
131 | 142 | | |
132 | 143 | | |
133 | 144 | | |
134 | | - | |
135 | | - | |
136 | 145 | | |
137 | 146 | | |
138 | 147 | | |
| |||
0 commit comments