mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-25 16:24:24 +00:00
Add SHADERINT_16
feature to allow 16bit ints in Vulkan shaders (#3401)
* add support for vulkan SHADER_INT16 * changelog * deno shader-i16 * better INT16 docs Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com> * fix typo --------- Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
This commit is contained in:
parent
2562f323bb
commit
c5e2f5a7b9
@ -264,6 +264,10 @@ By @jimblandy in [#3254](https://github.com/gfx-rs/wgpu/pull/3254).
|
||||
- Support alpha to coverage. By @Wumpf in [#3156](https://github.com/gfx-rs/wgpu/pull/3156)
|
||||
- Support filtering f32 textures. By @expenses in [#3261](https://github.com/gfx-rs/wgpu/pull/3261)
|
||||
|
||||
#### Vulkan
|
||||
|
||||
- Add `SHADER_INT16` feature to enable the `shaderInt16` VkPhysicalDeviceFeature. By @Elabajaba in [#3401](https://github.com/gfx-rs/wgpu/pull/3401)
|
||||
|
||||
#### WebGPU
|
||||
|
||||
- Add `MULTISAMPLE_X2`, `MULTISAMPLE_X4` and `MULTISAMPLE_X8` to `TextureFormatFeatureFlags`. By @39ali in [3140](https://github.com/gfx-rs/wgpu/pull/3140)
|
||||
|
@ -134,6 +134,7 @@
|
||||
"clear-commands",
|
||||
"spirv-shader-passthrough",
|
||||
"shader-primitive-index",
|
||||
"shader-i16",
|
||||
],
|
||||
);
|
||||
|
||||
|
@ -164,7 +164,7 @@ fn deserialize_features(features: &wgpu_types::Features) -> Vec<&'static str> {
|
||||
return_features.push("indirect-first-instance");
|
||||
}
|
||||
if features.contains(wgpu_types::Features::SHADER_FLOAT16) {
|
||||
return_features.push("shader-f16")
|
||||
return_features.push("shader-f16");
|
||||
}
|
||||
|
||||
// extended from spec
|
||||
@ -214,6 +214,9 @@ fn deserialize_features(features: &wgpu_types::Features) -> Vec<&'static str> {
|
||||
if features.contains(wgpu_types::Features::PARTIALLY_BOUND_BINDING_ARRAY) {
|
||||
return_features.push("shader-primitive-index");
|
||||
}
|
||||
if features.contains(wgpu_types::Features::SHADER_INT16) {
|
||||
return_features.push("shader-i16");
|
||||
}
|
||||
|
||||
return_features
|
||||
}
|
||||
@ -380,6 +383,10 @@ impl From<GpuRequiredFeatures> for wgpu_types::Features {
|
||||
wgpu_types::Features::SHADER_FLOAT64,
|
||||
required_features.0.contains("shader-float64"),
|
||||
);
|
||||
features.set(
|
||||
wgpu_types::Features::SHADER_INT16,
|
||||
required_features.0.contains("shader-i16"),
|
||||
);
|
||||
features.set(
|
||||
wgpu_types::Features::VERTEX_ATTRIBUTE_64BIT,
|
||||
required_features.0.contains("vertex-attribute-64bit"),
|
||||
|
@ -176,7 +176,7 @@ impl PhysicalDeviceFeatures {
|
||||
//.shader_cull_distance(requested_features.contains(wgt::Features::SHADER_CULL_DISTANCE))
|
||||
.shader_float64(requested_features.contains(wgt::Features::SHADER_FLOAT64))
|
||||
//.shader_int64(requested_features.contains(wgt::Features::SHADER_INT64))
|
||||
//.shader_int16(requested_features.contains(wgt::Features::SHADER_INT16))
|
||||
.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(),
|
||||
@ -420,7 +420,7 @@ impl PhysicalDeviceFeatures {
|
||||
//if self.core.shader_cull_distance != 0 {
|
||||
features.set(F::SHADER_FLOAT64, self.core.shader_float64 != 0);
|
||||
//if self.core.shader_int64 != 0 {
|
||||
//if self.core.shader_int16 != 0 {
|
||||
features.set(F::SHADER_INT16, self.core.shader_int16 != 0);
|
||||
|
||||
//if caps.supports_extension(vk::KhrSamplerMirrorClampToEdgeFn::name()) {
|
||||
//if caps.supports_extension(vk::ExtSamplerFilterMinmaxFn::name()) {
|
||||
|
@ -674,6 +674,13 @@ bitflags::bitflags! {
|
||||
/// - DX12
|
||||
/// - Metal (Intel and AMD GPUs)
|
||||
const WRITE_TIMESTAMP_INSIDE_PASSES = 1 << 41;
|
||||
/// Allows shaders to use i16. Not currently supported in naga, only available through `spirv-passthrough`.
|
||||
///
|
||||
/// Supported platforms:
|
||||
/// - Vulkan
|
||||
///
|
||||
/// This is a native-only feature.
|
||||
const SHADER_INT16 = 1 << 42;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user