mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-25 00:03:29 +00:00
Merge #1419
1419: Skip the cube compatibility on a downlevel flag r=cwfitzgerald a=kvark **Connections** Fixes #1418 **Description** Adds a downlevel flag for cube arrays, checks for it. **Testing** Untested, but should work. Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
This commit is contained in:
commit
eadaa1b7d8
@ -681,7 +681,14 @@ impl<B: GfxBackend> Device<B> {
|
||||
let mut view_caps = hal::image::ViewCapabilities::empty();
|
||||
// 2D textures with array layer counts that are multiples of 6 could be cubemaps
|
||||
// Following gpuweb/gpuweb#68 always add the hint in that case
|
||||
if desc.dimension == TextureDimension::D2 && desc.size.depth_or_array_layers % 6 == 0 {
|
||||
if desc.dimension == TextureDimension::D2
|
||||
&& desc.size.depth_or_array_layers % 6 == 0
|
||||
&& (desc.size.depth_or_array_layers == 6
|
||||
|| self
|
||||
.downlevel
|
||||
.flags
|
||||
.contains(wgt::DownlevelFlags::CUBE_ARRAY_TEXTURES))
|
||||
{
|
||||
view_caps |= hal::image::ViewCapabilities::KIND_CUBE;
|
||||
};
|
||||
|
||||
|
@ -753,7 +753,8 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
log::trace!("Device after submission {}: {:#?}", submit_index, trackers);
|
||||
drop(trackers);
|
||||
if !required_buffer_inits.map.is_empty() {
|
||||
device.initialize_buffer_memory(required_buffer_inits, &mut *buffer_guard)?;
|
||||
device
|
||||
.initialize_buffer_memory(required_buffer_inits, &mut *buffer_guard)?;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -322,6 +322,10 @@ impl<B: GfxBackend> Adapter<B> {
|
||||
wgt::DownlevelFlags::NON_POWER_OF_TWO_MIPMAPPED_TEXTURES,
|
||||
properties.downlevel.non_power_of_two_mipmapped_textures,
|
||||
);
|
||||
downlevel_flags.set(
|
||||
wgt::DownlevelFlags::CUBE_ARRAY_TEXTURES,
|
||||
adapter_features.contains(hal::Features::IMAGE_CUBE_ARRAY),
|
||||
);
|
||||
downlevel_flags.set(
|
||||
wgt::DownlevelFlags::ANISOTROPIC_FILTERING,
|
||||
private_features.anisotropic_filtering,
|
||||
|
@ -693,8 +693,10 @@ bitflags::bitflags! {
|
||||
const DEVICE_LOCAL_IMAGE_COPIES = 0x0000_0008;
|
||||
/// Supports textures with mipmaps which have a non power of two size.
|
||||
const NON_POWER_OF_TWO_MIPMAPPED_TEXTURES = 0x0000_0010;
|
||||
/// Supports textures that are cube arrays.
|
||||
const CUBE_ARRAY_TEXTURES = 0x0000_0020;
|
||||
/// Supports samplers with anisotropic filtering
|
||||
const ANISOTROPIC_FILTERING = 0x0000_0020;
|
||||
const ANISOTROPIC_FILTERING = 0x0001_0000;
|
||||
/// All flags are in their compliant state.
|
||||
const COMPLIANT = 0x0000_003F;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user