From 6f6893244aeddb0586b9891b8afbccc7232d3ed8 Mon Sep 17 00:00:00 2001 From: Gabriel Majeri Date: Wed, 15 Jul 2020 17:09:53 +0300 Subject: [PATCH] Rename `InvalidBufferUsage` --- wgpu-core/src/command/bundle.rs | 6 +++--- wgpu-core/src/command/compute.rs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/wgpu-core/src/command/bundle.rs b/wgpu-core/src/command/bundle.rs index e7af09e06d..f56e5db445 100644 --- a/wgpu-core/src/command/bundle.rs +++ b/wgpu-core/src/command/bundle.rs @@ -612,7 +612,7 @@ pub enum RenderCommandError { }, IncompatiblePipeline, IncompatibleReadOnlyDepthStencil, - InvalidBufferUsage { + MissingBufferUsage { actual: wgt::BufferUsage, expected: wgt::BufferUsage, }, @@ -665,7 +665,7 @@ impl fmt::Display for RenderCommandError { ), Self::IncompatiblePipeline => write!(f, "render pipeline output formats and sample counts do not match render pass attachment formats"), Self::IncompatibleReadOnlyDepthStencil => write!(f, "pipeline is not compatible with the depth-stencil read-only render pass"), - Self::InvalidBufferUsage { actual, expected } => write!( + Self::MissingBufferUsage { actual, expected } => write!( f, "buffer usage is {:?} which does not contain required usage {:?}", actual, @@ -708,7 +708,7 @@ pub fn check_buffer_usage( expected: wgt::BufferUsage, ) -> Result<(), RenderCommandError> { if !actual.contains(expected) { - Err(RenderCommandError::InvalidBufferUsage { actual, expected }) + Err(RenderCommandError::MissingBufferUsage { actual, expected }) } else { Ok(()) } diff --git a/wgpu-core/src/command/compute.rs b/wgpu-core/src/command/compute.rs index 52a99270b6..d83db3aa0a 100644 --- a/wgpu-core/src/command/compute.rs +++ b/wgpu-core/src/command/compute.rs @@ -115,7 +115,7 @@ pub enum ComputePassError { max: u32, }, UnboundPipeline, - InvalidBufferUsage { + MissingBufferUsage { actual: BufferUsage, expected: BufferUsage, }, @@ -146,7 +146,7 @@ impl fmt::Display for ComputePassError { max, ), Self::UnboundPipeline => write!(f, "a compute pipeline must be bound"), - Self::InvalidBufferUsage { actual, expected } => write!( + Self::MissingBufferUsage { actual, expected } => write!( f, "buffer usage is {:?} which does not contain required usage {:?}", actual, @@ -382,7 +382,7 @@ impl Global { BufferUse::INDIRECT, ); if !src_buffer.usage.contains(BufferUsage::INDIRECT) { - return Err(ComputePassError::InvalidBufferUsage { + return Err(ComputePassError::MissingBufferUsage { actual: src_buffer.usage, expected: BufferUsage::INDIRECT, });