Skip to content

Commit 3636db0

Browse files
committed
Deploying to master from @ gfx-rs/wgpu@db4cb26 🚀
1 parent 92c90ec commit 3636db0

File tree

25 files changed

+92
-50
lines changed

25 files changed

+92
-50
lines changed

doc/search-index.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

doc/search.desc/wgpu_test/wgpu_test-desc-0-.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

doc/src/wgpu_examples/ray_cube_compute/mod.rs.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -997,11 +997,11 @@
997997
base_test_parameters: wgpu_test::TestParameters {
998998
required_features: &lt;Example <span class="kw">as </span><span class="kw">crate</span>::framework::Example&gt;::required_features(),
999999
required_limits: &lt;Example <span class="kw">as </span><span class="kw">crate</span>::framework::Example&gt;::required_limits(),
1000-
force_fxc: <span class="bool-val">false</span>,
10011000
skips: <span class="macro">vec!</span>[],
10021001
failures: Vec::new(),
10031002
required_downlevel_caps:
10041003
&lt;Example <span class="kw">as </span><span class="kw">crate</span>::framework::Example&gt;::required_downlevel_capabilities(),
1004+
..Default::default()
10051005
},
10061006
comparisons: <span class="kw-2">&amp;</span>[wgpu_test::ComparisonType::Mean(<span class="number">0.02</span>)],
10071007
_phantom: std::marker::PhantomData::&lt;Example&gt;,

doc/src/wgpu_examples/ray_cube_fragment/mod.rs.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -771,11 +771,11 @@
771771
base_test_parameters: wgpu_test::TestParameters {
772772
required_features: &lt;Example <span class="kw">as </span><span class="kw">crate</span>::framework::Example&gt;::required_features(),
773773
required_limits: &lt;Example <span class="kw">as </span><span class="kw">crate</span>::framework::Example&gt;::required_limits(),
774-
force_fxc: <span class="bool-val">false</span>,
775774
skips: <span class="macro">vec!</span>[],
776775
failures: Vec::new(),
777776
required_downlevel_caps:
778777
&lt;Example <span class="kw">as </span><span class="kw">crate</span>::framework::Example&gt;::required_downlevel_capabilities(),
778+
..Default::default()
779779
},
780780
comparisons: <span class="kw-2">&amp;</span>[wgpu_test::ComparisonType::Mean(<span class="number">0.02</span>)],
781781
_phantom: std::marker::PhantomData::&lt;Example&gt;,

doc/src/wgpu_examples/ray_cube_normals/mod.rs.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,8 @@
490490
<a href="#489" id="489">489</a>
491491
<a href="#490" id="490">490</a>
492492
<a href="#491" id="491">491</a>
493-
<a href="#492" id="492">492</a></pre></div><pre class="rust"><code><span class="kw">use </span>std::{borrow::Cow, future::Future, iter, mem, pin::Pin, task, time::Instant};
493+
<a href="#492" id="492">492</a>
494+
<a href="#493" id="493">493</a></pre></div><pre class="rust"><code><span class="kw">use </span>std::{borrow::Cow, future::Future, iter, mem, pin::Pin, task, time::Instant};
494495

495496
<span class="kw">use </span>bytemuck::{Pod, Zeroable};
496497
<span class="kw">use </span>glam::{Affine3A, Mat4, Quat, Vec3};
@@ -978,6 +979,7 @@
978979
failures: Vec::new(),
979980
required_downlevel_caps:
980981
&lt;Example <span class="kw">as </span><span class="kw">crate</span>::framework::Example&gt;::required_downlevel_capabilities(),
982+
..Default::default()
981983
},
982984
comparisons: <span class="kw-2">&amp;</span>[wgpu_test::ComparisonType::Mean(<span class="number">0.02</span>)],
983985
_phantom: std::marker::PhantomData::&lt;Example&gt;,

doc/src/wgpu_examples/ray_scene/mod.rs.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1131,11 +1131,11 @@
11311131
base_test_parameters: wgpu_test::TestParameters {
11321132
required_features: &lt;Example <span class="kw">as </span><span class="kw">crate</span>::framework::Example&gt;::required_features(),
11331133
required_limits: &lt;Example <span class="kw">as </span><span class="kw">crate</span>::framework::Example&gt;::required_limits(),
1134-
force_fxc: <span class="bool-val">false</span>,
11351134
skips: <span class="macro">vec!</span>[],
11361135
failures: Vec::new(),
11371136
required_downlevel_caps:
11381137
&lt;Example <span class="kw">as </span><span class="kw">crate</span>::framework::Example&gt;::required_downlevel_capabilities(),
1138+
..Default::default()
11391139
},
11401140
comparisons: <span class="kw-2">&amp;</span>[wgpu_test::ComparisonType::Mean(<span class="number">0.02</span>)],
11411141
_phantom: std::marker::PhantomData::&lt;Example&gt;,

doc/src/wgpu_examples/ray_shadows/mod.rs.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@
767767
failures: Vec::new(),
768768
required_downlevel_caps:
769769
&lt;Example <span class="kw">as </span><span class="kw">crate</span>::framework::Example&gt;::required_downlevel_capabilities(),
770-
force_fxc: <span class="bool-val">false</span>,
770+
..Default::default()
771771
},
772772
comparisons: <span class="kw-2">&amp;</span>[wgpu_test::ComparisonType::Mean(<span class="number">0.02</span>)],
773773
_phantom: std::marker::PhantomData::&lt;Example&gt;,

doc/src/wgpu_examples/ray_traced_triangle/mod.rs.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,8 @@
443443
<a href="#442" id="442">442</a>
444444
<a href="#443" id="443">443</a>
445445
<a href="#444" id="444">444</a>
446-
<a href="#445" id="445">445</a></pre></div><pre class="rust"><code><span class="kw">use </span>glam::{Mat4, Vec3};
446+
<a href="#445" id="445">445</a>
447+
<a href="#446" id="446">446</a></pre></div><pre class="rust"><code><span class="kw">use </span>glam::{Mat4, Vec3};
447448
<span class="kw">use </span>std::mem;
448449
<span class="kw">use </span>std::time::Instant;
449450
<span class="kw">use </span>wgpu::util::{BufferInitDescriptor, DeviceExt};
@@ -884,6 +885,7 @@
884885
failures: Vec::new(),
885886
required_downlevel_caps:
886887
&lt;Example <span class="kw">as </span><span class="kw">crate</span>::framework::Example&gt;::required_downlevel_capabilities(),
888+
..Default::default()
887889
},
888890
comparisons: <span class="kw-2">&amp;</span>[wgpu_test::ComparisonType::Mean(<span class="number">0.02</span>)],
889891
_phantom: std::marker::PhantomData::&lt;Example&gt;,

doc/src/wgpu_test/init.rs.html

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,14 @@
195195
<a href="#194" id="194">194</a>
196196
<a href="#195" id="195">195</a>
197197
<a href="#196" id="196">196</a>
198-
<a href="#197" id="197">197</a></pre></div><pre class="rust"><code><span class="kw">use </span>wgpu::{Adapter, Backends, Device, Features, Instance, Limits, Queue};
198+
<a href="#197" id="197">197</a>
199+
<a href="#198" id="198">198</a>
200+
<a href="#199" id="199">199</a>
201+
<a href="#200" id="200">200</a>
202+
<a href="#201" id="201">201</a>
203+
<a href="#202" id="202">202</a></pre></div><pre class="rust"><code><span class="kw">use </span>wgpu::{Adapter, Backends, Device, Features, Instance, Limits, Queue};
199204

200-
<span class="kw">use </span><span class="kw">crate</span>::report::AdapterReport;
205+
<span class="kw">use crate</span>::{report::AdapterReport, TestParameters};
201206

202207
<span class="doccomment">/// Initialize the logger for the test runner.
203208
</span><span class="kw">pub fn </span>init_logger() {
@@ -209,7 +214,7 @@
209214
}
210215

211216
<span class="doccomment">/// Initialize a wgpu instance with the options from the environment.
212-
</span><span class="kw">pub fn </span>initialize_instance(backends: wgpu::Backends, force_fxc: bool) -&gt; Instance {
217+
</span><span class="kw">pub fn </span>initialize_instance(backends: wgpu::Backends, params: <span class="kw-2">&amp;</span>TestParameters) -&gt; Instance {
213218
<span class="comment">// We ignore `WGPU_BACKEND` for now, merely using test filtering to only run a single backend's tests.
214219
//
215220
// We can potentially work support back into the test runner in the future, but as the adapters are matched up
@@ -227,14 +232,19 @@
227232
};
228233
<span class="comment">// Some tests need to be able to force demote to FXC, to specifically test workarounds for FXC
229234
// behavior.
230-
</span><span class="kw">let </span>dx12_shader_compiler = <span class="kw">if </span>force_fxc {
235+
</span><span class="kw">let </span>dx12_shader_compiler = <span class="kw">if </span>params.force_fxc {
231236
wgpu::Dx12Compiler::Fxc
232237
} <span class="kw">else </span>{
233238
wgpu::Dx12Compiler::from_env().unwrap_or(wgpu::Dx12Compiler::StaticDxc)
234239
};
240+
<span class="comment">// The defaults for debugging, overridden by the environment, overridden by the test parameters.
241+
</span><span class="kw">let </span>flags = wgpu::InstanceFlags::debugging()
242+
.with_env()
243+
.union(params.required_instance_flags);
244+
235245
Instance::new(<span class="kw-2">&amp;</span>wgpu::InstanceDescriptor {
236246
backends,
237-
flags: wgpu::InstanceFlags::debugging().with_env(),
247+
flags,
238248
backend_options: wgpu::BackendOptions {
239249
dx12: wgpu::Dx12BackendOptions {
240250
shader_compiler: dx12_shader_compiler,
@@ -262,13 +272,13 @@
262272
<span class="doccomment">/// Initialize a wgpu adapter, using the given adapter report to match the adapter.
263273
</span><span class="kw">pub async fn </span>initialize_adapter(
264274
adapter_report: <span class="prelude-ty">Option</span>&lt;<span class="kw-2">&amp;</span>AdapterReport&gt;,
265-
force_fxc: bool,
275+
params: <span class="kw-2">&amp;</span>TestParameters,
266276
) -&gt; (Instance, Adapter, <span class="prelude-ty">Option</span>&lt;SurfaceGuard&gt;) {
267277
<span class="kw">let </span>backends = adapter_report
268278
.map(|report| Backends::from(report.info.backend))
269279
.unwrap_or_default();
270280

271-
<span class="kw">let </span>instance = initialize_instance(backends, force_fxc);
281+
<span class="kw">let </span>instance = initialize_instance(backends, params);
272282
<span class="attr">#[allow(unused_variables)]
273283
</span><span class="kw">let </span>surface: <span class="prelude-ty">Option</span>&lt;wgpu::Surface&gt;;
274284
<span class="kw">let </span>surface_guard: <span class="prelude-ty">Option</span>&lt;SurfaceGuard&gt;;

doc/src/wgpu_test/params.rs.html

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,17 @@
180180
<a href="#179" id="179">179</a>
181181
<a href="#180" id="180">180</a>
182182
<a href="#181" id="181">181</a>
183-
<a href="#182" id="182">182</a></pre></div><pre class="rust"><code><span class="kw">use </span>arrayvec::ArrayVec;
184-
<span class="kw">use </span>wgpu::{DownlevelCapabilities, DownlevelFlags, Features, Limits};
183+
<a href="#182" id="182">182</a>
184+
<a href="#183" id="183">183</a>
185+
<a href="#184" id="184">184</a>
186+
<a href="#185" id="185">185</a>
187+
<a href="#186" id="186">186</a>
188+
<a href="#187" id="187">187</a>
189+
<a href="#188" id="188">188</a>
190+
<a href="#189" id="189">189</a>
191+
<a href="#190" id="190">190</a>
192+
<a href="#191" id="191">191</a></pre></div><pre class="rust"><code><span class="kw">use </span>arrayvec::ArrayVec;
193+
<span class="kw">use </span>wgpu::{DownlevelCapabilities, DownlevelFlags, Features, InstanceFlags, Limits};
185194

186195
<span class="kw">use crate</span>::{
187196
report::AdapterReport, FailureApplicationReasons, FailureBehavior, FailureCase,
@@ -201,6 +210,8 @@
201210
<span class="kw">pub </span>required_downlevel_caps: DownlevelCapabilities,
202211
<span class="kw">pub </span>required_limits: Limits,
203212

213+
<span class="kw">pub </span>required_instance_flags: InstanceFlags,
214+
204215
<span class="doccomment">/// On Dx12, specifically test against the Fxc compiler.
205216
///
206217
/// For testing workarounds to Fxc bugs.
@@ -219,6 +230,7 @@
219230
required_features: Features::empty(),
220231
required_downlevel_caps: LOWEST_DOWNLEVEL_PROPERTIES,
221232
required_limits: Limits::downlevel_webgl2_defaults(),
233+
required_instance_flags: InstanceFlags::empty(),
222234
force_fxc: <span class="bool-val">false</span>,
223235
skips: Vec::new(),
224236
failures: Vec::new(),
@@ -251,6 +263,12 @@
251263
<span class="self">self
252264
</span>}
253265

266+
<span class="doccomment">/// Sets the instance flags that the test requires.
267+
</span><span class="kw">pub fn </span>instance_flags(<span class="kw-2">mut </span><span class="self">self</span>, instance_flags: InstanceFlags) -&gt; <span class="self">Self </span>{
268+
<span class="self">self</span>.required_instance_flags |= instance_flags;
269+
<span class="self">self
270+
</span>}
271+
254272
<span class="kw">pub fn </span>force_fxc(<span class="kw-2">mut </span><span class="self">self</span>, force_fxc: bool) -&gt; <span class="self">Self </span>{
255273
<span class="self">self</span>.force_fxc = force_fxc;
256274
<span class="self">self

0 commit comments

Comments
 (0)