Skip to content

Commit 7845971

Browse files
committed
Deploying to master from @ gfx-rs/wgpu@4675393 🚀
1 parent 27ba6b0 commit 7845971

File tree

127 files changed

+858
-780
lines changed

Some content is hidden

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

127 files changed

+858
-780
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_core/wgpu_core-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/player/lib.rs.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@
757757
Action::GetSurfaceTexture { id, parent_id } => {
758758
<span class="self">self</span>.surface_get_current_texture(parent_id, <span class="prelude-val">Some</span>(id))
759759
.unwrap()
760-
.texture_id
760+
.texture
761761
.unwrap();
762762
}
763763
Action::CreateBindGroupLayout(id, desc) =&gt; {

doc/src/wgpu/backend/wgpu_core.rs.html

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3575,7 +3575,10 @@
35753575
<a href="#3574" id="3574">3574</a>
35763576
<a href="#3575" id="3575">3575</a>
35773577
<a href="#3576" id="3576">3576</a>
3578-
<a href="#3577" id="3577">3577</a></pre></div><pre class="rust"><code><span class="kw">use crate</span>::{
3578+
<a href="#3577" id="3577">3577</a>
3579+
<a href="#3578" id="3578">3578</a>
3580+
<a href="#3579" id="3579">3579</a>
3581+
<a href="#3580" id="3580">3580</a></pre></div><pre class="rust"><code><span class="kw">use crate</span>::{
35793582
api,
35803583
dispatch::{<span class="self">self</span>, BufferMappedRangeInterface, InterfaceTypes},
35813584
BindingResource, BufferBinding, BufferDescriptor, CompilationInfo, CompilationMessage,
@@ -4698,7 +4701,7 @@
46984701
</span><span class="kw">for </span>entry <span class="kw">in </span>desc.entries.iter() {
46994702
<span class="kw">if let </span>BindingResource::BufferArray(array) = entry.resource {
47004703
arrayed_buffer_bindings.extend(array.iter().map(|binding| bm::BufferBinding {
4701-
buffer_id: binding.buffer.inner.as_core().id,
4704+
buffer: binding.buffer.inner.as_core().id,
47024705
offset: binding.offset,
47034706
size: binding.size,
47044707
}));
@@ -4718,7 +4721,7 @@
47184721
offset,
47194722
size,
47204723
}) =&gt; bm::BindingResource::Buffer(bm::BufferBinding {
4721-
buffer_id: buffer.inner.as_core().id,
4724+
buffer: buffer.inner.as_core().id,
47224725
offset,
47234726
size,
47244727
}),
@@ -7061,7 +7064,10 @@
70617064
.into();
70627065

70637066
<span class="kw">match </span><span class="self">self</span>.context.<span class="number">0</span>.surface_get_current_texture(<span class="self">self</span>.id, <span class="prelude-val">None</span>) {
7064-
<span class="prelude-val">Ok</span>(wgc::present::SurfaceOutput { status, texture_id }) =&gt; {
7067+
<span class="prelude-val">Ok</span>(wgc::present::SurfaceOutput {
7068+
status,
7069+
texture: texture_id,
7070+
}) =&gt; {
70657071
<span class="kw">let </span>data = texture_id
70667072
.map(|id| CoreTexture {
70677073
context: <span class="self">self</span>.context.clone(),

doc/src/wgpu_core/binding_model.rs.html

Lines changed: 114 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,7 +1052,24 @@
10521052
<a href="#1051" id="1051">1051</a>
10531053
<a href="#1052" id="1052">1052</a>
10541054
<a href="#1053" id="1053">1053</a>
1055-
<a href="#1054" id="1054">1054</a></pre></div><pre class="rust"><code><span class="kw">use crate</span>::{
1055+
<a href="#1054" id="1054">1054</a>
1056+
<a href="#1055" id="1055">1055</a>
1057+
<a href="#1056" id="1056">1056</a>
1058+
<a href="#1057" id="1057">1057</a>
1059+
<a href="#1058" id="1058">1058</a>
1060+
<a href="#1059" id="1059">1059</a>
1061+
<a href="#1060" id="1060">1060</a>
1062+
<a href="#1061" id="1061">1061</a>
1063+
<a href="#1062" id="1062">1062</a>
1064+
<a href="#1063" id="1063">1063</a>
1065+
<a href="#1064" id="1064">1064</a>
1066+
<a href="#1065" id="1065">1065</a>
1067+
<a href="#1066" id="1066">1066</a>
1068+
<a href="#1067" id="1067">1067</a>
1069+
<a href="#1068" id="1068">1068</a>
1070+
<a href="#1069" id="1069">1069</a>
1071+
<a href="#1070" id="1070">1070</a>
1072+
<a href="#1071" id="1071">1071</a></pre></div><pre class="rust"><code><span class="kw">use crate</span>::{
10561073
device::{
10571074
bgl, Device, DeviceError, MissingDownlevelFlags, MissingFeatures, SHADER_STAGE_COUNT,
10581075
},
@@ -1493,50 +1510,73 @@
14931510
<span class="doccomment">/// Bindable resource and the slot to bind it to.
14941511
</span><span class="attr">#[derive(Clone, Debug)]
14951512
#[cfg_attr(feature = <span class="string">"serde"</span>, derive(Serialize, Deserialize))]
1496-
</span><span class="kw">pub struct </span>BindGroupEntry&lt;<span class="lifetime">'a</span>&gt; {
1513+
</span><span class="kw">pub struct </span>BindGroupEntry&lt;<span class="lifetime">'a</span>, B = BufferId, S = SamplerId, TV = TextureViewId, TLAS = TlasId&gt;
1514+
<span class="kw">where
1515+
</span>[BufferBinding&lt;B&gt;]: ToOwned,
1516+
[S]: ToOwned,
1517+
[TV]: ToOwned,
1518+
&lt;[BufferBinding&lt;B&gt;] <span class="kw">as </span>ToOwned&gt;::Owned: std::fmt::Debug,
1519+
&lt;[S] <span class="kw">as </span>ToOwned&gt;::Owned: std::fmt::Debug,
1520+
&lt;[TV] <span class="kw">as </span>ToOwned&gt;::Owned: std::fmt::Debug,
1521+
{
14971522
<span class="doccomment">/// Slot for which binding provides resource. Corresponds to an entry of the same
14981523
/// binding index in the [`BindGroupLayoutDescriptor`].
14991524
</span><span class="kw">pub </span>binding: u32,
1500-
<span class="doccomment">/// Resource to attach to the binding
1501-
</span><span class="kw">pub </span>resource: BindingResource&lt;<span class="lifetime">'a</span>&gt;,
1525+
<span class="attr">#[cfg_attr(
1526+
feature = <span class="string">"serde"</span>,
1527+
serde(bound(deserialize = <span class="string">"BindingResource&lt;'a, B, S, TV, TLAS&gt;: Deserialize&lt;'de&gt;"</span>))
1528+
)]
1529+
</span><span class="doccomment">/// Resource to attach to the binding
1530+
</span><span class="kw">pub </span>resource: BindingResource&lt;<span class="lifetime">'a</span>, B, S, TV, TLAS&gt;,
15021531
}
15031532

1504-
<span class="doccomment">/// Bindable resource and the slot to bind it to.
1505-
</span><span class="attr">#[derive(Clone, Debug)]
1506-
</span><span class="kw">pub struct </span>ResolvedBindGroupEntry&lt;<span class="lifetime">'a</span>&gt; {
1507-
<span class="doccomment">/// Slot for which binding provides resource. Corresponds to an entry of the same
1508-
/// binding index in the [`BindGroupLayoutDescriptor`].
1509-
</span><span class="kw">pub </span>binding: u32,
1510-
<span class="doccomment">/// Resource to attach to the binding
1511-
</span><span class="kw">pub </span>resource: ResolvedBindingResource&lt;<span class="lifetime">'a</span>&gt;,
1512-
}
1533+
<span class="kw">pub type </span>ResolvedBindGroupEntry&lt;<span class="lifetime">'a</span>&gt; =
1534+
BindGroupEntry&lt;<span class="lifetime">'a</span>, Arc&lt;Buffer&gt;, Arc&lt;Sampler&gt;, Arc&lt;TextureView&gt;, Arc&lt;Tlas&gt;&gt;;
15131535

15141536
<span class="doccomment">/// Describes a group of bindings and the resources to be bound.
15151537
</span><span class="attr">#[derive(Clone, Debug)]
15161538
#[cfg_attr(feature = <span class="string">"serde"</span>, derive(Serialize, Deserialize))]
1517-
</span><span class="kw">pub struct </span>BindGroupDescriptor&lt;<span class="lifetime">'a</span>&gt; {
1539+
</span><span class="kw">pub struct </span>BindGroupDescriptor&lt;
1540+
<span class="lifetime">'a</span>,
1541+
BGL = BindGroupLayoutId,
1542+
B = BufferId,
1543+
S = SamplerId,
1544+
TV = TextureViewId,
1545+
TLAS = TlasId,
1546+
&gt; <span class="kw">where
1547+
</span>[BufferBinding&lt;B&gt;]: ToOwned,
1548+
[S]: ToOwned,
1549+
[TV]: ToOwned,
1550+
&lt;[BufferBinding&lt;B&gt;] <span class="kw">as </span>ToOwned&gt;::Owned: std::fmt::Debug,
1551+
&lt;[S] <span class="kw">as </span>ToOwned&gt;::Owned: std::fmt::Debug,
1552+
&lt;[TV] <span class="kw">as </span>ToOwned&gt;::Owned: std::fmt::Debug,
1553+
[BindGroupEntry&lt;<span class="lifetime">'a</span>, B, S, TV, TLAS&gt;]: ToOwned,
1554+
&lt;[BindGroupEntry&lt;<span class="lifetime">'a</span>, B, S, TV, TLAS&gt;] <span class="kw">as </span>ToOwned&gt;::Owned: std::fmt::Debug,
1555+
{
15181556
<span class="doccomment">/// Debug label of the bind group.
15191557
///
15201558
/// This will show up in graphics debuggers for easy identification.
15211559
</span><span class="kw">pub </span>label: Label&lt;<span class="lifetime">'a</span>&gt;,
15221560
<span class="doccomment">/// The [`BindGroupLayout`] that corresponds to this bind group.
1523-
</span><span class="kw">pub </span>layout: BindGroupLayoutId,
1524-
<span class="doccomment">/// The resources to bind to this bind group.
1525-
</span><span class="kw">pub </span>entries: Cow&lt;<span class="lifetime">'a</span>, [BindGroupEntry&lt;<span class="lifetime">'a</span>&gt;]&gt;,
1561+
</span><span class="kw">pub </span>layout: BGL,
1562+
<span class="attr">#[cfg_attr(
1563+
feature = <span class="string">"serde"</span>,
1564+
serde(bound(
1565+
deserialize = <span class="string">"&lt;[BindGroupEntry&lt;'a, B, S, TV, TLAS&gt;] as ToOwned&gt;::Owned: Deserialize&lt;'de&gt;"
1566+
</span>))
1567+
)]
1568+
</span><span class="doccomment">/// The resources to bind to this bind group.
1569+
</span><span class="kw">pub </span>entries: Cow&lt;<span class="lifetime">'a</span>, [BindGroupEntry&lt;<span class="lifetime">'a</span>, B, S, TV, TLAS&gt;]&gt;,
15261570
}
15271571

1528-
<span class="doccomment">/// Describes a group of bindings and the resources to be bound.
1529-
</span><span class="attr">#[derive(Clone, Debug)]
1530-
</span><span class="kw">pub struct </span>ResolvedBindGroupDescriptor&lt;<span class="lifetime">'a</span>&gt; {
1531-
<span class="doccomment">/// Debug label of the bind group.
1532-
///
1533-
/// This will show up in graphics debuggers for easy identification.
1534-
</span><span class="kw">pub </span>label: Label&lt;<span class="lifetime">'a</span>&gt;,
1535-
<span class="doccomment">/// The [`BindGroupLayout`] that corresponds to this bind group.
1536-
</span><span class="kw">pub </span>layout: Arc&lt;BindGroupLayout&gt;,
1537-
<span class="doccomment">/// The resources to bind to this bind group.
1538-
</span><span class="kw">pub </span>entries: Cow&lt;<span class="lifetime">'a</span>, [ResolvedBindGroupEntry&lt;<span class="lifetime">'a</span>&gt;]&gt;,
1539-
}
1572+
<span class="kw">pub type </span>ResolvedBindGroupDescriptor&lt;<span class="lifetime">'a</span>&gt; = BindGroupDescriptor&lt;
1573+
<span class="lifetime">'a</span>,
1574+
Arc&lt;BindGroupLayout&gt;,
1575+
Arc&lt;Buffer&gt;,
1576+
Arc&lt;Sampler&gt;,
1577+
Arc&lt;TextureView&gt;,
1578+
Arc&lt;Tlas&gt;,
1579+
&gt;;
15401580

15411581
<span class="doccomment">/// Describes a [`BindGroupLayout`].
15421582
</span><span class="attr">#[derive(Clone, Debug)]
@@ -1695,14 +1735,23 @@
16951735
/// A `PipelineLayoutDescriptor` can be used to create a pipeline layout.
16961736
</span><span class="attr">#[derive(Clone, Debug, PartialEq, Eq, Hash)]
16971737
#[cfg_attr(feature = <span class="string">"serde"</span>, derive(Serialize, Deserialize))]
1698-
</span><span class="kw">pub struct </span>PipelineLayoutDescriptor&lt;<span class="lifetime">'a</span>&gt; {
1738+
#[cfg_attr(feature = <span class="string">"serde"</span>, serde(bound = <span class="string">"BGL: Serialize"</span>))]
1739+
</span><span class="kw">pub struct </span>PipelineLayoutDescriptor&lt;<span class="lifetime">'a</span>, BGL = BindGroupLayoutId&gt;
1740+
<span class="kw">where
1741+
</span>[BGL]: ToOwned,
1742+
&lt;[BGL] <span class="kw">as </span>ToOwned&gt;::Owned: std::fmt::Debug,
1743+
{
16991744
<span class="doccomment">/// Debug label of the pipeline layout.
17001745
///
17011746
/// This will show up in graphics debuggers for easy identification.
17021747
</span><span class="kw">pub </span>label: Label&lt;<span class="lifetime">'a</span>&gt;,
17031748
<span class="doccomment">/// Bind groups that this pipeline uses. The first entry will provide all the bindings for
17041749
/// "set = 0", second entry will provide all the bindings for "set = 1" etc.
1705-
</span><span class="kw">pub </span>bind_group_layouts: Cow&lt;<span class="lifetime">'a</span>, [BindGroupLayoutId]&gt;,
1750+
</span><span class="attr">#[cfg_attr(
1751+
feature = <span class="string">"serde"</span>,
1752+
serde(bound(deserialize = <span class="string">"&lt;[BGL] as ToOwned&gt;::Owned: Deserialize&lt;'de&gt;"</span>))
1753+
)]
1754+
</span><span class="kw">pub </span>bind_group_layouts: Cow&lt;<span class="lifetime">'a</span>, [BGL]&gt;,
17061755
<span class="doccomment">/// Set of push constant ranges this pipeline uses. Each shader stage that
17071756
/// uses push constants must define the range in push constant memory that
17081757
/// corresponds to its single `layout(push_constant)` uniform block.
@@ -1713,27 +1762,7 @@
17131762
</span><span class="kw">pub </span>push_constant_ranges: Cow&lt;<span class="lifetime">'a</span>, [wgt::PushConstantRange]&gt;,
17141763
}
17151764

1716-
<span class="doccomment">/// Describes a pipeline layout.
1717-
///
1718-
/// A `PipelineLayoutDescriptor` can be used to create a pipeline layout.
1719-
</span><span class="attr">#[derive(Debug)]
1720-
</span><span class="kw">pub struct </span>ResolvedPipelineLayoutDescriptor&lt;<span class="lifetime">'a</span>&gt; {
1721-
<span class="doccomment">/// Debug label of the pipeline layout.
1722-
///
1723-
/// This will show up in graphics debuggers for easy identification.
1724-
</span><span class="kw">pub </span>label: Label&lt;<span class="lifetime">'a</span>&gt;,
1725-
<span class="doccomment">/// Bind groups that this pipeline uses. The first entry will provide all the bindings for
1726-
/// "set = 0", second entry will provide all the bindings for "set = 1" etc.
1727-
</span><span class="kw">pub </span>bind_group_layouts: Cow&lt;<span class="lifetime">'a</span>, [Arc&lt;BindGroupLayout&gt;]&gt;,
1728-
<span class="doccomment">/// Set of push constant ranges this pipeline uses. Each shader stage that
1729-
/// uses push constants must define the range in push constant memory that
1730-
/// corresponds to its single `layout(push_constant)` uniform block.
1731-
///
1732-
/// If this array is non-empty, the
1733-
/// [`Features::PUSH_CONSTANTS`](wgt::Features::PUSH_CONSTANTS) feature must
1734-
/// be enabled.
1735-
</span><span class="kw">pub </span>push_constant_ranges: Cow&lt;<span class="lifetime">'a</span>, [wgt::PushConstantRange]&gt;,
1736-
}
1765+
<span class="kw">pub type </span>ResolvedPipelineLayoutDescriptor&lt;<span class="lifetime">'a</span>&gt; = PipelineLayoutDescriptor&lt;<span class="lifetime">'a</span>, Arc&lt;BindGroupLayout&gt;&gt;;
17371766

17381767
<span class="attr">#[derive(Debug)]
17391768
</span><span class="kw">pub struct </span>PipelineLayout {
@@ -1855,45 +1884,50 @@
18551884
<span class="attr">#[repr(C)]
18561885
#[derive(Clone, Debug, Hash, Eq, PartialEq)]
18571886
#[cfg_attr(feature = <span class="string">"serde"</span>, derive(Serialize, Deserialize))]
1858-
</span><span class="kw">pub struct </span>BufferBinding {
1859-
<span class="kw">pub </span>buffer_id: BufferId,
1887+
</span><span class="kw">pub struct </span>BufferBinding&lt;B = BufferId&gt; {
1888+
<span class="kw">pub </span>buffer: B,
18601889
<span class="kw">pub </span>offset: wgt::BufferAddress,
18611890
<span class="kw">pub </span>size: <span class="prelude-ty">Option</span>&lt;wgt::BufferSize&gt;,
18621891
}
18631892

1864-
<span class="attr">#[derive(Clone, Debug)]
1865-
</span><span class="kw">pub struct </span>ResolvedBufferBinding {
1866-
<span class="kw">pub </span>buffer: Arc&lt;Buffer&gt;,
1867-
<span class="kw">pub </span>offset: wgt::BufferAddress,
1868-
<span class="kw">pub </span>size: <span class="prelude-ty">Option</span>&lt;wgt::BufferSize&gt;,
1869-
}
1893+
<span class="kw">pub type </span>ResolvedBufferBinding = BufferBinding&lt;Arc&lt;Buffer&gt;&gt;;
18701894

18711895
<span class="comment">// Note: Duplicated in `wgpu-rs` as `BindingResource`
18721896
// They're different enough that it doesn't make sense to share a common type
18731897
</span><span class="attr">#[derive(Debug, Clone)]
18741898
#[cfg_attr(feature = <span class="string">"serde"</span>, derive(serde::Serialize, serde::Deserialize))]
1875-
</span><span class="kw">pub enum </span>BindingResource&lt;<span class="lifetime">'a</span>&gt; {
1876-
Buffer(BufferBinding),
1877-
BufferArray(Cow&lt;<span class="lifetime">'a</span>, [BufferBinding]&gt;),
1878-
Sampler(SamplerId),
1879-
SamplerArray(Cow&lt;<span class="lifetime">'a</span>, [SamplerId]&gt;),
1880-
TextureView(TextureViewId),
1881-
TextureViewArray(Cow&lt;<span class="lifetime">'a</span>, [TextureViewId]&gt;),
1882-
AccelerationStructure(TlasId),
1899+
</span><span class="kw">pub enum </span>BindingResource&lt;<span class="lifetime">'a</span>, B = BufferId, S = SamplerId, TV = TextureViewId, TLAS = TlasId&gt;
1900+
<span class="kw">where
1901+
</span>[BufferBinding&lt;B&gt;]: ToOwned,
1902+
[S]: ToOwned,
1903+
[TV]: ToOwned,
1904+
&lt;[BufferBinding&lt;B&gt;] <span class="kw">as </span>ToOwned&gt;::Owned: std::fmt::Debug,
1905+
&lt;[S] <span class="kw">as </span>ToOwned&gt;::Owned: std::fmt::Debug,
1906+
&lt;[TV] <span class="kw">as </span>ToOwned&gt;::Owned: std::fmt::Debug,
1907+
{
1908+
Buffer(BufferBinding&lt;B&gt;),
1909+
<span class="attr">#[cfg_attr(
1910+
feature = <span class="string">"serde"</span>,
1911+
serde(bound(deserialize = <span class="string">"&lt;[BufferBinding&lt;B&gt;] as ToOwned&gt;::Owned: Deserialize&lt;'de&gt;"</span>))
1912+
)]
1913+
</span>BufferArray(Cow&lt;<span class="lifetime">'a</span>, [BufferBinding&lt;B&gt;]&gt;),
1914+
Sampler(S),
1915+
<span class="attr">#[cfg_attr(
1916+
feature = <span class="string">"serde"</span>,
1917+
serde(bound(deserialize = <span class="string">"&lt;[S] as ToOwned&gt;::Owned: Deserialize&lt;'de&gt;"</span>))
1918+
)]
1919+
</span>SamplerArray(Cow&lt;<span class="lifetime">'a</span>, [S]&gt;),
1920+
TextureView(TV),
1921+
<span class="attr">#[cfg_attr(
1922+
feature = <span class="string">"serde"</span>,
1923+
serde(bound(deserialize = <span class="string">"&lt;[TV] as ToOwned&gt;::Owned: Deserialize&lt;'de&gt;"</span>))
1924+
)]
1925+
</span>TextureViewArray(Cow&lt;<span class="lifetime">'a</span>, [TV]&gt;),
1926+
AccelerationStructure(TLAS),
18831927
}
18841928

1885-
<span class="comment">// Note: Duplicated in `wgpu-rs` as `BindingResource`
1886-
// They're different enough that it doesn't make sense to share a common type
1887-
</span><span class="attr">#[derive(Debug, Clone)]
1888-
</span><span class="kw">pub enum </span>ResolvedBindingResource&lt;<span class="lifetime">'a</span>&gt; {
1889-
Buffer(ResolvedBufferBinding),
1890-
BufferArray(Cow&lt;<span class="lifetime">'a</span>, [ResolvedBufferBinding]&gt;),
1891-
Sampler(Arc&lt;Sampler&gt;),
1892-
SamplerArray(Cow&lt;<span class="lifetime">'a</span>, [Arc&lt;Sampler&gt;]&gt;),
1893-
TextureView(Arc&lt;TextureView&gt;),
1894-
TextureViewArray(Cow&lt;<span class="lifetime">'a</span>, [Arc&lt;TextureView&gt;]&gt;),
1895-
AccelerationStructure(Arc&lt;Tlas&gt;),
1896-
}
1929+
<span class="kw">pub type </span>ResolvedBindingResource&lt;<span class="lifetime">'a</span>&gt; =
1930+
BindingResource&lt;<span class="lifetime">'a</span>, Arc&lt;Buffer&gt;, Arc&lt;Sampler&gt;, Arc&lt;TextureView&gt;, Arc&lt;Tlas&gt;&gt;;
18971931

18981932
<span class="attr">#[derive(Clone, Debug, Error)]
18991933
#[non_exhaustive]

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3006,7 +3006,7 @@
30063006
{
30073007
<span class="kw">let </span>resolve_buffer = |bb: <span class="kw-2">&amp;</span>BufferBinding| {
30083008
buffer_storage
3009-
.get(bb.buffer_id)
3009+
.get(bb.buffer)
30103010
.get()
30113011
.map(|buffer| ResolvedBufferBinding {
30123012
buffer,

0 commit comments

Comments
 (0)