Skip to content

Commit

Permalink
Move TEXTURE_COMPRESSION_ETC2 | ASTC_LDR to web section to match spec (
Browse files Browse the repository at this point in the history
  • Loading branch information
jinleili authored May 18, 2022
1 parent 36f8d83 commit 0c1233b
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 48 deletions.
2 changes: 1 addition & 1 deletion player/tests/data/clear-buffer-texture.ron
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(
features: 0x0000_0010_0000_0000,
features: 0x0000_0004_0000_0000,
expectations: [
(
name: "Quad",
Expand Down
2 changes: 1 addition & 1 deletion player/tests/data/pipeline-statistics-query.ron
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(
features: 0x0000_0000_0000_0020, // PIPELINE_STATISTICS_QUERY
features: 0x0000_0000_0000_0080, // PIPELINE_STATISTICS_QUERY
expectations: [
(
name: "Queried number of compute invocations is correct",
Expand Down
92 changes: 46 additions & 46 deletions wgpu-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,36 @@ bitflags::bitflags! {
///
/// 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:
/// - Intel/Vulkan
/// - 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.
/// [`Features::TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES`] may enable additional usages.
///
/// Supported Platforms:
/// - Intel/Vulkan
/// - Mobile (some)
///
/// This is a web and native feature.
const TEXTURE_COMPRESSION_ASTC_LDR = 1 << 4;
/// Allows non-zero value for the "first instance" in indirect draw calls.
///
/// Supported Platforms:
Expand All @@ -216,7 +246,7 @@ bitflags::bitflags! {
/// - Metal
///
/// This is a web and native feature.
const INDIRECT_FIRST_INSTANCE = 1 << 3;
const INDIRECT_FIRST_INSTANCE = 1 << 5;
/// Enables use of Timestamp Queries. These queries tell the current gpu timestamp when
/// all work before the query is finished. Call [`CommandEncoder::write_timestamp`],
/// [`RenderPassEncoder::write_timestamp`], or [`ComputePassEncoder::write_timestamp`] to
Expand All @@ -234,7 +264,7 @@ bitflags::bitflags! {
/// - DX12 (works)
///
/// This is a web and native feature.
const TIMESTAMP_QUERY = 1 << 4;
const TIMESTAMP_QUERY = 1 << 6;
/// Enables use of Pipeline Statistics Queries. These queries tell the count of various operations
/// performed between the start and stop call. Call [`RenderPassEncoder::begin_pipeline_statistics_query`] to start
/// a query, then call [`RenderPassEncoder::end_pipeline_statistics_query`] to stop one.
Expand All @@ -249,7 +279,7 @@ bitflags::bitflags! {
/// - DX12 (works)
///
/// This is a web and native feature.
const PIPELINE_STATISTICS_QUERY = 1 << 5;
const PIPELINE_STATISTICS_QUERY = 1 << 7;
/// Allows shaders to acquire the FP16 ability
///
/// Note: this is not supported in naga yet,only through spir-v passthrough right now.
Expand All @@ -259,7 +289,7 @@ bitflags::bitflags! {
/// - Metal
///
/// This is a web and native feature.
const SHADER_FLOAT16 = 1 << 6;
const SHADER_FLOAT16 = 1 << 8;
/// 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.
///
Expand Down Expand Up @@ -446,36 +476,6 @@ bitflags::bitflags! {
///
/// This is a native only feature.
const POLYGON_MODE_POINT = 1 << 28;
/// 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:
/// - Intel/Vulkan
/// - Mobile (some)
///
/// This is a native-only feature.
const TEXTURE_COMPRESSION_ETC2 = 1 << 29;
/// 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.
/// [`Features::TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES`] may enable additional usages.
///
/// Supported Platforms:
/// - Intel/Vulkan
/// - Mobile (some)
///
/// This is a native-only feature.
const TEXTURE_COMPRESSION_ASTC_LDR = 1 << 30;
/// Enables device specific texture format features.
///
/// See `TextureFormatFeatures` for a listing of the features in question.
Expand All @@ -487,7 +487,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 << 29;
/// Enables 64-bit floating point types in SPIR-V shaders.
///
/// Note: even when supported by GPU hardware, 64-bit floating point operations are
Expand All @@ -497,15 +497,15 @@ bitflags::bitflags! {
/// - Vulkan
///
/// This is a native-only feature.
const SHADER_FLOAT64 = 1 << 32;
const SHADER_FLOAT64 = 1 << 30;
/// Enables using 64-bit types for vertex attributes.
///
/// Requires SHADER_FLOAT64.
///
/// Supported Platforms: N/A
///
/// This is a native-only feature.
const VERTEX_ATTRIBUTE_64BIT = 1 << 33;
const VERTEX_ATTRIBUTE_64BIT = 1 << 31;
/// Allows the user to set a overestimation-conservative-rasterization in [`PrimitiveState::conservative`]
///
/// Processing of degenerate triangles/lines is hardware specific.
Expand All @@ -515,7 +515,7 @@ bitflags::bitflags! {
/// - Vulkan
///
/// This is a native only feature.
const CONSERVATIVE_RASTERIZATION = 1 << 34;
const CONSERVATIVE_RASTERIZATION = 1 << 32;
/// 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.
Expand All @@ -524,14 +524,14 @@ bitflags::bitflags! {
/// - All
///
/// This is a native-only feature.
const VERTEX_WRITABLE_STORAGE = 1 << 35;
const VERTEX_WRITABLE_STORAGE = 1 << 33;
/// Enables clear to zero for textures.
///
/// Supported platforms:
/// - All
///
/// This is a native only feature.
const CLEAR_TEXTURE = 1 << 36;
const CLEAR_TEXTURE = 1 << 34;
/// Enables creating shader modules from SPIR-V binary data (unsafe).
///
/// SPIR-V data is not parsed or interpreted in any way; you can use
Expand All @@ -543,7 +543,7 @@ bitflags::bitflags! {
/// Vulkan implementation.
///
/// This is a native only feature.
const SPIRV_SHADER_PASSTHROUGH = 1 << 37;
const SPIRV_SHADER_PASSTHROUGH = 1 << 35;
/// Enables `builtin(primitive_index)` in fragment shaders.
///
/// Note: enables geometry processing for pipelines using the builtin.
Expand All @@ -554,14 +554,14 @@ bitflags::bitflags! {
/// - Vulkan
///
/// This is a native only feature.
const SHADER_PRIMITIVE_INDEX = 1 << 38;
const SHADER_PRIMITIVE_INDEX = 1 << 36;
/// Enables multiview render passes and `builtin(view_index)` in vertex shaders.
///
/// Supported platforms:
/// - Vulkan
///
/// This is a native only feature.
const MULTIVIEW = 1 << 39;
const MULTIVIEW = 1 << 37;
/// Enables normalized `16-bit` texture formats.
///
/// Supported platforms:
Expand All @@ -570,7 +570,7 @@ bitflags::bitflags! {
/// - Metal
///
/// This is a native only feature.
const TEXTURE_FORMAT_16BIT_NORM = 1 << 40;
const TEXTURE_FORMAT_16BIT_NORM = 1 << 38;
/// Allows the use of [`AddressMode::ClampToBorder`] with a border color
/// of [`SamplerBorderColor::Zero`].
///
Expand All @@ -582,12 +582,12 @@ bitflags::bitflags! {
/// - OpenGL
///
/// This is a native only feature.
const ADDRESS_MODE_CLAMP_TO_ZERO = 1 << 41;
const ADDRESS_MODE_CLAMP_TO_ZERO = 1 << 39;
/// Supported Platforms:
/// - Metal
///
/// This is a native-only feature.
const TEXTURE_COMPRESSION_ASTC_HDR = 1 << 42;
const TEXTURE_COMPRESSION_ASTC_HDR = 1 << 40;
}
}

Expand Down

0 comments on commit 0c1233b

Please sign in to comment.