Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - removed unused RenderResourceId and SwapChainFrame #2890

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pipelined/bevy_render2/src/render_phase/draw_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ impl<'a> TrackedRenderPass<'a> {
);
}
self.pass
.set_bind_group(index as u32, bind_group.value(), dynamic_uniform_indices);
.set_bind_group(index as u32, bind_group, dynamic_uniform_indices);
self.state
.set_bind_group(index as usize, bind_group.id(), dynamic_uniform_indices);
}
Expand Down
16 changes: 10 additions & 6 deletions pipelined/bevy_render2/src/render_resource/bind_group.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use bevy_reflect::Uuid;
use std::sync::Arc;
use std::{ops::Deref, sync::Arc};

#[derive(Copy, Clone, Hash, Eq, PartialEq, Debug)]
pub struct BindGroupId(Uuid);
Expand All @@ -15,11 +15,6 @@ impl BindGroup {
pub fn id(&self) -> BindGroupId {
self.id
}

#[inline]
pub fn value(&self) -> &wgpu::BindGroup {
&self.value
}
}

impl From<wgpu::BindGroup> for BindGroup {
Expand All @@ -30,3 +25,12 @@ impl From<wgpu::BindGroup> for BindGroup {
}
}
}

impl Deref for BindGroup {
type Target = wgpu::BindGroup;

#[inline]
fn deref(&self) -> &Self::Target {
&self.value
}
}
2 changes: 0 additions & 2 deletions pipelined/bevy_render2/src/render_resource/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ mod bind_group;
mod buffer;
mod buffer_vec;
mod pipeline;
mod render_resource_id;
mod texture;
mod uniform_vec;

pub use bind_group::*;
pub use buffer::*;
pub use buffer_vec::*;
pub use pipeline::*;
pub use render_resource_id::*;
pub use texture::*;
pub use uniform_vec::*;

Expand Down
34 changes: 0 additions & 34 deletions pipelined/bevy_render2/src/render_resource/render_resource_id.rs

This file was deleted.

31 changes: 0 additions & 31 deletions pipelined/bevy_render2/src/render_resource/texture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,34 +124,3 @@ impl Deref for Sampler {
&self.value
}
}

#[derive(Clone, Debug)]
pub struct SwapChainFrame {
id: TextureViewId,
value: Arc<wgpu::SwapChainFrame>,
}

impl SwapChainFrame {
#[inline]
pub fn id(&self) -> TextureViewId {
self.id
}
}

impl From<wgpu::SwapChainFrame> for SwapChainFrame {
fn from(value: wgpu::SwapChainFrame) -> Self {
Self {
id: TextureViewId(Uuid::new_v4()),
value: Arc::new(value),
}
}
}

impl Deref for SwapChainFrame {
type Target = wgpu::SwapChainFrame;

#[inline]
fn deref(&self) -> &Self::Target {
&self.value
}
}