mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-30 18:14:18 +01:00
[core] Do not use IDs as default type in PipelineLayoutDescriptor (#9985)
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> Co-authored-by: Erich Gubler <erichdongubler@gmail.com>
This commit is contained in:
1 parent
667b53cbef
commit
f7ebc07661
7 files changed
+11
-16
No files matched your search
@@ -71,6 +71,7 @@ Bottom level categories:
|
||||
- [`immediate_address_space`](https://www.w3.org/TR/WGSL/#language_extension-immediate_address_space) WGSL language extension is implemented. By @beicause in [#9711](https://github.com/gfx-rs/wgpu/pull/9711).
|
||||
- `TextureFormat::is_srgb()` has been renamed to `TextureFormat::has_srgb_suffix()` to clarify its function. By @kpreid in [#9758](https://github.com/gfx-rs/wgpu/pull/9758).
|
||||
- Remove the never-constructed `CreateBlasError::InvalidAabbStride` variant. `create_blas` takes no stride, so it could never be produced; AABB stride is validated at build time as `BuildAccelerationStructureError::InvalidAabbStride`. By @mstampfli in [#9935](https://github.com/gfx-rs/wgpu/pull/9935).
|
||||
- Use `Arc`'d resources instead of IDs as the default resource type in `PipelineLayoutDescriptor`. By @sagudev in [#9985](https://github.com/gfx-rs/wgpu/pull/9985)
|
||||
|
||||
#### naga
|
||||
|
||||
|
||||
+1
-1
@@ -213,7 +213,7 @@ impl Player {
|
||||
.map(|bgl_id| bgl_id.map(|bgl_id| self.resolve_bind_group_layout_id(bgl_id)))
|
||||
.collect();
|
||||
|
||||
let resolved_desc = wgc::binding_model::ResolvedPipelineLayoutDescriptor {
|
||||
let resolved_desc = wgc::binding_model::PipelineLayoutDescriptor {
|
||||
label: desc.label.clone(),
|
||||
bind_group_layouts: Cow::from(&bind_group_layouts),
|
||||
immediate_size: desc.immediate_size,
|
||||
|
||||
@@ -999,7 +999,8 @@ impl WebGpuError for ImmediateUploadError {
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
||||
#[cfg_attr(feature = "serde", serde(bound = "BGL: Serialize"))]
|
||||
pub struct PipelineLayoutDescriptor<'a, BGL = BindGroupLayoutId>
|
||||
/// cbindgen:ignore
|
||||
pub struct PipelineLayoutDescriptor<'a, BGL = Arc<BindGroupLayout>>
|
||||
where
|
||||
[Option<BGL>]: ToOwned,
|
||||
<[Option<BGL>] as ToOwned>::Owned: fmt::Debug,
|
||||
@@ -1023,10 +1024,6 @@ where
|
||||
pub immediate_size: u32,
|
||||
}
|
||||
|
||||
/// cbindgen:ignore
|
||||
pub type ResolvedPipelineLayoutDescriptor<'a, BGL = Arc<BindGroupLayout>> =
|
||||
PipelineLayoutDescriptor<'a, BGL>;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct PipelineLayout {
|
||||
pub(crate) raw: ResourceState<Box<dyn hal::DynPipelineLayout>>,
|
||||
|
||||
@@ -454,7 +454,7 @@ impl Global {
|
||||
pub fn device_create_pipeline_layout(
|
||||
&self,
|
||||
device_id: DeviceId,
|
||||
desc: &binding_model::PipelineLayoutDescriptor,
|
||||
desc: &binding_model::PipelineLayoutDescriptor<id::BindGroupLayoutId>,
|
||||
id_in: Option<id::PipelineLayoutId>,
|
||||
) -> (
|
||||
id::PipelineLayoutId,
|
||||
@@ -473,7 +473,7 @@ impl Global {
|
||||
.collect::<Vec<_>>()
|
||||
};
|
||||
|
||||
let desc = binding_model::ResolvedPipelineLayoutDescriptor {
|
||||
let desc = binding_model::PipelineLayoutDescriptor {
|
||||
label: desc.label.clone(),
|
||||
bind_group_layouts: Cow::Owned(bind_group_layouts),
|
||||
immediate_size: desc.immediate_size,
|
||||
|
||||
@@ -4052,7 +4052,7 @@ impl Device {
|
||||
|
||||
pub fn create_pipeline_layout(
|
||||
self: &Arc<Self>,
|
||||
desc: &binding_model::ResolvedPipelineLayoutDescriptor,
|
||||
desc: &binding_model::PipelineLayoutDescriptor,
|
||||
) -> (
|
||||
Arc<binding_model::PipelineLayout>,
|
||||
Option<binding_model::CreatePipelineLayoutError>,
|
||||
@@ -4082,7 +4082,7 @@ impl Device {
|
||||
|
||||
fn create_pipeline_layout_impl(
|
||||
self: &Arc<Self>,
|
||||
desc: &binding_model::ResolvedPipelineLayoutDescriptor,
|
||||
desc: &binding_model::PipelineLayoutDescriptor,
|
||||
ignore_exclusive_pipeline_check: bool,
|
||||
) -> Result<Arc<binding_model::PipelineLayout>, binding_model::CreatePipelineLayoutError> {
|
||||
use crate::binding_model::CreatePipelineLayoutError as Error;
|
||||
@@ -4238,7 +4238,7 @@ impl Device {
|
||||
})
|
||||
.collect::<Result<Vec<_>, _>>()?;
|
||||
|
||||
let layout_desc = binding_model::ResolvedPipelineLayoutDescriptor {
|
||||
let layout_desc = binding_model::PipelineLayoutDescriptor {
|
||||
label: None,
|
||||
bind_group_layouts: Cow::Owned(bind_group_layouts),
|
||||
immediate_size,
|
||||
|
||||
@@ -173,10 +173,7 @@ pub enum Action<'a, R: ReferenceType> {
|
||||
DropBindGroupLayout(PointerId<markers::BindGroupLayout>),
|
||||
CreatePipelineLayout(
|
||||
PointerId<markers::PipelineLayout>,
|
||||
crate::binding_model::ResolvedPipelineLayoutDescriptor<
|
||||
'a,
|
||||
PointerId<markers::BindGroupLayout>,
|
||||
>,
|
||||
crate::binding_model::PipelineLayoutDescriptor<'a, PointerId<markers::BindGroupLayout>>,
|
||||
),
|
||||
DropPipelineLayout(PointerId<markers::PipelineLayout>),
|
||||
CreateBindGroup(PointerId<markers::BindGroup>, TraceBindGroupDescriptor<'a>),
|
||||
|
||||
@@ -654,7 +654,7 @@ impl IntoTrace for ArcRenderCommand {
|
||||
}
|
||||
}
|
||||
|
||||
impl IntoTrace for crate::binding_model::ResolvedPipelineLayoutDescriptor<'_> {
|
||||
impl IntoTrace for crate::binding_model::PipelineLayoutDescriptor<'_> {
|
||||
type Output = crate::binding_model::PipelineLayoutDescriptor<
|
||||
'static,
|
||||
PointerId<markers::BindGroupLayout>,
|
||||
|
||||
Reference in new issue
Block a user