mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
Clearing a non-color attachment should be unreachable (#3393)
This commit is contained in:
@@ -525,7 +525,7 @@ impl crate::CommandEncoder<super::Api> for super::CommandEncoder {
|
||||
color: [c.r as f32, c.g as f32, c.b as f32, c.a as f32],
|
||||
is_srgb: cat.target.view.format.describe().srgb,
|
||||
},
|
||||
wgt::TextureSampleType::Depth => unimplemented!(),
|
||||
wgt::TextureSampleType::Depth => unreachable!(),
|
||||
wgt::TextureSampleType::Uint => C::ClearColorU(
|
||||
i as u32,
|
||||
[c.r as u32, c.g as u32, c.b as u32, c.a as u32],
|
||||
|
||||
@@ -203,17 +203,16 @@ impl crate::ColorAttachment<'_, super::Api> {
|
||||
.describe()
|
||||
.sample_type
|
||||
{
|
||||
wgt::TextureSampleType::Float { .. } | wgt::TextureSampleType::Depth => {
|
||||
vk::ClearColorValue {
|
||||
float32: [cv.r as f32, cv.g as f32, cv.b as f32, cv.a as f32],
|
||||
}
|
||||
}
|
||||
wgt::TextureSampleType::Float { .. } => vk::ClearColorValue {
|
||||
float32: [cv.r as f32, cv.g as f32, cv.b as f32, cv.a as f32],
|
||||
},
|
||||
wgt::TextureSampleType::Sint => vk::ClearColorValue {
|
||||
int32: [cv.r as i32, cv.g as i32, cv.b as i32, cv.a as i32],
|
||||
},
|
||||
wgt::TextureSampleType::Uint => vk::ClearColorValue {
|
||||
uint32: [cv.r as u32, cv.g as u32, cv.b as u32, cv.a as u32],
|
||||
},
|
||||
wgt::TextureSampleType::Depth => unreachable!(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user