mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-01-15 07:08:00 -05:00
Fix support for d24unorm format
This commit is contained in:
@@ -370,8 +370,8 @@ pub(crate) fn map_texture_format(
|
||||
// Depth and stencil formats
|
||||
Tf::Depth32Float => H::D32Sfloat,
|
||||
Tf::Depth24Plus => {
|
||||
if private_features.texture_d24_s8 {
|
||||
H::D24UnormS8Uint
|
||||
if private_features.texture_d24 {
|
||||
H::X8D24Unorm
|
||||
} else {
|
||||
H::D32Sfloat
|
||||
}
|
||||
|
||||
@@ -744,6 +744,10 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
let private_features = PrivateFeatures {
|
||||
shader_validation: desc.shader_validation,
|
||||
anisotropic_filtering: enabled_features.contains(hal::Features::SAMPLER_ANISOTROPY),
|
||||
texture_d24: phd
|
||||
.format_properties(Some(hal::format::Format::X8D24Unorm))
|
||||
.optimal_tiling
|
||||
.contains(hal::format::ImageFeature::DEPTH_STENCIL_ATTACHMENT),
|
||||
texture_d24_s8: phd
|
||||
.format_properties(Some(hal::format::Format::D24UnormS8Uint))
|
||||
.optimal_tiling
|
||||
|
||||
@@ -199,6 +199,7 @@ struct Stored<T> {
|
||||
struct PrivateFeatures {
|
||||
shader_validation: bool,
|
||||
anisotropic_filtering: bool,
|
||||
texture_d24: bool,
|
||||
texture_d24_s8: bool,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user