diff --git a/wgpu-core/src/command/render.rs b/wgpu-core/src/command/render.rs index 96b0e5d60..5cf157b5e 100644 --- a/wgpu-core/src/command/render.rs +++ b/wgpu-core/src/command/render.rs @@ -466,13 +466,13 @@ impl Global { // instead of the special read-only one, which would be `None`. let mut is_ds_read_only = false; - struct OutputAttachment<'a> { + struct RenderAttachment<'a> { texture_id: &'a Stored, selector: &'a TextureSelector, previous_use: Option, new_use: TextureUse, } - let mut output_attachments = AttachmentDataVec::::new(); + let mut render_attachments = AttachmentDataVec::::new(); let mut attachment_width = None; let mut attachment_height = None; @@ -542,7 +542,7 @@ impl Global { } else { TextureUse::ATTACHMENT_WRITE }; - output_attachments.push(OutputAttachment { + render_attachments.push(RenderAttachment { texture_id: source_id, selector: &view.selector, previous_use, @@ -591,7 +591,7 @@ impl Global { .textures .query(source_id.value, view.selector.clone()); let new_use = TextureUse::ATTACHMENT_WRITE; - output_attachments.push(OutputAttachment { + render_attachments.push(RenderAttachment { texture_id: source_id, selector: &view.selector, previous_use, @@ -668,7 +668,7 @@ impl Global { .textures .query(source_id.value, view.selector.clone()); let new_use = TextureUse::ATTACHMENT_WRITE; - output_attachments.push(OutputAttachment { + render_attachments.push(RenderAttachment { texture_id: source_id, selector: &view.selector, previous_use, @@ -1587,31 +1587,31 @@ impl Global { raw.end_render_pass(); } - for ot in output_attachments { - let texture = &texture_guard[ot.texture_id.value]; - check_texture_usage(texture.usage, TextureUsage::OUTPUT_ATTACHMENT)?; + for ra in render_attachments { + let texture = &texture_guard[ra.texture_id.value]; + check_texture_usage(texture.usage, TextureUsage::RENDER_ATTACHMENT)?; // the tracker set of the pass is always in "extend" mode trackers .textures .change_extend( - ot.texture_id.value, - &ot.texture_id.ref_count, - ot.selector.clone(), - ot.new_use, + ra.texture_id.value, + &ra.texture_id.ref_count, + ra.selector.clone(), + ra.new_use, ) .unwrap(); - if let Some(usage) = ot.previous_use { + if let Some(usage) = ra.previous_use { // Make the attachment tracks to be aware of the internal // transition done by the render pass, by registering the // previous usage as the initial state. trackers .textures .prepend( - ot.texture_id.value, - &ot.texture_id.ref_count, - ot.selector.clone(), + ra.texture_id.value, + &ra.texture_id.ref_count, + ra.selector.clone(), usage, ) .unwrap(); diff --git a/wgpu-core/src/conv.rs b/wgpu-core/src/conv.rs index 0a1773864..f134c8322 100644 --- a/wgpu-core/src/conv.rs +++ b/wgpu-core/src/conv.rs @@ -68,7 +68,7 @@ pub fn map_texture_usage( if usage.contains(W::STORAGE) { value |= U::STORAGE; } - if usage.contains(W::OUTPUT_ATTACHMENT) { + if usage.contains(W::RENDER_ATTACHMENT) { if aspects.intersects(hal::format::Aspects::DEPTH | hal::format::Aspects::STENCIL) { value |= U::DEPTH_STENCIL_ATTACHMENT; } else { diff --git a/wgpu-types/src/lib.rs b/wgpu-types/src/lib.rs index 4ae3b5adc..025bc61c2 100644 --- a/wgpu-types/src/lib.rs +++ b/wgpu-types/src/lib.rs @@ -1315,8 +1315,8 @@ bitflags::bitflags! { const SAMPLED = 4; /// Allows a texture to be a [`BindingType::StorageTexture`] in a bind group. const STORAGE = 8; - /// Allows a texture to be a output attachment of a renderpass. - const OUTPUT_ATTACHMENT = 16; + /// Allows a texture to be an output attachment of a renderpass. + const RENDER_ATTACHMENT = 16; } } @@ -1326,7 +1326,7 @@ bitflags::bitflags! { #[cfg_attr(feature = "trace", derive(Serialize))] #[cfg_attr(feature = "replay", derive(Deserialize))] pub struct SwapChainDescriptor { - /// The usage of the swap chain. The only supported usage is OUTPUT_ATTACHMENT + /// The usage of the swap chain. The only supported usage is `RENDER_ATTACHMENT`. pub usage: TextureUsage, /// The texture format of the swap chain. The only formats that are guaranteed are /// `Bgra8Unorm` and `Bgra8UnormSrgb`