-
Notifications
You must be signed in to change notification settings - Fork 1k
Support Sliced 3D for ASTC #7577
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Changes from all commits
d2e6e60
4c697aa
ab7afd9
54e2285
2ad3a26
6049d53
bb8ed59
030b337
a13e28a
be727bd
77c8cb3
bd99a7e
b334e43
dc52d75
63798c5
f8ae95a
a67d683
5a430bd
eee9822
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,25 +37,28 @@ mod webgpu_impl { | |
pub const WEBGPU_FEATURE_TEXTURE_COMPRESSION_ASTC: u64 = 1 << 5; | ||
|
||
#[doc(hidden)] | ||
pub const WEBGPU_FEATURE_TIMESTAMP_QUERY: u64 = 1 << 6; | ||
pub const WEBGPU_FEATURE_TEXTURE_COMPRESSION_ASTC_SLICED_3D: u64 = 1 << 6; | ||
|
||
#[doc(hidden)] | ||
pub const WEBGPU_FEATURE_INDIRECT_FIRST_INSTANCE: u64 = 1 << 7; | ||
pub const WEBGPU_FEATURE_TIMESTAMP_QUERY: u64 = 1 << 7; | ||
|
||
#[doc(hidden)] | ||
pub const WEBGPU_FEATURE_SHADER_F16: u64 = 1 << 8; | ||
pub const WEBGPU_FEATURE_INDIRECT_FIRST_INSTANCE: u64 = 1 << 8; | ||
|
||
#[doc(hidden)] | ||
pub const WEBGPU_FEATURE_RG11B10UFLOAT_RENDERABLE: u64 = 1 << 9; | ||
pub const WEBGPU_FEATURE_SHADER_F16: u64 = 1 << 9; | ||
|
||
#[doc(hidden)] | ||
pub const WEBGPU_FEATURE_BGRA8UNORM_STORAGE: u64 = 1 << 10; | ||
pub const WEBGPU_FEATURE_RG11B10UFLOAT_RENDERABLE: u64 = 1 << 10; | ||
|
||
#[doc(hidden)] | ||
pub const WEBGPU_FEATURE_FLOAT32_FILTERABLE: u64 = 1 << 11; | ||
pub const WEBGPU_FEATURE_BGRA8UNORM_STORAGE: u64 = 1 << 11; | ||
|
||
#[doc(hidden)] | ||
pub const WEBGPU_FEATURE_DUAL_SOURCE_BLENDING: u64 = 1 << 12; | ||
pub const WEBGPU_FEATURE_FLOAT32_FILTERABLE: u64 = 1 << 12; | ||
|
||
#[doc(hidden)] | ||
pub const WEBGPU_FEATURE_DUAL_SOURCE_BLENDING: u64 = 1 << 13; | ||
} | ||
|
||
macro_rules! bitflags_array_impl { | ||
|
@@ -1294,13 +1297,33 @@ bitflags_array! { | |
/// 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. | ||
/// | ||
/// This feature does not guarantee availability of sliced 3d textures for ASTC formats. | ||
/// If available, 3d support can be enabled by TEXTURE_COMPRESSION_ASTC_SLICED_3D feature. | ||
/// | ||
/// Supported Platforms: | ||
/// - Vulkan on Intel | ||
/// - Mobile (some) | ||
/// | ||
/// This is a web and native feature. | ||
const TEXTURE_COMPRESSION_ASTC = WEBGPU_FEATURE_TEXTURE_COMPRESSION_ASTC; | ||
|
||
|
||
/// Allows the 3d dimension for textures with ASTC compressed formats. | ||
/// | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. would be nice to mention on the above feature that volume textures aren't included unless Wondering what to do with the non-webgpu There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Wumpf makes sense, does the new commit look sufficient? |
||
/// This feature must be used in combination with TEXTURE_COMPRESSION_ASTC to enable 3D textures with ASTC compression. | ||
/// It does not enable the ASTC formats by itself. | ||
/// | ||
/// Supported Platforms: | ||
/// - Vulkan (some) | ||
/// - Metal on Apple3+ | ||
/// - OpenGL/WebGL (some) | ||
/// | ||
/// Not Supported: | ||
/// - DX12 | ||
/// | ||
/// This is a web and native feature. | ||
const TEXTURE_COMPRESSION_ASTC_SLICED_3D = WEBGPU_FEATURE_TEXTURE_COMPRESSION_ASTC_SLICED_3D; | ||
|
||
/// Enables use of Timestamp Queries. These queries tell the current gpu timestamp when | ||
/// all work before the query is finished. | ||
/// | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit confused about the extension zoo here tbh. So apparently [
WEBGL_compressed_texture_astc
])https://registry.khronos.org/webgl/extensions/WEBGL_compressed_texture_astc/) implies all ofKHR_texture_compression_astc_hdr
, which in turn saysIt includes support for 2D and slice-based 3D textures, with low and high dynamic range, at bitrates from below 1 bit/pixel up to 8 bits/pixel in fine steps.
Which kinda implies that for webgl, either profile should imply sliced 3d.
The
else
block (native gl) should then instead check forGL_KHR_texture_compression_astc_sliced_3d
to activate the feature.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Wumpf good one, I missed the native GL block. I tried to address in latest commit! PLMK if it helps sufficiently.