mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-22 14:55:05 +00:00
Merge #958
958: [0.6] fix device feature requests r=cwfitzgerald a=kvark **Connections** Looks like we were requesting a little bit too much? Also includes #936 and #957 **Description** Fix the features requested. **Testing** Confirmed by the virtue of `println!` :) Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com> Co-authored-by: Kunal Mohan <kunalmohan99@gmail.com>
This commit is contained in:
commit
3a62c24400
@ -1,5 +1,10 @@
|
|||||||
# Change Log
|
# 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)
|
## wgpu-core-0.6.3 (2020-09-04)
|
||||||
- fix group bindings that aren't related to the current pipeline
|
- fix group bindings that aren't related to the current pipeline
|
||||||
|
|
||||||
|
6
Cargo.lock
generated
6
Cargo.lock
generated
@ -389,9 +389,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "generator"
|
name = "generator"
|
||||||
version = "0.6.21"
|
version = "0.6.22"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "add72f17bb81521258fcc8a7a3245b1e184e916bfbe34f0ea89558f440df5c68"
|
checksum = "f5e13c8f4607ff74f6d0fa37007cb95492531333f46bb9744f772d9e7830855c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cc",
|
"cc",
|
||||||
"libc",
|
"libc",
|
||||||
@ -1619,7 +1619,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wgpu-core"
|
name = "wgpu-core"
|
||||||
version = "0.6.3"
|
version = "0.6.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arrayvec",
|
"arrayvec",
|
||||||
"bitflags",
|
"bitflags",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "wgpu-core"
|
name = "wgpu-core"
|
||||||
version = "0.6.3"
|
version = "0.6.4"
|
||||||
authors = ["wgpu developers"]
|
authors = ["wgpu developers"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
description = "WebGPU core logic on gfx-hal"
|
description = "WebGPU core logic on gfx-hal"
|
||||||
|
@ -1226,6 +1226,16 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
|||||||
let device = device_guard
|
let device = device_guard
|
||||||
.get(device_id)
|
.get(device_id)
|
||||||
.map_err(|_| DeviceError::Invalid)?;
|
.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 texture = device.create_texture(device_id, desc)?;
|
||||||
let num_levels = texture.full_range.levels.end;
|
let num_levels = texture.full_range.levels.end;
|
||||||
let num_layers = texture.full_range.layers.end;
|
let num_layers = texture.full_range.layers.end;
|
||||||
@ -1240,15 +1250,6 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
|||||||
None => (),
|
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
|
device
|
||||||
.trackers
|
.trackers
|
||||||
.lock()
|
.lock()
|
||||||
|
@ -289,7 +289,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
|||||||
None => {}
|
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");
|
tracing::trace!("Ignoring write_texture of size 0");
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
@ -648,7 +648,8 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
|||||||
let available_features = adapter.raw.physical_device.features();
|
let available_features = adapter.raw.physical_device.features();
|
||||||
|
|
||||||
// Check features that are always needed
|
// 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::FRAGMENT_STORES_AND_ATOMICS
|
||||||
| hal::Features::NDC_Y_UP
|
| hal::Features::NDC_Y_UP
|
||||||
| hal::Features::INDEPENDENT_BLENDING
|
| hal::Features::INDEPENDENT_BLENDING
|
||||||
@ -657,7 +658,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
|||||||
let mut enabled_features = available_features & wishful_features;
|
let mut enabled_features = available_features & wishful_features;
|
||||||
if enabled_features != wishful_features {
|
if enabled_features != wishful_features {
|
||||||
tracing::warn!(
|
tracing::warn!(
|
||||||
"Missing features: {:?}",
|
"Missing internal features: {:?}",
|
||||||
wishful_features - enabled_features
|
wishful_features - enabled_features
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -665,44 +666,30 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
|||||||
// Features
|
// Features
|
||||||
enabled_features.set(
|
enabled_features.set(
|
||||||
hal::Features::TEXTURE_DESCRIPTOR_ARRAY,
|
hal::Features::TEXTURE_DESCRIPTOR_ARRAY,
|
||||||
adapter
|
desc.features
|
||||||
.features
|
|
||||||
.contains(wgt::Features::SAMPLED_TEXTURE_BINDING_ARRAY),
|
.contains(wgt::Features::SAMPLED_TEXTURE_BINDING_ARRAY),
|
||||||
);
|
);
|
||||||
enabled_features.set(
|
enabled_features.set(
|
||||||
hal::Features::SHADER_SAMPLED_IMAGE_ARRAY_DYNAMIC_INDEXING,
|
hal::Features::SHADER_SAMPLED_IMAGE_ARRAY_DYNAMIC_INDEXING,
|
||||||
adapter
|
desc.features
|
||||||
.features
|
|
||||||
.contains(wgt::Features::SAMPLED_TEXTURE_ARRAY_DYNAMIC_INDEXING),
|
|
||||||
);
|
|
||||||
enabled_features.set(
|
|
||||||
hal::Features::SHADER_SAMPLED_IMAGE_ARRAY_DYNAMIC_INDEXING,
|
|
||||||
adapter
|
|
||||||
.features
|
|
||||||
.contains(wgt::Features::SAMPLED_TEXTURE_ARRAY_DYNAMIC_INDEXING),
|
.contains(wgt::Features::SAMPLED_TEXTURE_ARRAY_DYNAMIC_INDEXING),
|
||||||
);
|
);
|
||||||
enabled_features.set(
|
enabled_features.set(
|
||||||
hal::Features::SAMPLED_TEXTURE_DESCRIPTOR_INDEXING,
|
hal::Features::SAMPLED_TEXTURE_DESCRIPTOR_INDEXING,
|
||||||
adapter
|
desc.features
|
||||||
.features
|
|
||||||
.contains(wgt::Features::SAMPLED_TEXTURE_ARRAY_NON_UNIFORM_INDEXING),
|
.contains(wgt::Features::SAMPLED_TEXTURE_ARRAY_NON_UNIFORM_INDEXING),
|
||||||
);
|
);
|
||||||
enabled_features.set(
|
enabled_features.set(
|
||||||
hal::Features::UNSIZED_DESCRIPTOR_ARRAY,
|
hal::Features::UNSIZED_DESCRIPTOR_ARRAY,
|
||||||
adapter
|
desc.features.contains(wgt::Features::UNSIZED_BINDING_ARRAY),
|
||||||
.features
|
|
||||||
.contains(wgt::Features::UNSIZED_BINDING_ARRAY),
|
|
||||||
);
|
);
|
||||||
enabled_features.set(
|
enabled_features.set(
|
||||||
hal::Features::MULTI_DRAW_INDIRECT,
|
hal::Features::MULTI_DRAW_INDIRECT,
|
||||||
adapter
|
desc.features.contains(wgt::Features::MULTI_DRAW_INDIRECT),
|
||||||
.features
|
|
||||||
.contains(wgt::Features::MULTI_DRAW_INDIRECT),
|
|
||||||
);
|
);
|
||||||
enabled_features.set(
|
enabled_features.set(
|
||||||
hal::Features::DRAW_INDIRECT_COUNT,
|
hal::Features::DRAW_INDIRECT_COUNT,
|
||||||
adapter
|
desc.features
|
||||||
.features
|
|
||||||
.contains(wgt::Features::MULTI_DRAW_INDIRECT_COUNT),
|
.contains(wgt::Features::MULTI_DRAW_INDIRECT_COUNT),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user