diff --git a/CHANGELOG.md b/CHANGELOG.md index 6fef82531..9e4cc7947 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Change Log +## wgpu-core-0.6.4 (2020-10-05) + - don't request device features that aren't needed + - fix texture depth == 0 checks + - fix the order of texture feature checks + ## wgpu-core-0.6.3 (2020-09-04) - fix group bindings that aren't related to the current pipeline diff --git a/Cargo.lock b/Cargo.lock index 8276797b4..def87599f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -389,9 +389,9 @@ dependencies = [ [[package]] name = "generator" -version = "0.6.21" +version = "0.6.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "add72f17bb81521258fcc8a7a3245b1e184e916bfbe34f0ea89558f440df5c68" +checksum = "f5e13c8f4607ff74f6d0fa37007cb95492531333f46bb9744f772d9e7830855c" dependencies = [ "cc", "libc", @@ -1619,7 +1619,7 @@ dependencies = [ [[package]] name = "wgpu-core" -version = "0.6.3" +version = "0.6.4" dependencies = [ "arrayvec", "bitflags", diff --git a/wgpu-core/Cargo.toml b/wgpu-core/Cargo.toml index 9592b6ad4..1ed57474a 100644 --- a/wgpu-core/Cargo.toml +++ b/wgpu-core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "wgpu-core" -version = "0.6.3" +version = "0.6.4" authors = ["wgpu developers"] edition = "2018" description = "WebGPU core logic on gfx-hal" diff --git a/wgpu-core/src/device/mod.rs b/wgpu-core/src/device/mod.rs index 173551dcf..b81a742a2 100644 --- a/wgpu-core/src/device/mod.rs +++ b/wgpu-core/src/device/mod.rs @@ -1226,6 +1226,16 @@ impl Global { let device = device_guard .get(device_id) .map_err(|_| DeviceError::Invalid)?; + + let texture_features = conv::texture_features(desc.format); + if texture_features != wgt::Features::empty() && !device.features.contains(texture_features) + { + return Err(resource::CreateTextureError::MissingFeature( + texture_features, + desc.format, + )); + } + let texture = device.create_texture(device_id, desc)?; let num_levels = texture.full_range.levels.end; let num_layers = texture.full_range.layers.end; @@ -1240,15 +1250,6 @@ impl Global { None => (), }; - let texture_features = conv::texture_features(desc.format); - if texture_features != wgt::Features::empty() && !device.features.contains(texture_features) - { - return Err(resource::CreateTextureError::MissingFeature( - texture_features, - desc.format, - )); - } - device .trackers .lock() diff --git a/wgpu-core/src/device/queue.rs b/wgpu-core/src/device/queue.rs index 20fd27c58..f5ae7f2f2 100644 --- a/wgpu-core/src/device/queue.rs +++ b/wgpu-core/src/device/queue.rs @@ -289,7 +289,7 @@ impl Global { None => {} } - if size.width == 0 || size.height == 0 || size.width == 0 { + if size.width == 0 || size.height == 0 || size.depth == 0 { tracing::trace!("Ignoring write_texture of size 0"); return Ok(()); } diff --git a/wgpu-core/src/instance.rs b/wgpu-core/src/instance.rs index da7b9779b..700b9c930 100644 --- a/wgpu-core/src/instance.rs +++ b/wgpu-core/src/instance.rs @@ -648,7 +648,8 @@ impl Global { let available_features = adapter.raw.physical_device.features(); // Check features that are always needed - let wishful_features = hal::Features::VERTEX_STORES_AND_ATOMICS + let wishful_features = hal::Features::ROBUST_BUFFER_ACCESS + | hal::Features::VERTEX_STORES_AND_ATOMICS | hal::Features::FRAGMENT_STORES_AND_ATOMICS | hal::Features::NDC_Y_UP | hal::Features::INDEPENDENT_BLENDING @@ -657,7 +658,7 @@ impl Global { let mut enabled_features = available_features & wishful_features; if enabled_features != wishful_features { tracing::warn!( - "Missing features: {:?}", + "Missing internal features: {:?}", wishful_features - enabled_features ); } @@ -665,44 +666,30 @@ impl Global { // Features enabled_features.set( hal::Features::TEXTURE_DESCRIPTOR_ARRAY, - adapter - .features + desc.features .contains(wgt::Features::SAMPLED_TEXTURE_BINDING_ARRAY), ); enabled_features.set( hal::Features::SHADER_SAMPLED_IMAGE_ARRAY_DYNAMIC_INDEXING, - adapter - .features - .contains(wgt::Features::SAMPLED_TEXTURE_ARRAY_DYNAMIC_INDEXING), - ); - enabled_features.set( - hal::Features::SHADER_SAMPLED_IMAGE_ARRAY_DYNAMIC_INDEXING, - adapter - .features + desc.features .contains(wgt::Features::SAMPLED_TEXTURE_ARRAY_DYNAMIC_INDEXING), ); enabled_features.set( hal::Features::SAMPLED_TEXTURE_DESCRIPTOR_INDEXING, - adapter - .features + desc.features .contains(wgt::Features::SAMPLED_TEXTURE_ARRAY_NON_UNIFORM_INDEXING), ); enabled_features.set( hal::Features::UNSIZED_DESCRIPTOR_ARRAY, - adapter - .features - .contains(wgt::Features::UNSIZED_BINDING_ARRAY), + desc.features.contains(wgt::Features::UNSIZED_BINDING_ARRAY), ); enabled_features.set( hal::Features::MULTI_DRAW_INDIRECT, - adapter - .features - .contains(wgt::Features::MULTI_DRAW_INDIRECT), + desc.features.contains(wgt::Features::MULTI_DRAW_INDIRECT), ); enabled_features.set( hal::Features::DRAW_INDIRECT_COUNT, - adapter - .features + desc.features .contains(wgt::Features::MULTI_DRAW_INDIRECT_COUNT), );