From bcbe4311a5ee428878a7bf1cc7235536b2b45df1 Mon Sep 17 00:00:00 2001 From: sagudev <16504129+sagudev@users.noreply.github.com> Date: Tue, 4 Feb 2025 10:28:24 +0100 Subject: [PATCH] `ArcRenderPassColorAttachment` Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --- wgpu-core/src/command/render.rs | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/wgpu-core/src/command/render.rs b/wgpu-core/src/command/render.rs index 58f7f126b3..7885575465 100644 --- a/wgpu-core/src/command/render.rs +++ b/wgpu-core/src/command/render.rs @@ -158,11 +158,11 @@ impl ResolvedPassChannel { #[repr(C)] #[derive(Clone, Debug, PartialEq)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] -pub struct RenderPassColorAttachment { +pub struct RenderPassColorAttachment { /// The view to use as an attachment. - pub view: id::TextureViewId, + pub view: TV, /// The view that will receive the resolved output if multisampling is used. - pub resolve_target: Option, + pub resolve_target: Option, /// Operation to perform to the output attachment at the start of a /// renderpass. /// @@ -173,22 +173,8 @@ pub struct RenderPassColorAttachment { pub store_op: StoreOp, } -/// Describes a color attachment to a render pass. -#[derive(Debug)] -struct ArcRenderPassColorAttachment { - /// The view to use as an attachment. - pub view: Arc, - /// The view that will receive the resolved output if multisampling is used. - pub resolve_target: Option>, - /// Operation to perform to the output attachment at the start of a - /// renderpass. - /// - /// This must be clear if it is the first renderpass rendering to a swap - /// chain image. - pub load_op: LoadOp, - /// Operation to perform to the output attachment at the end of a renderpass. - pub store_op: StoreOp, -} +pub type ArcRenderPassColorAttachment = RenderPassColorAttachment>; + impl ArcRenderPassColorAttachment { fn hal_ops(&self) -> hal::AttachmentOps { load_hal_ops(self.load_op) | store_hal_ops(self.store_op)