Skip to content

Commit

Permalink
Add WebGL extension type for 16-bit normalized formats (EXT_texture_n…
Browse files Browse the repository at this point in the history
…orm16) (#3266)
  • Loading branch information
haraldreingruber-dedalus authored Jan 28, 2023
1 parent 79cbace commit 5fff0a9
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 0 deletions.
1 change: 1 addition & 0 deletions crates/web-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ ExtFragDepth = []
ExtSRgb = []
ExtShaderTextureLod = []
ExtTextureFilterAnisotropic = []
ExtTextureNorm16 = []
ExtendableEvent = ["Event"]
ExtendableEventInit = []
ExtendableMessageEvent = ["Event", "ExtendableEvent"]
Expand Down
48 changes: 48 additions & 0 deletions crates/web-sys/src/features/gen_ExtTextureNorm16.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [wasm_bindgen (is_type_of = | _ | false , extends = :: js_sys :: Object , js_name = EXT_texture_norm16 , typescript_type = "EXT_texture_norm16")]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `ExtTextureNorm16` class."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/EXT_texture_norm16)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `ExtTextureNorm16`*"]
pub type ExtTextureNorm16;
}
impl ExtTextureNorm16 {
#[doc = "The `EXT_texture_norm16.R16_EXT` const."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `ExtTextureNorm16`*"]
pub const R16_EXT: u32 = 33322u64 as u32;
#[doc = "The `EXT_texture_norm16.RG16_EXT` const."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `ExtTextureNorm16`*"]
pub const RG16_EXT: u32 = 33324u64 as u32;
#[doc = "The `EXT_texture_norm16.RGB16_EXT` const."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `ExtTextureNorm16`*"]
pub const RGB16_EXT: u32 = 32852u64 as u32;
#[doc = "The `EXT_texture_norm16.RGBA16_EXT` const."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `ExtTextureNorm16`*"]
pub const RGBA16_EXT: u32 = 32859u64 as u32;
#[doc = "The `EXT_texture_norm16.R16_SNORM_EXT` const."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `ExtTextureNorm16`*"]
pub const R16_SNORM_EXT: u32 = 36760u64 as u32;
#[doc = "The `EXT_texture_norm16.RG16_SNORM_EXT` const."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `ExtTextureNorm16`*"]
pub const RG16_SNORM_EXT: u32 = 36761u64 as u32;
#[doc = "The `EXT_texture_norm16.RGB16_SNORM_EXT` const."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `ExtTextureNorm16`*"]
pub const RGB16_SNORM_EXT: u32 = 36762u64 as u32;
#[doc = "The `EXT_texture_norm16.RGBA16_SNORM_EXT` const."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `ExtTextureNorm16`*"]
pub const RGBA16_SNORM_EXT: u32 = 36763u64 as u32;
}
6 changes: 6 additions & 0 deletions crates/web-sys/src/features/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1972,6 +1972,12 @@ mod gen_ExtTextureFilterAnisotropic;
#[cfg(feature = "ExtTextureFilterAnisotropic")]
pub use gen_ExtTextureFilterAnisotropic::*;

#[cfg(feature = "ExtTextureNorm16")]
#[allow(non_snake_case)]
mod gen_ExtTextureNorm16;
#[cfg(feature = "ExtTextureNorm16")]
pub use gen_ExtTextureNorm16::*;

#[cfg(feature = "ExtendableEvent")]
#[allow(non_snake_case)]
mod gen_ExtendableEvent;
Expand Down
13 changes: 13 additions & 0 deletions crates/web-sys/webidls/enabled/WebGL2RenderingContext.webidl
Original file line number Diff line number Diff line change
Expand Up @@ -722,3 +722,16 @@ WebGL2RenderingContext includes WebGL2RenderingContextBase;
[NoInterfaceObject]
interface EXT_color_buffer_float {
};

[NoInterfaceObject]
interface EXT_texture_norm16
{
const GLenum R16_EXT = 0x822A;
const GLenum RG16_EXT = 0x822C;
const GLenum RGB16_EXT = 0x8054;
const GLenum RGBA16_EXT = 0x805B;
const GLenum R16_SNORM_EXT = 0x8F98;
const GLenum RG16_SNORM_EXT = 0x8F99;
const GLenum RGB16_SNORM_EXT = 0x8F9A;
const GLenum RGBA16_SNORM_EXT = 0x8F9B;
};

0 comments on commit 5fff0a9

Please sign in to comment.