mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-19 22:11:01 +01:00
check device validity at creation
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
1 parent
09e21cfa7b
commit
0e330246cd
1 file changed
+4
@@ -250,6 +250,7 @@ impl RenderBundleEncoder {
|
||||
device: &Arc<Device>,
|
||||
desc: &RenderBundleEncoderDescriptor,
|
||||
) -> Result<Self, CreateRenderBundleError> {
|
||||
device.check_is_valid()?;
|
||||
let (is_depth_read_only, is_stencil_read_only) =
|
||||
validate_render_bundle_encoder_descriptor(desc, device)?;
|
||||
|
||||
@@ -1230,6 +1231,8 @@ pub enum CreateRenderBundleError {
|
||||
InvalidSampleCount(u32),
|
||||
#[error(transparent)]
|
||||
MissingFeatures(#[from] MissingFeatures),
|
||||
#[error(transparent)]
|
||||
Device(#[from] DeviceError),
|
||||
}
|
||||
|
||||
impl WebGpuError for CreateRenderBundleError {
|
||||
@@ -1242,6 +1245,7 @@ impl WebGpuError for CreateRenderBundleError {
|
||||
| Self::NoAttachment
|
||||
| Self::InvalidSampleCount(_) => ErrorType::Validation,
|
||||
Self::MissingFeatures(e) => e.webgpu_error_type(),
|
||||
Self::Device(e) => e.webgpu_error_type(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user