Skip to content

Commit 592dbd2

Browse files
committed
Deploying to master from @ gfx-rs/wgpu@8cdbcc1 🚀
1 parent 6de1642 commit 592dbd2

File tree

1,352 files changed

+5587
-5286
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,352 files changed

+5587
-5286
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: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1105,7 +1105,27 @@
11051105
<a href="#1104" id="1104">1104</a>
11061106
<a href="#1105" id="1105">1105</a>
11071107
<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 </span>alloc::{
1108+
<a href="#1107" id="1107">1107</a>
1109+
<a href="#1108" id="1108">1108</a>
1110+
<a href="#1109" id="1109">1109</a>
1111+
<a href="#1110" id="1110">1110</a>
1112+
<a href="#1111" id="1111">1111</a>
1113+
<a href="#1112" id="1112">1112</a>
1114+
<a href="#1113" id="1113">1113</a>
1115+
<a href="#1114" id="1114">1114</a>
1116+
<a href="#1115" id="1115">1115</a>
1117+
<a href="#1116" id="1116">1116</a>
1118+
<a href="#1117" id="1117">1117</a>
1119+
<a href="#1118" id="1118">1118</a>
1120+
<a href="#1119" id="1119">1119</a>
1121+
<a href="#1120" id="1120">1120</a>
1122+
<a href="#1121" id="1121">1121</a>
1123+
<a href="#1122" id="1122">1122</a>
1124+
<a href="#1123" id="1123">1123</a>
1125+
<a href="#1124" id="1124">1124</a>
1126+
<a href="#1125" id="1125">1125</a>
1127+
<a href="#1126" id="1126">1126</a>
1128+
<a href="#1127" id="1127">1127</a></pre></div><pre class="rust"><code><span class="kw">use </span>alloc::{
11091129
borrow::{Cow, ToOwned},
11101130
boxed::Box,
11111131
string::String,
@@ -1280,6 +1300,13 @@
12801300
},
12811301
<span class="attr">#[error(<span class="string">"Storage texture bindings must have a single mip level, but given a view with mip_level_count = {mip_level_count:?} at binding {binding}"</span>)]
12821302
</span>InvalidStorageTextureMipLevelCount { binding: u32, mip_level_count: u32 },
1303+
<span class="attr">#[error(<span class="string">"External texture bindings must have a single mip level, but given a view with mip_level_count = {mip_level_count:?} at binding {binding}"</span>)]
1304+
</span>InvalidExternalTextureMipLevelCount { binding: u32, mip_level_count: u32 },
1305+
<span class="attr">#[error(<span class="string">"External texture bindings must have a format of `rgba8unorm`, `bgra8unorm`, or `rgba16float, but given a view with format = {format:?} at binding {binding}"</span>)]
1306+
</span>InvalidExternalTextureFormat {
1307+
binding: u32,
1308+
format: wgt::TextureFormat,
1309+
},
12831310
<span class="attr">#[error(<span class="string">"Sampler binding {binding} expects comparison = {layout_cmp}, but given a sampler with comparison = {sampler_cmp}"</span>)]
12841311
</span>WrongSamplerComparison {
12851312
binding: u32,
@@ -1489,6 +1516,19 @@
14891516
wgt::BindingType::AccelerationStructure { .. } =&gt; {
14901517
<span class="self">self</span>.acceleration_structures.add(binding.visibility, count);
14911518
}
1519+
wgt::BindingType::ExternalTexture =&gt; {
1520+
<span class="comment">// https://www.w3.org/TR/webgpu/#gpuexternaltexture
1521+
// In order to account for many possible representations,
1522+
// the binding conservatively uses the following, for each
1523+
// external texture:
1524+
// * Three sampled textures for up to 3 planes
1525+
// * One additional sampled texture for a 3D LUT
1526+
// * One sampler to sample the LUT
1527+
// * One uniform buffer for metadata
1528+
</span><span class="self">self</span>.sampled_textures.add(binding.visibility, count * <span class="number">4</span>);
1529+
<span class="self">self</span>.samplers.add(binding.visibility, count);
1530+
<span class="self">self</span>.uniform_buffers.add(binding.visibility, count);
1531+
}
14921532
}
14931533
}
14941534
}

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

Lines changed: 87 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3941,7 +3941,50 @@
39413941
<a href="#3940" id="3940">3940</a>
39423942
<a href="#3941" id="3941">3941</a>
39433943
<a href="#3942" id="3942">3942</a>
3944-
<a href="#3943" id="3943">3943</a></pre></div><pre class="rust"><code><span class="kw">use </span>alloc::{
3944+
<a href="#3943" id="3943">3943</a>
3945+
<a href="#3944" id="3944">3944</a>
3946+
<a href="#3945" id="3945">3945</a>
3947+
<a href="#3946" id="3946">3946</a>
3948+
<a href="#3947" id="3947">3947</a>
3949+
<a href="#3948" id="3948">3948</a>
3950+
<a href="#3949" id="3949">3949</a>
3951+
<a href="#3950" id="3950">3950</a>
3952+
<a href="#3951" id="3951">3951</a>
3953+
<a href="#3952" id="3952">3952</a>
3954+
<a href="#3953" id="3953">3953</a>
3955+
<a href="#3954" id="3954">3954</a>
3956+
<a href="#3955" id="3955">3955</a>
3957+
<a href="#3956" id="3956">3956</a>
3958+
<a href="#3957" id="3957">3957</a>
3959+
<a href="#3958" id="3958">3958</a>
3960+
<a href="#3959" id="3959">3959</a>
3961+
<a href="#3960" id="3960">3960</a>
3962+
<a href="#3961" id="3961">3961</a>
3963+
<a href="#3962" id="3962">3962</a>
3964+
<a href="#3963" id="3963">3963</a>
3965+
<a href="#3964" id="3964">3964</a>
3966+
<a href="#3965" id="3965">3965</a>
3967+
<a href="#3966" id="3966">3966</a>
3968+
<a href="#3967" id="3967">3967</a>
3969+
<a href="#3968" id="3968">3968</a>
3970+
<a href="#3969" id="3969">3969</a>
3971+
<a href="#3970" id="3970">3970</a>
3972+
<a href="#3971" id="3971">3971</a>
3973+
<a href="#3972" id="3972">3972</a>
3974+
<a href="#3973" id="3973">3973</a>
3975+
<a href="#3974" id="3974">3974</a>
3976+
<a href="#3975" id="3975">3975</a>
3977+
<a href="#3976" id="3976">3976</a>
3978+
<a href="#3977" id="3977">3977</a>
3979+
<a href="#3978" id="3978">3978</a>
3980+
<a href="#3979" id="3979">3979</a>
3981+
<a href="#3980" id="3980">3980</a>
3982+
<a href="#3981" id="3981">3981</a>
3983+
<a href="#3982" id="3982">3982</a>
3984+
<a href="#3983" id="3983">3983</a>
3985+
<a href="#3984" id="3984">3984</a>
3986+
<a href="#3985" id="3985">3985</a>
3987+
<a href="#3986" id="3986">3986</a></pre></div><pre class="rust"><code><span class="kw">use </span>alloc::{
39453988
borrow::Cow,
39463989
boxed::Box,
39473990
string::{String, ToString <span class="kw">as _</span>},
@@ -5954,6 +5997,14 @@
59545997
)
59555998
}
59565999
Bt::AccelerationStructure { .. } =&gt; (<span class="prelude-val">None</span>, WritableStorage::No),
6000+
Bt::ExternalTexture =&gt; {
6001+
<span class="self">self</span>.require_features(wgt::Features::EXTERNAL_TEXTURE)
6002+
.map_err(|e| binding_model::CreateBindGroupLayoutError::Entry {
6003+
binding: entry.binding,
6004+
error: e.into(),
6005+
})<span class="question-mark">?</span>;
6006+
(<span class="prelude-val">None</span>, WritableStorage::No)
6007+
}
59576008
};
59586009

59596010
<span class="comment">// Validate the count parameter
@@ -6704,6 +6755,41 @@
67046755
view.check_usage(wgt::TextureUsages::STORAGE_BINDING)<span class="question-mark">?</span>;
67056756
<span class="prelude-val">Ok</span>(internal_use)
67066757
}
6758+
wgt::BindingType::ExternalTexture =&gt; {
6759+
<span class="kw">if </span>view.desc.dimension != TextureViewDimension::D2 {
6760+
<span class="kw">return </span><span class="prelude-val">Err</span>(Error::InvalidTextureDimension {
6761+
binding,
6762+
layout_dimension: TextureViewDimension::D2,
6763+
view_dimension: view.desc.dimension,
6764+
});
6765+
}
6766+
<span class="kw">let </span>mip_level_count = view.selector.mips.end - view.selector.mips.start;
6767+
<span class="kw">if </span>mip_level_count != <span class="number">1 </span>{
6768+
<span class="kw">return </span><span class="prelude-val">Err</span>(Error::InvalidExternalTextureMipLevelCount {
6769+
binding,
6770+
mip_level_count,
6771+
});
6772+
}
6773+
<span class="kw">if </span>view.desc.format != TextureFormat::Rgba8Unorm
6774+
&amp;&amp; view.desc.format != TextureFormat::Bgra8Unorm
6775+
&amp;&amp; view.desc.format != TextureFormat::Rgba16Float
6776+
{
6777+
<span class="kw">return </span><span class="prelude-val">Err</span>(Error::InvalidExternalTextureFormat {
6778+
binding,
6779+
format: view.desc.format,
6780+
});
6781+
}
6782+
<span class="kw">if </span>view.samples != <span class="number">1 </span>{
6783+
<span class="kw">return </span><span class="prelude-val">Err</span>(Error::InvalidTextureMultisample {
6784+
binding,
6785+
layout_multisampled: <span class="bool-val">false</span>,
6786+
view_samples: view.samples,
6787+
});
6788+
}
6789+
6790+
view.check_usage(wgt::TextureUsages::TEXTURE_BINDING)<span class="question-mark">?</span>;
6791+
<span class="prelude-val">Ok</span>(wgt::TextureUses::RESOURCE)
6792+
}
67076793
<span class="kw">_ </span>=&gt; <span class="prelude-val">Err</span>(Error::WrongBindingType {
67086794
binding,
67096795
actual: decl.ty,

doc/src/wgpu_core/validation.rs.html

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1336,7 +1336,13 @@
13361336
<a href="#1335" id="1335">1335</a>
13371337
<a href="#1336" id="1336">1336</a>
13381338
<a href="#1337" id="1337">1337</a>
1339-
<a href="#1338" id="1338">1338</a></pre></div><pre class="rust"><code><span class="kw">use </span>alloc::{
1339+
<a href="#1338" id="1338">1338</a>
1340+
<a href="#1339" id="1339">1339</a>
1341+
<a href="#1340" id="1340">1340</a>
1342+
<a href="#1341" id="1341">1341</a>
1343+
<a href="#1342" id="1342">1342</a>
1344+
<a href="#1343" id="1343">1343</a>
1345+
<a href="#1344" id="1344">1344</a></pre></div><pre class="rust"><code><span class="kw">use </span>alloc::{
13401346
boxed::Box,
13411347
string::{String, ToString <span class="kw">as _</span>},
13421348
vec::Vec,
@@ -1374,6 +1380,7 @@
13741380
Texture,
13751381
Sampler,
13761382
AccelerationStructure,
1383+
ExternalTexture,
13771384
}
13781385

13791386
<span class="kw">impl </span>From&lt;<span class="kw-2">&amp;</span>ResourceType&gt; <span class="kw">for </span>BindingTypeName {
@@ -1395,6 +1402,7 @@
13951402
BindingType::StorageTexture { .. } =&gt; BindingTypeName::Texture,
13961403
BindingType::Sampler { .. } =&gt; BindingTypeName::Sampler,
13971404
BindingType::AccelerationStructure { .. } =&gt; BindingTypeName::AccelerationStructure,
1405+
BindingType::ExternalTexture =&gt; BindingTypeName::ExternalTexture,
13981406
}
13991407
}
14001408
}
@@ -1804,6 +1812,7 @@
18041812
<span class="kw">let </span>view_dimension = <span class="kw">match </span>entry.ty {
18051813
BindingType::Texture { view_dimension, .. }
18061814
| BindingType::StorageTexture { view_dimension, .. } =&gt; view_dimension,
1815+
BindingType::ExternalTexture =&gt; wgt::TextureViewDimension::D2,
18071816
<span class="kw">_ </span>=&gt; {
18081817
<span class="kw">return </span><span class="prelude-val">Err</span>(BindingError::WrongTextureViewDimension {
18091818
dim,
@@ -2485,6 +2494,9 @@
24852494
);
24862495
<span class="kw">let </span>texture_sample_type = <span class="kw">match </span>texture_layout.ty {
24872496
BindingType::Texture { sample_type, .. } =&gt; sample_type,
2497+
BindingType::ExternalTexture =&gt; {
2498+
wgt::TextureSampleType::Float { filterable: <span class="bool-val">true </span>}
2499+
}
24882500
<span class="kw">_ </span>=&gt; <span class="macro">unreachable!</span>(),
24892501
};
24902502

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1643,7 +1643,9 @@
16431643
<a href="#1642" id="1642">1642</a>
16441644
<a href="#1643" id="1643">1643</a>
16451645
<a href="#1644" id="1644">1644</a>
1646-
<a href="#1645" id="1645">1645</a></pre></div><pre class="rust"><code><span class="kw">use </span>alloc::{
1646+
<a href="#1645" id="1645">1645</a>
1647+
<a href="#1646" id="1646">1646</a>
1648+
<a href="#1647" id="1647">1647</a></pre></div><pre class="rust"><code><span class="kw">use </span>alloc::{
16471649
borrow::ToOwned, format, string::String, string::ToString <span class="kw">as _</span>, sync::Arc, vec, vec::Vec,
16481650
};
16491651
<span class="kw">use </span>core::{cmp::max, convert::TryInto, num::NonZeroU32, ptr, sync::atomic::Ordering};
@@ -2848,6 +2850,7 @@
28482850
..
28492851
} =&gt; <span class="kw-2">&amp;mut </span>num_storage_buffers,
28502852
wgt::BindingType::AccelerationStructure { .. } =&gt; <span class="macro">unimplemented!</span>(),
2853+
wgt::BindingType::ExternalTexture =&gt; <span class="macro">unimplemented!</span>(),
28512854
};
28522855

28532856
binding_to_slot[entry.binding <span class="kw">as </span>usize] = <span class="kw-2">*</span>counter;
@@ -2958,6 +2961,7 @@
29582961
})
29592962
}
29602963
wgt::BindingType::AccelerationStructure { .. } =&gt; <span class="macro">unimplemented!</span>(),
2964+
wgt::BindingType::ExternalTexture =&gt; <span class="macro">unimplemented!</span>(),
29612965
};
29622966
contents.push(binding);
29632967
}

doc/src/wgpu_hal/vulkan/conv.rs.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1006,7 +1006,8 @@
10061006
<a href="#1005" id="1005">1005</a>
10071007
<a href="#1006" id="1006">1006</a>
10081008
<a href="#1007" id="1007">1007</a>
1009-
<a href="#1008" id="1008">1008</a></pre></div><pre class="rust"><code><span class="kw">use </span>alloc::vec::Vec;
1009+
<a href="#1008" id="1008">1008</a>
1010+
<a href="#1009" id="1009">1009</a></pre></div><pre class="rust"><code><span class="kw">use </span>alloc::vec::Vec;
10101011

10111012
<span class="kw">use </span>ash::vk;
10121013

@@ -1772,6 +1773,7 @@
17721773
wgt::BindingType::AccelerationStructure { .. } =&gt; {
17731774
vk::DescriptorType::ACCELERATION_STRUCTURE_KHR
17741775
}
1776+
wgt::BindingType::ExternalTexture =&gt; <span class="macro">unimplemented!</span>(),
17751777
}
17761778
}
17771779

doc/src/wgpu_hal/vulkan/device.rs.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3102,7 +3102,8 @@
31023102
<a href="#3101" id="3101">3101</a>
31033103
<a href="#3102" id="3102">3102</a>
31043104
<a href="#3103" id="3103">3103</a>
3105-
<a href="#3104" id="3104">3104</a></pre></div><pre class="rust"><code><span class="kw">use </span>alloc::{
3105+
<a href="#3104" id="3104">3104</a>
3106+
<a href="#3105" id="3105">3105</a></pre></div><pre class="rust"><code><span class="kw">use </span>alloc::{
31063107
borrow::{Cow, ToOwned <span class="kw">as _</span>},
31073108
collections::BTreeMap,
31083109
ffi::CString,
@@ -4597,6 +4598,7 @@
45974598
wgt::BindingType::AccelerationStructure { .. } =&gt; {
45984599
desc_count.acceleration_structure += count;
45994600
}
4601+
wgt::BindingType::ExternalTexture =&gt; <span class="macro">unimplemented!</span>(),
46004602
}
46014603
}
46024604

0 commit comments

Comments
 (0)