Skip to content

Commit eba2aff

Browse files
committed
[core] Do not use IDs as default type
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
1 parent 7a65558 commit eba2aff

6 files changed

Lines changed: 9 additions & 16 deletions

File tree

player/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ impl Player {
213213
.map(|bgl_id| bgl_id.map(|bgl_id| self.resolve_bind_group_layout_id(bgl_id)))
214214
.collect();
215215

216-
let resolved_desc = wgc::binding_model::ResolvedPipelineLayoutDescriptor {
216+
let resolved_desc = wgc::binding_model::PipelineLayoutDescriptor {
217217
label: desc.label.clone(),
218218
bind_group_layouts: Cow::from(&bind_group_layouts),
219219
immediate_size: desc.immediate_size,

wgpu-core/src/binding_model.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -999,7 +999,7 @@ impl WebGpuError for ImmediateUploadError {
999999
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
10001000
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10011001
#[cfg_attr(feature = "serde", serde(bound = "BGL: Serialize"))]
1002-
pub struct PipelineLayoutDescriptor<'a, BGL = BindGroupLayoutId>
1002+
pub struct PipelineLayoutDescriptor<'a, BGL = Arc<BindGroupLayout>>
10031003
where
10041004
[Option<BGL>]: ToOwned,
10051005
<[Option<BGL>] as ToOwned>::Owned: fmt::Debug,
@@ -1023,10 +1023,6 @@ where
10231023
pub immediate_size: u32,
10241024
}
10251025

1026-
/// cbindgen:ignore
1027-
pub type ResolvedPipelineLayoutDescriptor<'a, BGL = Arc<BindGroupLayout>> =
1028-
PipelineLayoutDescriptor<'a, BGL>;
1029-
10301026
#[derive(Debug)]
10311027
pub struct PipelineLayout {
10321028
pub(crate) raw: ResourceState<Box<dyn hal::DynPipelineLayout>>,

wgpu-core/src/device/global.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ impl Global {
442442
pub fn device_create_pipeline_layout(
443443
&self,
444444
device_id: DeviceId,
445-
desc: &binding_model::PipelineLayoutDescriptor,
445+
desc: &binding_model::PipelineLayoutDescriptor<id::BindGroupLayoutId>,
446446
id_in: Option<id::PipelineLayoutId>,
447447
) -> (
448448
id::PipelineLayoutId,
@@ -461,7 +461,7 @@ impl Global {
461461
.collect::<Vec<_>>()
462462
};
463463

464-
let desc = binding_model::ResolvedPipelineLayoutDescriptor {
464+
let desc = binding_model::PipelineLayoutDescriptor {
465465
label: desc.label.clone(),
466466
bind_group_layouts: Cow::Owned(bind_group_layouts),
467467
immediate_size: desc.immediate_size,

wgpu-core/src/device/resource.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4022,7 +4022,7 @@ impl Device {
40224022

40234023
pub fn create_pipeline_layout(
40244024
self: &Arc<Self>,
4025-
desc: &binding_model::ResolvedPipelineLayoutDescriptor,
4025+
desc: &binding_model::PipelineLayoutDescriptor,
40264026
) -> (
40274027
Arc<binding_model::PipelineLayout>,
40284028
Option<binding_model::CreatePipelineLayoutError>,
@@ -4052,7 +4052,7 @@ impl Device {
40524052

40534053
fn create_pipeline_layout_impl(
40544054
self: &Arc<Self>,
4055-
desc: &binding_model::ResolvedPipelineLayoutDescriptor,
4055+
desc: &binding_model::PipelineLayoutDescriptor,
40564056
ignore_exclusive_pipeline_check: bool,
40574057
) -> Result<Arc<binding_model::PipelineLayout>, binding_model::CreatePipelineLayoutError> {
40584058
use crate::binding_model::CreatePipelineLayoutError as Error;
@@ -4208,7 +4208,7 @@ impl Device {
42084208
})
42094209
.collect::<Result<Vec<_>, _>>()?;
42104210

4211-
let layout_desc = binding_model::ResolvedPipelineLayoutDescriptor {
4211+
let layout_desc = binding_model::PipelineLayoutDescriptor {
42124212
label: None,
42134213
bind_group_layouts: Cow::Owned(bind_group_layouts),
42144214
immediate_size,

wgpu-core/src/device/trace.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,7 @@ pub enum Action<'a, R: ReferenceType> {
173173
DropBindGroupLayout(PointerId<markers::BindGroupLayout>),
174174
CreatePipelineLayout(
175175
PointerId<markers::PipelineLayout>,
176-
crate::binding_model::ResolvedPipelineLayoutDescriptor<
177-
'a,
178-
PointerId<markers::BindGroupLayout>,
179-
>,
176+
crate::binding_model::PipelineLayoutDescriptor<'a, PointerId<markers::BindGroupLayout>>,
180177
),
181178
DropPipelineLayout(PointerId<markers::PipelineLayout>),
182179
CreateBindGroup(PointerId<markers::BindGroup>, TraceBindGroupDescriptor<'a>),

wgpu-core/src/device/trace/record.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ impl IntoTrace for ArcRenderCommand {
654654
}
655655
}
656656

657-
impl IntoTrace for crate::binding_model::ResolvedPipelineLayoutDescriptor<'_> {
657+
impl IntoTrace for crate::binding_model::PipelineLayoutDescriptor<'_> {
658658
type Output = crate::binding_model::PipelineLayoutDescriptor<
659659
'static,
660660
PointerId<markers::BindGroupLayout>,

0 commit comments

Comments
 (0)