Skip to content

Commit 2ebeddc

Browse files
committed
Deploying to master from @ gfx-rs/wgpu@194d4b1 🚀
1 parent b7f2365 commit 2ebeddc

File tree

1,268 files changed

+6356
-6188
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,268 files changed

+6356
-6188
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/wgpu-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/search.desc/wgpu/wgpu-desc-1-.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/search.desc/wgpu_types/wgpu_types-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_core/binding_model.rs.html

Lines changed: 98 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,39 @@
10731073
<a href="#1072" id="1072">1072</a>
10741074
<a href="#1073" id="1073">1073</a>
10751075
<a href="#1074" id="1074">1074</a>
1076-
<a href="#1075" id="1075">1075</a></pre></div><pre class="rust"><code><span class="kw">use crate</span>::{
1076+
<a href="#1075" id="1075">1075</a>
1077+
<a href="#1076" id="1076">1076</a>
1078+
<a href="#1077" id="1077">1077</a>
1079+
<a href="#1078" id="1078">1078</a>
1080+
<a href="#1079" id="1079">1079</a>
1081+
<a href="#1080" id="1080">1080</a>
1082+
<a href="#1081" id="1081">1081</a>
1083+
<a href="#1082" id="1082">1082</a>
1084+
<a href="#1083" id="1083">1083</a>
1085+
<a href="#1084" id="1084">1084</a>
1086+
<a href="#1085" id="1085">1085</a>
1087+
<a href="#1086" id="1086">1086</a>
1088+
<a href="#1087" id="1087">1087</a>
1089+
<a href="#1088" id="1088">1088</a>
1090+
<a href="#1089" id="1089">1089</a>
1091+
<a href="#1090" id="1090">1090</a>
1092+
<a href="#1091" id="1091">1091</a>
1093+
<a href="#1092" id="1092">1092</a>
1094+
<a href="#1093" id="1093">1093</a>
1095+
<a href="#1094" id="1094">1094</a>
1096+
<a href="#1095" id="1095">1095</a>
1097+
<a href="#1096" id="1096">1096</a>
1098+
<a href="#1097" id="1097">1097</a>
1099+
<a href="#1098" id="1098">1098</a>
1100+
<a href="#1099" id="1099">1099</a>
1101+
<a href="#1100" id="1100">1100</a>
1102+
<a href="#1101" id="1101">1101</a>
1103+
<a href="#1102" id="1102">1102</a>
1104+
<a href="#1103" id="1103">1103</a>
1105+
<a href="#1104" id="1104">1104</a>
1106+
<a href="#1105" id="1105">1105</a>
1107+
<a href="#1106" id="1106">1106</a>
1108+
<a href="#1107" id="1107">1107</a></pre></div><pre class="rust"><code><span class="kw">use crate</span>::{
10771109
device::{
10781110
bgl, Device, DeviceError, MissingDownlevelFlags, MissingFeatures, SHADER_STAGE_COUNT,
10791111
},
@@ -1304,6 +1336,8 @@
13041336
StorageBuffers,
13051337
StorageTextures,
13061338
UniformBuffers,
1339+
BindingArrayElements,
1340+
BindingArraySamplerElements,
13071341
}
13081342

13091343
<span class="kw">impl </span>BindingTypeMaxCountErrorKind {
@@ -1324,6 +1358,12 @@
13241358
<span class="string">"max_storage_textures_per_shader_stage"
13251359
</span>}
13261360
BindingTypeMaxCountErrorKind::UniformBuffers =&gt; <span class="string">"max_uniform_buffers_per_shader_stage"</span>,
1361+
BindingTypeMaxCountErrorKind::BindingArrayElements =&gt; {
1362+
<span class="string">"max_binding_array_elements_per_shader_stage"
1363+
</span>}
1364+
BindingTypeMaxCountErrorKind::BindingArraySamplerElements =&gt; {
1365+
<span class="string">"max_binding_array_elements_per_shader_stage"
1366+
</span>}
13271367
}
13281368
}
13291369
}
@@ -1398,49 +1438,59 @@
13981438
storage_textures: PerStageBindingTypeCounter,
13991439
uniform_buffers: PerStageBindingTypeCounter,
14001440
acceleration_structures: PerStageBindingTypeCounter,
1441+
binding_array_elements: PerStageBindingTypeCounter,
1442+
binding_array_sampler_elements: PerStageBindingTypeCounter,
14011443
has_bindless_array: bool,
14021444
}
14031445

14041446
<span class="kw">impl </span>BindingTypeMaxCountValidator {
14051447
<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">fn </span>add_binding(<span class="kw-2">&amp;mut </span><span class="self">self</span>, binding: <span class="kw-2">&amp;</span>wgt::BindGroupLayoutEntry) {
14061448
<span class="kw">let </span>count = binding.count.map_or(<span class="number">1</span>, |count| count.get());
1407-
<span class="kw">match </span>binding.ty {
1408-
wgt::BindingType::Buffer {
1409-
ty: wgt::BufferBindingType::Uniform,
1410-
has_dynamic_offset,
1411-
..
1412-
} =&gt; {
1413-
<span class="self">self</span>.uniform_buffers.add(binding.visibility, count);
1414-
<span class="kw">if </span>has_dynamic_offset {
1415-
<span class="self">self</span>.dynamic_uniform_buffers += count;
1416-
}
1449+
1450+
<span class="kw">if </span>binding.count.is_some() {
1451+
<span class="self">self</span>.binding_array_elements.add(binding.visibility, count);
1452+
<span class="self">self</span>.has_bindless_array = <span class="bool-val">true</span>;
1453+
1454+
<span class="kw">if let </span>wgt::BindingType::Sampler(<span class="kw">_</span>) = binding.ty {
1455+
<span class="self">self</span>.binding_array_sampler_elements
1456+
.add(binding.visibility, count);
14171457
}
1418-
wgt::BindingType::Buffer {
1419-
ty: wgt::BufferBindingType::Storage { .. },
1420-
has_dynamic_offset,
1421-
..
1422-
} =&gt; {
1423-
<span class="self">self</span>.storage_buffers.add(binding.visibility, count);
1424-
<span class="kw">if </span>has_dynamic_offset {
1425-
<span class="self">self</span>.dynamic_storage_buffers += count;
1458+
} <span class="kw">else </span>{
1459+
<span class="kw">match </span>binding.ty {
1460+
wgt::BindingType::Buffer {
1461+
ty: wgt::BufferBindingType::Uniform,
1462+
has_dynamic_offset,
1463+
..
1464+
} =&gt; {
1465+
<span class="self">self</span>.uniform_buffers.add(binding.visibility, count);
1466+
<span class="kw">if </span>has_dynamic_offset {
1467+
<span class="self">self</span>.dynamic_uniform_buffers += count;
1468+
}
1469+
}
1470+
wgt::BindingType::Buffer {
1471+
ty: wgt::BufferBindingType::Storage { .. },
1472+
has_dynamic_offset,
1473+
..
1474+
} =&gt; {
1475+
<span class="self">self</span>.storage_buffers.add(binding.visibility, count);
1476+
<span class="kw">if </span>has_dynamic_offset {
1477+
<span class="self">self</span>.dynamic_storage_buffers += count;
1478+
}
1479+
}
1480+
wgt::BindingType::Sampler { .. } =&gt; {
1481+
<span class="self">self</span>.samplers.add(binding.visibility, count);
1482+
}
1483+
wgt::BindingType::Texture { .. } =&gt; {
1484+
<span class="self">self</span>.sampled_textures.add(binding.visibility, count);
1485+
}
1486+
wgt::BindingType::StorageTexture { .. } =&gt; {
1487+
<span class="self">self</span>.storage_textures.add(binding.visibility, count);
1488+
}
1489+
wgt::BindingType::AccelerationStructure =&gt; {
1490+
<span class="self">self</span>.acceleration_structures.add(binding.visibility, count);
14261491
}
1427-
}
1428-
wgt::BindingType::Sampler { .. } =&gt; {
1429-
<span class="self">self</span>.samplers.add(binding.visibility, count);
1430-
}
1431-
wgt::BindingType::Texture { .. } =&gt; {
1432-
<span class="self">self</span>.sampled_textures.add(binding.visibility, count);
1433-
}
1434-
wgt::BindingType::StorageTexture { .. } =&gt; {
1435-
<span class="self">self</span>.storage_textures.add(binding.visibility, count);
1436-
}
1437-
wgt::BindingType::AccelerationStructure =&gt; {
1438-
<span class="self">self</span>.acceleration_structures.add(binding.visibility, count);
14391492
}
14401493
}
1441-
<span class="kw">if </span>binding.count.is_some() {
1442-
<span class="self">self</span>.has_bindless_array = <span class="bool-val">true</span>;
1443-
}
14441494
}
14451495

14461496
<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">fn </span>merge(<span class="kw-2">&amp;mut </span><span class="self">self</span>, other: <span class="kw-2">&amp;</span><span class="self">Self</span>) {
@@ -1451,6 +1501,12 @@
14511501
<span class="self">self</span>.storage_buffers.merge(<span class="kw-2">&amp;</span>other.storage_buffers);
14521502
<span class="self">self</span>.storage_textures.merge(<span class="kw-2">&amp;</span>other.storage_textures);
14531503
<span class="self">self</span>.uniform_buffers.merge(<span class="kw-2">&amp;</span>other.uniform_buffers);
1504+
<span class="self">self</span>.acceleration_structures
1505+
.merge(<span class="kw-2">&amp;</span>other.acceleration_structures);
1506+
<span class="self">self</span>.binding_array_elements
1507+
.merge(<span class="kw-2">&amp;</span>other.binding_array_elements);
1508+
<span class="self">self</span>.binding_array_sampler_elements
1509+
.merge(<span class="kw-2">&amp;</span>other.binding_array_sampler_elements);
14541510
}
14551511

14561512
<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">fn </span>validate(<span class="kw-2">&amp;</span><span class="self">self</span>, limits: <span class="kw-2">&amp;</span>wgt::Limits) -&gt; <span class="prelude-ty">Result</span>&lt;(), BindingTypeMaxCountError&gt; {
@@ -1490,6 +1546,14 @@
14901546
limits.max_uniform_buffers_per_shader_stage,
14911547
BindingTypeMaxCountErrorKind::UniformBuffers,
14921548
)<span class="question-mark">?</span>;
1549+
<span class="self">self</span>.binding_array_elements.validate(
1550+
limits.max_binding_array_elements_per_shader_stage,
1551+
BindingTypeMaxCountErrorKind::BindingArrayElements,
1552+
)<span class="question-mark">?</span>;
1553+
<span class="self">self</span>.binding_array_sampler_elements.validate(
1554+
limits.max_binding_array_sampler_elements_per_shader_stage,
1555+
BindingTypeMaxCountErrorKind::BindingArraySamplerElements,
1556+
)<span class="question-mark">?</span>;
14931557
<span class="prelude-val">Ok</span>(())
14941558
}
14951559

doc/src/wgpu_core/device/resource.rs.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5780,9 +5780,6 @@
57805780
entries: <span class="kw-2">&amp;</span>hal_bindings,
57815781
};
57825782

5783-
<span class="kw">let </span>raw = <span class="kw">unsafe </span>{ <span class="self">self</span>.raw().create_bind_group_layout(<span class="kw-2">&amp;</span>hal_desc) }
5784-
.map_err(|e| <span class="self">self</span>.handle_hal_error(e))<span class="question-mark">?</span>;
5785-
57865783
<span class="kw">let </span><span class="kw-2">mut </span>count_validator = binding_model::BindingTypeMaxCountValidator::default();
57875784
<span class="kw">for </span>entry <span class="kw">in </span>entry_map.values() {
57885785
count_validator.add_binding(entry);
@@ -5796,6 +5793,9 @@
57965793
<span class="comment">// Validate that binding arrays don't conflict with dynamic offsets.
57975794
</span>count_validator.validate_binding_arrays()<span class="question-mark">?</span>;
57985795

5796+
<span class="kw">let </span>raw = <span class="kw">unsafe </span>{ <span class="self">self</span>.raw().create_bind_group_layout(<span class="kw-2">&amp;</span>hal_desc) }
5797+
.map_err(|e| <span class="self">self</span>.handle_hal_error(e))<span class="question-mark">?</span>;
5798+
57995799
<span class="kw">let </span>bgl = BindGroupLayout {
58005800
raw: ManuallyDrop::new(raw),
58015801
device: <span class="self">self</span>.clone(),

doc/src/wgpu_examples/framework.rs.html

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,11 @@
607607
<a href="#606" id="606">606</a>
608608
<a href="#607" id="607">607</a>
609609
<a href="#608" id="608">608</a>
610-
<a href="#609" id="609">609</a></pre></div><pre class="rust"><code><span class="kw">use </span>std::sync::Arc;
610+
<a href="#609" id="609">609</a>
611+
<a href="#610" id="610">610</a>
612+
<a href="#611" id="611">611</a>
613+
<a href="#612" id="612">612</a>
614+
<a href="#613" id="613">613</a></pre></div><pre class="rust"><code><span class="kw">use </span>std::sync::Arc;
611615

612616
<span class="kw">use </span>wgpu::{Instance, Surface};
613617
<span class="kw">use </span>winit::{
@@ -1121,7 +1125,11 @@
11211125

11221126
<span class="kw">let </span>features = E::required_features() | params.optional_features;
11231127

1124-
params.base_test_parameters.clone().features(features)
1128+
params
1129+
.base_test_parameters
1130+
.clone()
1131+
.features(features)
1132+
.limits(E::required_limits())
11251133
})
11261134
.run_async(<span class="kw">move </span>|ctx| <span class="kw">async move </span>{
11271135
<span class="kw">let </span>format = <span class="kw">if </span>E::SRGB {

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

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,14 @@
461461
<a href="#460" id="460">460</a>
462462
<a href="#461" id="461">461</a>
463463
<a href="#462" id="462">462</a>
464-
<a href="#463" id="463">463</a></pre></div><pre class="rust"><code><span class="kw">use </span>bytemuck::{Pod, Zeroable};
464+
<a href="#463" id="463">463</a>
465+
<a href="#464" id="464">464</a>
466+
<a href="#465" id="465">465</a>
467+
<a href="#466" id="466">466</a>
468+
<a href="#467" id="467">467</a>
469+
<a href="#468" id="468">468</a>
470+
<a href="#469" id="469">469</a>
471+
<a href="#470" id="470">470</a></pre></div><pre class="rust"><code><span class="kw">use </span>bytemuck::{Pod, Zeroable};
465472
<span class="kw">use </span>std::num::{NonZeroU32, NonZeroU64};
466473
<span class="kw">use </span>wgpu::util::DeviceExt;
467474

@@ -541,6 +548,13 @@
541548
<span class="kw">fn </span>required_features() -&gt; wgpu::Features {
542549
wgpu::Features::TEXTURE_BINDING_ARRAY
543550
}
551+
<span class="kw">fn </span>required_limits() -&gt; wgpu::Limits {
552+
wgpu::Limits {
553+
max_binding_array_elements_per_shader_stage: <span class="number">6</span>,
554+
max_binding_array_sampler_elements_per_shader_stage: <span class="number">2</span>,
555+
..wgpu::Limits::downlevel_defaults()
556+
}
557+
}
544558
<span class="kw">fn </span>init(
545559
config: <span class="kw-2">&amp;</span>wgpu::SurfaceConfiguration,
546560
_adapter: <span class="kw-2">&amp;</span>wgpu::Adapter,

doc/src/wgpu_hal/gles/adapter.rs.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1290,7 +1290,9 @@
12901290
<a href="#1289" id="1289">1289</a>
12911291
<a href="#1290" id="1290">1290</a>
12921292
<a href="#1291" id="1291">1291</a>
1293-
<a href="#1292" id="1292">1292</a></pre></div><pre class="rust"><code><span class="kw">use </span>glow::HasContext;
1293+
<a href="#1292" id="1292">1292</a>
1294+
<a href="#1293" id="1293">1293</a>
1295+
<a href="#1294" id="1294">1294</a></pre></div><pre class="rust"><code><span class="kw">use </span>glow::HasContext;
12941296
<span class="kw">use </span>parking_lot::Mutex;
12951297
<span class="kw">use </span>std::sync::{atomic::AtomicU8, Arc};
12961298
<span class="kw">use </span>wgt::AstcChannel;
@@ -1977,6 +1979,8 @@
19771979
max_storage_buffers_per_shader_stage,
19781980
max_storage_textures_per_shader_stage,
19791981
max_uniform_buffers_per_shader_stage,
1982+
max_binding_array_elements_per_shader_stage: <span class="number">0</span>,
1983+
max_binding_array_sampler_elements_per_shader_stage: <span class="number">0</span>,
19801984
max_uniform_buffer_binding_size: <span class="kw">unsafe </span>{
19811985
gl.get_parameter_i32(glow::MAX_UNIFORM_BLOCK_SIZE)
19821986
} <span class="kw">as </span>u32,

doc/src/wgpu_hal/noop/mod.rs.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,9 @@
440440
<a href="#439" id="439">439</a>
441441
<a href="#440" id="440">440</a>
442442
<a href="#441" id="441">441</a>
443-
<a href="#442" id="442">442</a></pre></div><pre class="rust"><code><span class="attr">#![allow(unused_variables)]
443+
<a href="#442" id="442">442</a>
444+
<a href="#443" id="443">443</a>
445+
<a href="#444" id="444">444</a></pre></div><pre class="rust"><code><span class="attr">#![allow(unused_variables)]
444446

445447
</span><span class="kw">use </span><span class="kw">crate</span>::TlasInstance;
446448
<span class="kw">use </span>core::ptr;
@@ -589,6 +591,8 @@
589591
max_storage_buffers_per_shader_stage: ALLOC_MAX_U32,
590592
max_storage_textures_per_shader_stage: ALLOC_MAX_U32,
591593
max_uniform_buffers_per_shader_stage: ALLOC_MAX_U32,
594+
max_binding_array_elements_per_shader_stage: ALLOC_MAX_U32,
595+
max_binding_array_sampler_elements_per_shader_stage: ALLOC_MAX_U32,
592596
max_uniform_buffer_binding_size: ALLOC_MAX_U32,
593597
max_storage_buffer_binding_size: ALLOC_MAX_U32,
594598
max_vertex_buffers: ALLOC_MAX_U32,

0 commit comments

Comments
 (0)