Commit 7a0138d
Stephen Gutekanst
Replace proprietary dxil.dll code signing blob with FOSS alternative
Normal usage of dxcompiler requires that you use a proprietary `dxil.dll`
distributed by Microsoft. If this is not found next to the dxcompiler binary
when compiling shaders, then the final shader binary will not be signed and
as a result will not run on others' machines.
DXC is also written with the assumption that dxil.dll and dxcompiler.dll itself
are loaded as dynamic libraries. This, combined with dxil.dll being a proprietary
blob, is annoying for users of Mach engine and [many others](https://bevy-cheatbook.github.io/platforms/windows.html#dxc-compiler-support)
as it just complicates application distribution further.
This commit replaces dxcompiler.dll runtime loading behavior with an 'emulated'
dynamic library, effectively completing our effort to make dxcompiler a static
library.
dxil.dll is closed-source, so we cannot simply patch it in the same way. To fix
this, we outright disable runtime loading of dxil.dll and silence warnings related
to it not being present / the final binary not being code signed. Instead, once
the compiler would emit a compiled shader blob, we perform our own code signing
algorithm (Mach Siegbert Vogt DXCSA) which results in a bitwise identical compiled
shader, and thus dxil.dll is no longer needed to perform code signing of shaders.
Ultimately, this means mach-dxcompiler can be a fully static library, code signing
included.
Signed-off-by: Stephen Gutekanst <[email protected]>1 parent 093ec70 commit 7a0138d
File tree
11 files changed
+394
-79
lines changed- include/dxc/Support
- lib/DxcSupport
- tools/clang/tools
- dxclib
- dxcompiler
- dxrfallbackcompiler
11 files changed
+394
-79
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
22 | 26 | | |
23 | 27 | | |
24 | 28 | | |
25 | 29 | | |
26 | 30 | | |
27 | | - | |
| 31 | + | |
28 | 32 | | |
| 33 | + | |
29 | 34 | | |
30 | 35 | | |
31 | 36 | | |
32 | 37 | | |
33 | 38 | | |
34 | | - | |
| 39 | + | |
35 | 40 | | |
36 | 41 | | |
37 | 42 | | |
| |||
79 | 84 | | |
80 | 85 | | |
81 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
82 | 112 | | |
83 | 113 | | |
84 | 114 | | |
85 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
86 | 125 | | |
87 | 126 | | |
88 | 127 | | |
| |||
91 | 130 | | |
92 | 131 | | |
93 | 132 | | |
94 | | - | |
| 133 | + | |
95 | 134 | | |
96 | 135 | | |
97 | 136 | | |
98 | 137 | | |
99 | 138 | | |
100 | | - | |
| 139 | + | |
101 | 140 | | |
102 | 141 | | |
| 142 | + | |
| 143 | + | |
103 | 144 | | |
104 | 145 | | |
105 | 146 | | |
| |||
127 | 168 | | |
128 | 169 | | |
129 | 170 | | |
130 | | - | |
| 171 | + | |
131 | 172 | | |
132 | 173 | | |
133 | 174 | | |
| |||
147 | 188 | | |
148 | 189 | | |
149 | 190 | | |
150 | | - | |
| 191 | + | |
151 | 192 | | |
152 | 193 | | |
153 | 194 | | |
| |||
160 | 201 | | |
161 | 202 | | |
162 | 203 | | |
163 | | - | |
| 204 | + | |
164 | 205 | | |
165 | 206 | | |
166 | 207 | | |
167 | 208 | | |
168 | 209 | | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
169 | 216 | | |
170 | 217 | | |
171 | 218 | | |
| |||
178 | 225 | | |
179 | 226 | | |
180 | 227 | | |
181 | | - | |
| 228 | + | |
182 | 229 | | |
183 | 230 | | |
184 | 231 | | |
185 | 232 | | |
186 | 233 | | |
| 234 | + | |
187 | 235 | | |
188 | 236 | | |
189 | 237 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
| 35 | + | |
| 36 | + | |
39 | 37 | | |
40 | 38 | | |
41 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1339 | 1339 | | |
1340 | 1340 | | |
1341 | 1341 | | |
1342 | | - | |
1343 | | - | |
1344 | | - | |
1345 | | - | |
1346 | | - | |
1347 | | - | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
1348 | 1346 | | |
1349 | 1347 | | |
1350 | 1348 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
69 | | - | |
70 | | - | |
| 68 | + | |
71 | 69 | | |
72 | 70 | | |
73 | 71 | | |
| |||
87 | 85 | | |
88 | 86 | | |
89 | 87 | | |
90 | | - | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
91 | 92 | | |
92 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
93 | 97 | | |
94 | 98 | | |
95 | 99 | | |
96 | 100 | | |
97 | 101 | | |
98 | 102 | | |
99 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
100 | 114 | | |
101 | | - | |
| 115 | + | |
102 | 116 | | |
103 | 117 | | |
104 | 118 | | |
| |||
112 | 126 | | |
113 | 127 | | |
114 | 128 | | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
123 | 135 | | |
124 | 136 | | |
125 | 137 | | |
| |||
128 | 140 | | |
129 | 141 | | |
130 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
131 | 153 | | |
0 commit comments