mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-26 00:33:51 +00:00
Implement Feature::SHADER_PRIMITIVE_INDEX
on Vulkan
This commit is contained in:
parent
22139c6a46
commit
0db00e9657
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -1051,7 +1051,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "naga"
|
||||
version = "0.5.0"
|
||||
source = "git+https://github.com/gfx-rs/naga?rev=458db0b#458db0b5228854dc417283f4b9742e03f25bc492"
|
||||
source = "git+https://github.com/gfx-rs/naga?rev=8f71a36#8f71a368eff3a18fd348ab6193cb183df0f49f95"
|
||||
dependencies = [
|
||||
"bit-set",
|
||||
"bitflags",
|
||||
|
@ -36,7 +36,7 @@ thiserror = "1"
|
||||
|
||||
[dependencies.naga]
|
||||
git = "https://github.com/gfx-rs/naga"
|
||||
rev = "458db0b"
|
||||
rev = "8f71a36"
|
||||
features = ["wgsl-in"]
|
||||
|
||||
[dependencies.wgt]
|
||||
|
@ -898,6 +898,11 @@ impl<A: HalApi> Device<A> {
|
||||
Caps::FLOAT64,
|
||||
self.features.contains(wgt::Features::SHADER_FLOAT64),
|
||||
);
|
||||
caps.set(
|
||||
Caps::PRIMITIVE_INDEX,
|
||||
self.features
|
||||
.contains(wgt::Features::SHADER_PRIMITIVE_INDEX),
|
||||
);
|
||||
let info = naga::valid::Validator::new(naga::valid::ValidationFlags::all(), caps)
|
||||
.validate(&module)?;
|
||||
let interface = validation::Interface::new(&module, &info, self.features);
|
||||
|
@ -65,11 +65,11 @@ core-graphics-types = "0.1"
|
||||
|
||||
[dependencies.naga]
|
||||
git = "https://github.com/gfx-rs/naga"
|
||||
rev = "458db0b"
|
||||
rev = "8f71a36"
|
||||
|
||||
[dev-dependencies.naga]
|
||||
git = "https://github.com/gfx-rs/naga"
|
||||
rev = "458db0b"
|
||||
rev = "8f71a36"
|
||||
features = ["wgsl-in"]
|
||||
|
||||
[dev-dependencies]
|
||||
|
@ -125,6 +125,7 @@ impl PhysicalDeviceFeatures {
|
||||
//.shader_int64(requested_features.contains(wgt::Features::SHADER_INT64))
|
||||
//.shader_int16(requested_features.contains(wgt::Features::SHADER_INT16))
|
||||
//.shader_resource_residency(requested_features.contains(wgt::Features::SHADER_RESOURCE_RESIDENCY))
|
||||
.geometry_shader(requested_features.contains(wgt::Features::SHADER_PRIMITIVE_INDEX))
|
||||
.build(),
|
||||
vulkan_1_2: if api_version >= vk::API_VERSION_1_2 {
|
||||
Some(
|
||||
@ -290,6 +291,7 @@ impl PhysicalDeviceFeatures {
|
||||
F::TEXTURE_BINDING_ARRAY,
|
||||
self.core.shader_sampled_image_array_dynamic_indexing != 0,
|
||||
);
|
||||
features.set(F::SHADER_PRIMITIVE_INDEX, self.core.geometry_shader != 0);
|
||||
if Self::all_features_supported(
|
||||
&features,
|
||||
&[
|
||||
|
@ -479,6 +479,17 @@ bitflags::bitflags! {
|
||||
///
|
||||
/// This is a native only feature.
|
||||
const SPIRV_SHADER_PASSTHROUGH = 0x0000_0800_0000_0000;
|
||||
/// Enables `builtin(primitive_index)` in fragment shaders.
|
||||
///
|
||||
/// Note: enables geometry processing for pipelines using the builtin.
|
||||
/// This may come with a significant performance impact on some hardware.
|
||||
/// Other pipelines are not affected.
|
||||
///
|
||||
/// Supported platforms:
|
||||
/// - Vulkan
|
||||
///
|
||||
/// This is a native only feature.
|
||||
const SHADER_PRIMITIVE_INDEX = 0x0000_1000_0000_0000;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -73,13 +73,13 @@ env_logger = "0.8"
|
||||
|
||||
[dependencies.naga]
|
||||
git = "https://github.com/gfx-rs/naga"
|
||||
rev = "458db0b"
|
||||
rev = "8f71a36"
|
||||
optional = true
|
||||
|
||||
# used to test all the example shaders
|
||||
[dev-dependencies.naga]
|
||||
git = "https://github.com/gfx-rs/naga"
|
||||
rev = "458db0b"
|
||||
rev = "8f71a36"
|
||||
features = ["wgsl-in"]
|
||||
|
||||
[[example]]
|
||||
|
Loading…
Reference in New Issue
Block a user