mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-25 08:13:27 +00:00
Make Features fit in 64 bits again (#5268)
This commit is contained in:
parent
a302c8da82
commit
a016a3aaec
@ -246,7 +246,7 @@ bitflags::bitflags! {
|
||||
#[repr(transparent)]
|
||||
#[derive(Default)]
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
||||
pub struct Features: u128 { // TODO(https://github.com/gfx-rs/wgpu/issues/5247): consider making this an `enumset`
|
||||
pub struct Features: u64 {
|
||||
//
|
||||
// ---- Start numbering at 1 << 0 ----
|
||||
//
|
||||
@ -267,6 +267,64 @@ bitflags::bitflags! {
|
||||
///
|
||||
/// This is a web and native feature.
|
||||
const DEPTH_CLIP_CONTROL = 1 << 0;
|
||||
|
||||
/// Allows for explicit creation of textures of format [`TextureFormat::Depth32FloatStencil8`]
|
||||
///
|
||||
/// Supported platforms:
|
||||
/// - Vulkan (mostly)
|
||||
/// - DX12
|
||||
/// - Metal
|
||||
///
|
||||
/// This is a web and native feature.
|
||||
const DEPTH32FLOAT_STENCIL8 = 1 << 1;
|
||||
|
||||
/// Enables BCn family of compressed textures. All BCn textures use 4x4 pixel blocks
|
||||
/// with 8 or 16 bytes per block.
|
||||
///
|
||||
/// Compressed textures sacrifice some quality in exchange for significantly reduced
|
||||
/// bandwidth usage.
|
||||
///
|
||||
/// Support for this feature guarantees availability of [`TextureUsages::COPY_SRC | TextureUsages::COPY_DST | TextureUsages::TEXTURE_BINDING`] for BCn formats.
|
||||
/// [`Features::TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES`] may enable additional usages.
|
||||
///
|
||||
/// Supported Platforms:
|
||||
/// - desktops
|
||||
///
|
||||
/// This is a web and native feature.
|
||||
const TEXTURE_COMPRESSION_BC = 1 << 2;
|
||||
|
||||
/// Enables ETC family of compressed textures. All ETC textures use 4x4 pixel blocks.
|
||||
/// ETC2 RGB and RGBA1 are 8 bytes per block. RTC2 RGBA8 and EAC are 16 bytes per block.
|
||||
///
|
||||
/// Compressed textures sacrifice some quality in exchange for significantly reduced
|
||||
/// bandwidth usage.
|
||||
///
|
||||
/// Support for this feature guarantees availability of [`TextureUsages::COPY_SRC | TextureUsages::COPY_DST | TextureUsages::TEXTURE_BINDING`] for ETC2 formats.
|
||||
/// [`Features::TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES`] may enable additional usages.
|
||||
///
|
||||
/// Supported Platforms:
|
||||
/// - Vulkan on Intel
|
||||
/// - Mobile (some)
|
||||
///
|
||||
/// This is a web and native feature.
|
||||
const TEXTURE_COMPRESSION_ETC2 = 1 << 3;
|
||||
|
||||
/// Enables ASTC family of compressed textures. ASTC textures use pixel blocks varying from 4x4 to 12x12.
|
||||
/// Blocks are always 16 bytes.
|
||||
///
|
||||
/// Compressed textures sacrifice some quality in exchange for significantly reduced
|
||||
/// bandwidth usage.
|
||||
///
|
||||
/// Support for this feature guarantees availability of [`TextureUsages::COPY_SRC | TextureUsages::COPY_DST | TextureUsages::TEXTURE_BINDING`] for ASTC formats with Unorm/UnormSrgb channel type.
|
||||
/// [`Features::TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES`] may enable additional usages.
|
||||
///
|
||||
/// Supported Platforms:
|
||||
/// - Vulkan on Intel
|
||||
/// - Mobile (some)
|
||||
///
|
||||
/// This is a web and native feature.
|
||||
const TEXTURE_COMPRESSION_ASTC = 1 << 4;
|
||||
|
||||
/// Enables use of Timestamp Queries. These queries tell the current gpu timestamp when
|
||||
/// all work before the query is finished.
|
||||
///
|
||||
@ -289,7 +347,8 @@ bitflags::bitflags! {
|
||||
/// - Metal
|
||||
///
|
||||
/// This is a web and native feature.
|
||||
const TIMESTAMP_QUERY = 1 << 1;
|
||||
const TIMESTAMP_QUERY = 1 << 5;
|
||||
|
||||
/// Allows non-zero value for the `first_instance` member in indirect draw calls.
|
||||
///
|
||||
/// If this feature is not enabled, and the `first_instance` member is non-zero, the behavior may be:
|
||||
@ -307,11 +366,7 @@ bitflags::bitflags! {
|
||||
/// - OpenGL ES / WebGL
|
||||
///
|
||||
/// This is a web and native feature.
|
||||
const INDIRECT_FIRST_INSTANCE = 1 << 2;
|
||||
|
||||
// 3..8 available
|
||||
|
||||
// Shader:
|
||||
const INDIRECT_FIRST_INSTANCE = 1 << 6;
|
||||
|
||||
/// Allows shaders to acquire the FP16 ability
|
||||
///
|
||||
@ -322,18 +377,18 @@ bitflags::bitflags! {
|
||||
/// - Metal
|
||||
///
|
||||
/// This is a web and native feature.
|
||||
const SHADER_F16 = 1 << 8;
|
||||
const SHADER_F16 = 1 << 7;
|
||||
|
||||
// 9..14 available
|
||||
|
||||
// Texture Formats:
|
||||
|
||||
// The features starting with a ? are features that might become part of the spec or
|
||||
// at the very least we can implement as native features; since they should cover all
|
||||
// possible formats and capabilities across backends.
|
||||
//
|
||||
// ? const FORMATS_TIER_1 = 1 << 14; (https://github.com/gpuweb/gpuweb/issues/3837)
|
||||
// ? const RW_STORAGE_TEXTURE_TIER_1 = 1 << 15; (https://github.com/gpuweb/gpuweb/issues/3838)
|
||||
/// Allows for usage of textures of format [`TextureFormat::Rg11b10Float`] as a render target
|
||||
///
|
||||
/// Supported platforms:
|
||||
/// - Vulkan
|
||||
/// - DX12
|
||||
/// - Metal
|
||||
///
|
||||
/// This is a web and native feature.
|
||||
const RG11B10UFLOAT_RENDERABLE = 1 << 8;
|
||||
|
||||
/// Allows the [`wgpu::TextureUsages::STORAGE_BINDING`] usage on textures with format [`TextureFormat::Bgra8unorm`]
|
||||
///
|
||||
@ -343,10 +398,8 @@ bitflags::bitflags! {
|
||||
/// - Metal
|
||||
///
|
||||
/// This is a web and native feature.
|
||||
const BGRA8UNORM_STORAGE = 1 << 16;
|
||||
const BGRA8UNORM_STORAGE = 1 << 9;
|
||||
|
||||
// ? const NORM16_FILTERABLE = 1 << 17; (https://github.com/gpuweb/gpuweb/issues/3839)
|
||||
// ? const NORM16_RESOLVE = 1 << 18; (https://github.com/gpuweb/gpuweb/issues/3839)
|
||||
|
||||
/// Allows textures with formats "r32float", "rg32float", and "rgba32float" to be filterable.
|
||||
///
|
||||
@ -357,81 +410,11 @@ bitflags::bitflags! {
|
||||
/// - GL with one of `GL_ARB_color_buffer_float`/`GL_EXT_color_buffer_float`/`OES_texture_float_linear`
|
||||
///
|
||||
/// This is a web and native feature.
|
||||
const FLOAT32_FILTERABLE = 1 << 19;
|
||||
const FLOAT32_FILTERABLE = 1 << 10;
|
||||
|
||||
// ? const FLOAT32_BLENDABLE = 1 << 20; (https://github.com/gpuweb/gpuweb/issues/3556)
|
||||
// ? const 32BIT_FORMAT_MULTISAMPLE = 1 << 21; (https://github.com/gpuweb/gpuweb/issues/3844)
|
||||
// ? const 32BIT_FORMAT_RESOLVE = 1 << 22; (https://github.com/gpuweb/gpuweb/issues/3844)
|
||||
|
||||
/// Allows for usage of textures of format [`TextureFormat::Rg11b10Float`] as a render target
|
||||
///
|
||||
/// Supported platforms:
|
||||
/// - Vulkan
|
||||
/// - DX12
|
||||
/// - Metal
|
||||
///
|
||||
/// This is a web and native feature.
|
||||
const RG11B10UFLOAT_RENDERABLE = 1 << 23;
|
||||
|
||||
/// Allows for explicit creation of textures of format [`TextureFormat::Depth32FloatStencil8`]
|
||||
///
|
||||
/// Supported platforms:
|
||||
/// - Vulkan (mostly)
|
||||
/// - DX12
|
||||
/// - Metal
|
||||
///
|
||||
/// This is a web and native feature.
|
||||
const DEPTH32FLOAT_STENCIL8 = 1 << 24;
|
||||
/// Enables BCn family of compressed textures. All BCn textures use 4x4 pixel blocks
|
||||
/// with 8 or 16 bytes per block.
|
||||
///
|
||||
/// Compressed textures sacrifice some quality in exchange for significantly reduced
|
||||
/// bandwidth usage.
|
||||
///
|
||||
/// Support for this feature guarantees availability of [`TextureUsages::COPY_SRC | TextureUsages::COPY_DST | TextureUsages::TEXTURE_BINDING`] for BCn formats.
|
||||
/// [`Features::TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES`] may enable additional usages.
|
||||
///
|
||||
/// Supported Platforms:
|
||||
/// - desktops
|
||||
///
|
||||
/// This is a web and native feature.
|
||||
const TEXTURE_COMPRESSION_BC = 1 << 25;
|
||||
/// Enables ETC family of compressed textures. All ETC textures use 4x4 pixel blocks.
|
||||
/// ETC2 RGB and RGBA1 are 8 bytes per block. RTC2 RGBA8 and EAC are 16 bytes per block.
|
||||
///
|
||||
/// Compressed textures sacrifice some quality in exchange for significantly reduced
|
||||
/// bandwidth usage.
|
||||
///
|
||||
/// Support for this feature guarantees availability of [`TextureUsages::COPY_SRC | TextureUsages::COPY_DST | TextureUsages::TEXTURE_BINDING`] for ETC2 formats.
|
||||
/// [`Features::TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES`] may enable additional usages.
|
||||
///
|
||||
/// Supported Platforms:
|
||||
/// - Vulkan on Intel
|
||||
/// - Mobile (some)
|
||||
///
|
||||
/// This is a web and native feature.
|
||||
const TEXTURE_COMPRESSION_ETC2 = 1 << 26;
|
||||
/// Enables ASTC family of compressed textures. ASTC textures use pixel blocks varying from 4x4 to 12x12.
|
||||
/// Blocks are always 16 bytes.
|
||||
///
|
||||
/// Compressed textures sacrifice some quality in exchange for significantly reduced
|
||||
/// bandwidth usage.
|
||||
///
|
||||
/// Support for this feature guarantees availability of [`TextureUsages::COPY_SRC | TextureUsages::COPY_DST | TextureUsages::TEXTURE_BINDING`] for ASTC formats with Unorm/UnormSrgb channel type.
|
||||
/// [`Features::TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES`] may enable additional usages.
|
||||
///
|
||||
/// Supported Platforms:
|
||||
/// - Vulkan on Intel
|
||||
/// - Mobile (some)
|
||||
///
|
||||
/// This is a web and native feature.
|
||||
const TEXTURE_COMPRESSION_ASTC = 1 << 27;
|
||||
|
||||
// ? const TEXTURE_COMPRESSION_ASTC_HDR = 1 << 28; (https://github.com/gpuweb/gpuweb/issues/3856)
|
||||
|
||||
// 29..32 should be available but are for now occupied by native only texture related features
|
||||
// TEXTURE_FORMAT_16BIT_NORM & TEXTURE_COMPRESSION_ASTC_HDR will most likely become web features as well
|
||||
// TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES might not be necessary if we have all the texture features implemented
|
||||
// Bits 11-19 available for webgpu features. Should you chose to use some of them for
|
||||
// for native features, don't forget to update `all_webgpu_mask` and `all_native_mask`
|
||||
// accordingly.
|
||||
|
||||
//
|
||||
// ---- Restart Numbering for Native Features ---
|
||||
@ -439,6 +422,21 @@ bitflags::bitflags! {
|
||||
// Native Features:
|
||||
//
|
||||
|
||||
// The features starting with a ? are features that might become part of the spec or
|
||||
// at the very least we can implement as native features; since they should cover all
|
||||
// possible formats and capabilities across backends.
|
||||
//
|
||||
// ? const FORMATS_TIER_1 = 1 << ??; (https://github.com/gpuweb/gpuweb/issues/3837)
|
||||
// ? const RW_STORAGE_TEXTURE_TIER_1 = 1 << ??; (https://github.com/gpuweb/gpuweb/issues/3838)
|
||||
// ? const NORM16_FILTERABLE = 1 << ??; (https://github.com/gpuweb/gpuweb/issues/3839)
|
||||
// ? const NORM16_RESOLVE = 1 << ??; (https://github.com/gpuweb/gpuweb/issues/3839)
|
||||
// ? const FLOAT32_BLENDABLE = 1 << ??; (https://github.com/gpuweb/gpuweb/issues/3556)
|
||||
// ? const 32BIT_FORMAT_MULTISAMPLE = 1 << ??; (https://github.com/gpuweb/gpuweb/issues/3844)
|
||||
// ? const 32BIT_FORMAT_RESOLVE = 1 << ??; (https://github.com/gpuweb/gpuweb/issues/3844)
|
||||
// ? const TEXTURE_COMPRESSION_ASTC_HDR = 1 << ??; (https://github.com/gpuweb/gpuweb/issues/3856)
|
||||
// TEXTURE_FORMAT_16BIT_NORM & TEXTURE_COMPRESSION_ASTC_HDR will most likely become web features as well
|
||||
// TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES might not be necessary if we have all the texture features implemented
|
||||
|
||||
// Texture Formats:
|
||||
|
||||
/// Enables normalized `16-bit` texture formats.
|
||||
@ -449,7 +447,7 @@ bitflags::bitflags! {
|
||||
/// - Metal
|
||||
///
|
||||
/// This is a native only feature.
|
||||
const TEXTURE_FORMAT_16BIT_NORM = 1 << 29;
|
||||
const TEXTURE_FORMAT_16BIT_NORM = 1 << 20;
|
||||
/// Enables ASTC HDR family of compressed textures.
|
||||
///
|
||||
/// Compressed textures sacrifice some quality in exchange for significantly reduced
|
||||
@ -464,7 +462,7 @@ bitflags::bitflags! {
|
||||
/// - OpenGL
|
||||
///
|
||||
/// This is a native only feature.
|
||||
const TEXTURE_COMPRESSION_ASTC_HDR = 1 << 30;
|
||||
const TEXTURE_COMPRESSION_ASTC_HDR = 1 << 21;
|
||||
/// Enables device specific texture format features.
|
||||
///
|
||||
/// See `TextureFormatFeatures` for a listing of the features in question.
|
||||
@ -476,7 +474,7 @@ bitflags::bitflags! {
|
||||
/// This extension does not enable additional formats.
|
||||
///
|
||||
/// This is a native only feature.
|
||||
const TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES = 1 << 31;
|
||||
const TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES = 1 << 22;
|
||||
|
||||
// API:
|
||||
|
||||
@ -492,7 +490,7 @@ bitflags::bitflags! {
|
||||
/// - DX12
|
||||
///
|
||||
/// This is a native only feature with a [proposal](https://github.com/gpuweb/gpuweb/blob/0008bd30da2366af88180b511a5d0d0c1dffbc36/proposals/pipeline-statistics-query.md) for the web.
|
||||
const PIPELINE_STATISTICS_QUERY = 1 << 32;
|
||||
const PIPELINE_STATISTICS_QUERY = 1 << 23;
|
||||
/// Allows for timestamp queries directly on command encoders.
|
||||
///
|
||||
/// Implies [`Features::TIMESTAMP_QUERY`] is supported.
|
||||
@ -506,7 +504,7 @@ bitflags::bitflags! {
|
||||
/// - Metal
|
||||
///
|
||||
/// This is a native only feature.
|
||||
const TIMESTAMP_QUERY_INSIDE_ENCODERS = 1 << 33;
|
||||
const TIMESTAMP_QUERY_INSIDE_ENCODERS = 1 << 24;
|
||||
/// Allows for timestamp queries directly on command encoders.
|
||||
///
|
||||
/// Implies [`Features::TIMESTAMP_QUERY`] & [`Features::TIMESTAMP_QUERY_INSIDE_ENCODERS`] is supported.
|
||||
@ -523,7 +521,7 @@ bitflags::bitflags! {
|
||||
/// This is generally not available on tile-based rasterization GPUs.
|
||||
///
|
||||
/// This is a native only feature with a [proposal](https://github.com/gpuweb/gpuweb/blob/0008bd30da2366af88180b511a5d0d0c1dffbc36/proposals/timestamp-query-inside-passes.md) for the web.
|
||||
const TIMESTAMP_QUERY_INSIDE_PASSES = 1 << 34;
|
||||
const TIMESTAMP_QUERY_INSIDE_PASSES = 1 << 25;
|
||||
/// Webgpu only allows the MAP_READ and MAP_WRITE buffer usage to be matched with
|
||||
/// COPY_DST and COPY_SRC respectively. This removes this requirement.
|
||||
///
|
||||
@ -537,7 +535,7 @@ bitflags::bitflags! {
|
||||
/// - Metal
|
||||
///
|
||||
/// This is a native only feature.
|
||||
const MAPPABLE_PRIMARY_BUFFERS = 1 << 35;
|
||||
const MAPPABLE_PRIMARY_BUFFERS = 1 << 26;
|
||||
/// Allows the user to create uniform arrays of textures in shaders:
|
||||
///
|
||||
/// ex.
|
||||
@ -560,7 +558,7 @@ bitflags::bitflags! {
|
||||
/// - Vulkan
|
||||
///
|
||||
/// This is a native only feature.
|
||||
const TEXTURE_BINDING_ARRAY = 1 << 36;
|
||||
const TEXTURE_BINDING_ARRAY = 1 << 27;
|
||||
/// Allows the user to create arrays of buffers in shaders:
|
||||
///
|
||||
/// ex.
|
||||
@ -582,7 +580,7 @@ bitflags::bitflags! {
|
||||
/// - Vulkan
|
||||
///
|
||||
/// This is a native only feature.
|
||||
const BUFFER_BINDING_ARRAY = 1 << 37;
|
||||
const BUFFER_BINDING_ARRAY = 1 << 28;
|
||||
/// Allows the user to create uniform arrays of storage buffers or textures in shaders,
|
||||
/// if resp. [`Features::BUFFER_BINDING_ARRAY`] or [`Features::TEXTURE_BINDING_ARRAY`]
|
||||
/// is supported.
|
||||
@ -595,7 +593,7 @@ bitflags::bitflags! {
|
||||
/// - Vulkan
|
||||
///
|
||||
/// This is a native only feature.
|
||||
const STORAGE_RESOURCE_BINDING_ARRAY = 1 << 38;
|
||||
const STORAGE_RESOURCE_BINDING_ARRAY = 1 << 29;
|
||||
/// Allows shaders to index sampled texture and storage buffer resource arrays with dynamically non-uniform values:
|
||||
///
|
||||
/// ex. `texture_array[vertex_data]`
|
||||
@ -620,7 +618,7 @@ bitflags::bitflags! {
|
||||
/// - Vulkan 1.2+ (or VK_EXT_descriptor_indexing)'s shaderSampledImageArrayNonUniformIndexing & shaderStorageBufferArrayNonUniformIndexing feature)
|
||||
///
|
||||
/// This is a native only feature.
|
||||
const SAMPLED_TEXTURE_AND_STORAGE_BUFFER_ARRAY_NON_UNIFORM_INDEXING = 1 << 39;
|
||||
const SAMPLED_TEXTURE_AND_STORAGE_BUFFER_ARRAY_NON_UNIFORM_INDEXING = 1 << 30;
|
||||
/// Allows shaders to index uniform buffer and storage texture resource arrays with dynamically non-uniform values:
|
||||
///
|
||||
/// ex. `texture_array[vertex_data]`
|
||||
@ -645,11 +643,11 @@ bitflags::bitflags! {
|
||||
/// - Vulkan 1.2+ (or VK_EXT_descriptor_indexing)'s shaderUniformBufferArrayNonUniformIndexing & shaderStorageTextureArrayNonUniformIndexing feature)
|
||||
///
|
||||
/// This is a native only feature.
|
||||
const UNIFORM_BUFFER_AND_STORAGE_TEXTURE_ARRAY_NON_UNIFORM_INDEXING = 1 << 40;
|
||||
const UNIFORM_BUFFER_AND_STORAGE_TEXTURE_ARRAY_NON_UNIFORM_INDEXING = 1 << 31;
|
||||
/// Allows the user to create bind groups containing arrays with less bindings than the BindGroupLayout.
|
||||
///
|
||||
/// This is a native only feature.
|
||||
const PARTIALLY_BOUND_BINDING_ARRAY = 1 << 41;
|
||||
const PARTIALLY_BOUND_BINDING_ARRAY = 1 << 32;
|
||||
/// Allows the user to call [`RenderPass::multi_draw_indirect`] and [`RenderPass::multi_draw_indexed_indirect`].
|
||||
///
|
||||
/// Allows multiple indirect calls to be dispatched from a single buffer.
|
||||
@ -663,7 +661,7 @@ bitflags::bitflags! {
|
||||
///
|
||||
/// [`RenderPass::multi_draw_indirect`]: ../wgpu/struct.RenderPass.html#method.multi_draw_indirect
|
||||
/// [`RenderPass::multi_draw_indexed_indirect`]: ../wgpu/struct.RenderPass.html#method.multi_draw_indexed_indirect
|
||||
const MULTI_DRAW_INDIRECT = 1 << 42;
|
||||
const MULTI_DRAW_INDIRECT = 1 << 33;
|
||||
/// Allows the user to call [`RenderPass::multi_draw_indirect_count`] and [`RenderPass::multi_draw_indexed_indirect_count`].
|
||||
///
|
||||
/// This allows the use of a buffer containing the actual number of draw calls.
|
||||
@ -676,7 +674,7 @@ bitflags::bitflags! {
|
||||
///
|
||||
/// [`RenderPass::multi_draw_indirect_count`]: ../wgpu/struct.RenderPass.html#method.multi_draw_indirect_count
|
||||
/// [`RenderPass::multi_draw_indexed_indirect_count`]: ../wgpu/struct.RenderPass.html#method.multi_draw_indexed_indirect_count
|
||||
const MULTI_DRAW_INDIRECT_COUNT = 1 << 43;
|
||||
const MULTI_DRAW_INDIRECT_COUNT = 1 << 34;
|
||||
/// Allows the use of push constants: small, fast bits of memory that can be updated
|
||||
/// inside a [`RenderPass`].
|
||||
///
|
||||
@ -696,7 +694,7 @@ bitflags::bitflags! {
|
||||
/// [`RenderPass`]: ../wgpu/struct.RenderPass.html
|
||||
/// [`PipelineLayoutDescriptor`]: ../wgpu/struct.PipelineLayoutDescriptor.html
|
||||
/// [`RenderPass::set_push_constants`]: ../wgpu/struct.RenderPass.html#method.set_push_constants
|
||||
const PUSH_CONSTANTS = 1 << 44;
|
||||
const PUSH_CONSTANTS = 1 << 35;
|
||||
/// Allows the use of [`AddressMode::ClampToBorder`] with a border color
|
||||
/// of [`SamplerBorderColor::Zero`].
|
||||
///
|
||||
@ -707,7 +705,7 @@ bitflags::bitflags! {
|
||||
/// - OpenGL
|
||||
///
|
||||
/// This is a native only feature.
|
||||
const ADDRESS_MODE_CLAMP_TO_ZERO = 1 << 45;
|
||||
const ADDRESS_MODE_CLAMP_TO_ZERO = 1 << 36;
|
||||
/// Allows the use of [`AddressMode::ClampToBorder`] with a border color
|
||||
/// other than [`SamplerBorderColor::Zero`].
|
||||
///
|
||||
@ -718,7 +716,7 @@ bitflags::bitflags! {
|
||||
/// - OpenGL
|
||||
///
|
||||
/// This is a native only feature.
|
||||
const ADDRESS_MODE_CLAMP_TO_BORDER = 1 << 46;
|
||||
const ADDRESS_MODE_CLAMP_TO_BORDER = 1 << 37;
|
||||
/// Allows the user to set [`PolygonMode::Line`] in [`PrimitiveState::polygon_mode`]
|
||||
///
|
||||
/// This allows drawing polygons/triangles as lines (wireframe) instead of filled
|
||||
@ -729,7 +727,7 @@ bitflags::bitflags! {
|
||||
/// - Metal
|
||||
///
|
||||
/// This is a native only feature.
|
||||
const POLYGON_MODE_LINE = 1 << 47;
|
||||
const POLYGON_MODE_LINE = 1 << 38;
|
||||
/// Allows the user to set [`PolygonMode::Point`] in [`PrimitiveState::polygon_mode`]
|
||||
///
|
||||
/// This allows only drawing the vertices of polygons/triangles instead of filled
|
||||
@ -738,7 +736,7 @@ bitflags::bitflags! {
|
||||
/// - Vulkan
|
||||
///
|
||||
/// This is a native only feature.
|
||||
const POLYGON_MODE_POINT = 1 << 48;
|
||||
const POLYGON_MODE_POINT = 1 << 39;
|
||||
/// Allows the user to set a overestimation-conservative-rasterization in [`PrimitiveState::conservative`]
|
||||
///
|
||||
/// Processing of degenerate triangles/lines is hardware specific.
|
||||
@ -748,7 +746,7 @@ bitflags::bitflags! {
|
||||
/// - Vulkan
|
||||
///
|
||||
/// This is a native only feature.
|
||||
const CONSERVATIVE_RASTERIZATION = 1 << 49;
|
||||
const CONSERVATIVE_RASTERIZATION = 1 << 40;
|
||||
/// Enables bindings of writable storage buffers and textures visible to vertex shaders.
|
||||
///
|
||||
/// Note: some (tiled-based) platforms do not support vertex shaders with any side-effects.
|
||||
@ -757,14 +755,14 @@ bitflags::bitflags! {
|
||||
/// - All
|
||||
///
|
||||
/// This is a native only feature.
|
||||
const VERTEX_WRITABLE_STORAGE = 1 << 50;
|
||||
const VERTEX_WRITABLE_STORAGE = 1 << 41;
|
||||
/// Enables clear to zero for textures.
|
||||
///
|
||||
/// Supported platforms:
|
||||
/// - All
|
||||
///
|
||||
/// This is a native only feature.
|
||||
const CLEAR_TEXTURE = 1 << 51;
|
||||
const CLEAR_TEXTURE = 1 << 42;
|
||||
/// Enables creating shader modules from SPIR-V binary data (unsafe).
|
||||
///
|
||||
/// SPIR-V data is not parsed or interpreted in any way; you can use
|
||||
@ -776,7 +774,7 @@ bitflags::bitflags! {
|
||||
/// Vulkan implementation.
|
||||
///
|
||||
/// This is a native only feature.
|
||||
const SPIRV_SHADER_PASSTHROUGH = 1 << 52;
|
||||
const SPIRV_SHADER_PASSTHROUGH = 1 << 43;
|
||||
/// Enables multiview render passes and `builtin(view_index)` in vertex shaders.
|
||||
///
|
||||
/// Supported platforms:
|
||||
@ -784,7 +782,7 @@ bitflags::bitflags! {
|
||||
/// - OpenGL (web only)
|
||||
///
|
||||
/// This is a native only feature.
|
||||
const MULTIVIEW = 1 << 53;
|
||||
const MULTIVIEW = 1 << 44;
|
||||
/// Enables using 64-bit types for vertex attributes.
|
||||
///
|
||||
/// Requires SHADER_FLOAT64.
|
||||
@ -792,7 +790,7 @@ bitflags::bitflags! {
|
||||
/// Supported Platforms: N/A
|
||||
///
|
||||
/// This is a native only feature.
|
||||
const VERTEX_ATTRIBUTE_64BIT = 1 << 54;
|
||||
const VERTEX_ATTRIBUTE_64BIT = 1 << 45;
|
||||
/// Allows vertex shaders to have outputs which are not consumed
|
||||
/// by the fragment shader.
|
||||
///
|
||||
@ -800,7 +798,7 @@ bitflags::bitflags! {
|
||||
/// - Vulkan
|
||||
/// - Metal
|
||||
/// - OpenGL
|
||||
const SHADER_UNUSED_VERTEX_OUTPUT = 1 << 55;
|
||||
const SHADER_UNUSED_VERTEX_OUTPUT = 1 << 46;
|
||||
/// Allows for creation of textures of format [`TextureFormat::NV12`]
|
||||
///
|
||||
/// Supported platforms:
|
||||
@ -808,16 +806,14 @@ bitflags::bitflags! {
|
||||
/// - Vulkan
|
||||
///
|
||||
/// This is a native only feature.
|
||||
const TEXTURE_FORMAT_NV12 = 1 << 56;
|
||||
const TEXTURE_FORMAT_NV12 = 1 << 47;
|
||||
/// Allows for the creation of ray-tracing acceleration structures.
|
||||
///
|
||||
/// Supported platforms:
|
||||
/// - Vulkan
|
||||
///
|
||||
/// This is a native-only feature.
|
||||
const RAY_TRACING_ACCELERATION_STRUCTURE = 1 << 57;
|
||||
|
||||
// 58 available
|
||||
const RAY_TRACING_ACCELERATION_STRUCTURE = 1 << 48;
|
||||
|
||||
// Shader:
|
||||
|
||||
@ -827,7 +823,7 @@ bitflags::bitflags! {
|
||||
/// - Vulkan
|
||||
///
|
||||
/// This is a native-only feature.
|
||||
const RAY_QUERY = 1 << 59;
|
||||
const RAY_QUERY = 1 << 49;
|
||||
/// Enables 64-bit floating point types in SPIR-V shaders.
|
||||
///
|
||||
/// Note: even when supported by GPU hardware, 64-bit floating point operations are
|
||||
@ -837,14 +833,14 @@ bitflags::bitflags! {
|
||||
/// - Vulkan
|
||||
///
|
||||
/// This is a native only feature.
|
||||
const SHADER_F64 = 1 << 60;
|
||||
const SHADER_F64 = 1 << 50;
|
||||
/// 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_I16 = 1 << 61;
|
||||
const SHADER_I16 = 1 << 51;
|
||||
/// Enables `builtin(primitive_index)` in fragment shaders.
|
||||
///
|
||||
/// Note: enables geometry processing for pipelines using the builtin.
|
||||
@ -858,14 +854,14 @@ bitflags::bitflags! {
|
||||
/// - OpenGL (some)
|
||||
///
|
||||
/// This is a native only feature.
|
||||
const SHADER_PRIMITIVE_INDEX = 1 << 62;
|
||||
const SHADER_PRIMITIVE_INDEX = 1 << 52;
|
||||
/// Allows shaders to use the `early_depth_test` attribute.
|
||||
///
|
||||
/// Supported platforms:
|
||||
/// - GLES 3.1+
|
||||
///
|
||||
/// This is a native only feature.
|
||||
const SHADER_EARLY_DEPTH_TEST = 1 << 63;
|
||||
const SHADER_EARLY_DEPTH_TEST = 1 << 53;
|
||||
/// Allows two outputs from a shader to be used for blending.
|
||||
/// Note that dual-source blending doesn't support multiple render targets.
|
||||
///
|
||||
@ -876,7 +872,7 @@ bitflags::bitflags! {
|
||||
/// - Metal (with MSL 1.2+)
|
||||
/// - Vulkan (with dualSrcBlend)
|
||||
/// - DX12
|
||||
const DUAL_SOURCE_BLENDING = 1 << 64;
|
||||
const DUAL_SOURCE_BLENDING = 1 << 54;
|
||||
}
|
||||
}
|
||||
|
||||
@ -885,12 +881,12 @@ impl_bitflags!(Features);
|
||||
impl Features {
|
||||
/// Mask of all features which are part of the upstream WebGPU standard.
|
||||
pub const fn all_webgpu_mask() -> Self {
|
||||
Self::from_bits_truncate(0x0000_0000_0000_FFFF)
|
||||
Self::from_bits_truncate(0xFFFFF)
|
||||
}
|
||||
|
||||
/// Mask of all features that are only available when targeting native (not web).
|
||||
pub const fn all_native_mask() -> Self {
|
||||
Self::from_bits_truncate(0xFFFF_FFFF_FFFF_0000)
|
||||
Self::from_bits_truncate(!Self::all_webgpu_mask().bits())
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user