mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-21 22:33:49 +00:00
change Device.create_bind_group_layout
to return an Arc<BindGroupLayout<A>
This commit is contained in:
parent
781b54a8b9
commit
36c998a558
@ -673,9 +673,6 @@ impl Global {
|
||||
bgl.exclusive_pipeline
|
||||
.set(binding_model::ExclusivePipeline::None)
|
||||
.unwrap();
|
||||
|
||||
let bgl = Arc::new(bgl);
|
||||
|
||||
Ok(bgl)
|
||||
});
|
||||
|
||||
|
@ -1659,7 +1659,7 @@ impl<A: HalApi> Device<A> {
|
||||
label: &crate::Label,
|
||||
entry_map: bgl::EntryMap,
|
||||
origin: bgl::Origin,
|
||||
) -> Result<BindGroupLayout<A>, binding_model::CreateBindGroupLayoutError> {
|
||||
) -> Result<Arc<BindGroupLayout<A>>, binding_model::CreateBindGroupLayoutError> {
|
||||
#[derive(PartialEq)]
|
||||
enum WritableStorage {
|
||||
Yes,
|
||||
@ -1858,7 +1858,7 @@ impl<A: HalApi> Device<A> {
|
||||
.validate(&self.limits)
|
||||
.map_err(binding_model::CreateBindGroupLayoutError::TooManyBindings)?;
|
||||
|
||||
Ok(BindGroupLayout {
|
||||
let bgl = BindGroupLayout {
|
||||
raw: Some(raw),
|
||||
device: self.clone(),
|
||||
entries: entry_map,
|
||||
@ -1866,7 +1866,11 @@ impl<A: HalApi> Device<A> {
|
||||
exclusive_pipeline: OnceCell::new(),
|
||||
binding_count_validator: count_validator,
|
||||
label: label.to_string(),
|
||||
})
|
||||
};
|
||||
|
||||
let bgl = Arc::new(bgl);
|
||||
|
||||
Ok(bgl)
|
||||
}
|
||||
|
||||
pub(crate) fn create_buffer_binding<'a>(
|
||||
@ -2607,7 +2611,6 @@ impl<A: HalApi> Device<A> {
|
||||
bgl::Origin::Derived,
|
||||
) {
|
||||
Ok(bgl) => {
|
||||
let bgl = Arc::new(bgl);
|
||||
e.insert(bgl.clone());
|
||||
Ok(bgl)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user