Skip to content

Commit

Permalink
TextureInternalFormat.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lakuna committed Oct 12, 2023
1 parent 4d93a64 commit c713335
Show file tree
Hide file tree
Showing 4 changed files with 846 additions and 50 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"#ShaderType": "./dist/constants/ShaderType.js",
"#TextureDataType": "./dist/constants/TextureDataType.js",
"#TextureFormat": "./dist/constants/TextureFormat.js",
"#TextureInternalFormat": "./dist/constants/TextureInternalFormat.js",
"#TextureTarget": "./dist/constants/TextureTarget.js",
"#Mip": "./dist/core/textures/Mip.js",
"#Texture": "./dist/core/textures/Texture.js",
Expand Down
100 changes: 50 additions & 50 deletions src/constants/TextureFormat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,63 +93,63 @@ enum TextureFormat {
* Unsized sRGB format that leaves the precision up to the driver.
* @see [`EXT_sRGB`](https://developer.mozilla.org/en-US/docs/Web/API/EXT_sRGB)
*/
SRGB_EXT = 0x8C40,
SRGB = 0x8c40,

/**
* Unsized sRGB format with an unsized alpha component.
* @see [`EXT_sRGB`](https://developer.mozilla.org/en-US/docs/Web/API/EXT_sRGB)
*/
SRGB_ALPHA_EXT = 0x8C42,
SRGB_ALPHA = 0x8c42,

/**
* A DXT1-compressed image in an RGB image format.
* @see [`WEBGL_compressed_texture_s3tc`](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_compressed_texture_s3tc)
*/
COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83F0,
COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83f0,

/**
* A DXT1-compressed image in an RGB image format with a boolean alpha
* value.
* @see [`WEBGL_compressed_texture_s3tc`](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_compressed_texture_s3tc)
*/
COMPRESSED_RGBA_S3TC_DXT1_EXT = 0x83F1,
COMPRESSED_RGBA_S3TC_DXT1_EXT = 0x83f1,

/**
* A DXT3-compressed image in an RGBA image format.
* @see [`WEBGL_compressed_texture_s3tc`](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_compressed_texture_s3tc)
*/
COMPRESSED_RGBA_S3TC_DXT3_EXT = 0x83F2,
COMPRESSED_RGBA_S3TC_DXT3_EXT = 0x83f2,

/**
* A DXT5-compressed image in an RGBA image format.
* @see [`WEBGL_compressed_texture_s3tc`](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_compressed_texture_s3tc)
*/
COMPRESSED_RGBA_S3TC_DXT5_EXT = 0x83F3,
COMPRESSED_RGBA_S3TC_DXT5_EXT = 0x83f3,

/**
* A DXT1-compressed image in an sRGB image format.
* @see [`WEBGL_compressed_texture_s3tc_srgb`](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_compressed_texture_s3tc_srgb)
*/
COMPRESSED_SRGB_S3TC_DXT1_EXT = 0x8C4C,
COMPRESSED_SRGB_S3TC_DXT1_EXT = 0x8c4c,

/**
* A DXT1-compressed image in an sRGB image format with a boolean alpha
* value.
* @see [`WEBGL_compressed_texture_s3tc_srgb`](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_compressed_texture_s3tc_srgb)
*/
COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT = 0x8C4D,
COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT = 0x8c4d,

/**
* A DXT3-compressed image in an sRGBA image format.
* @see [`WEBGL_compressed_texture_s3tc_srgb`](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_compressed_texture_s3tc_srgb)
*/
COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT = 0x8C4E,
COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT = 0x8c4e,

/**
* A DXT5-compressed image in an sRGBA image format.
* @see [`WEBGL_compressed_texture_s3tc_srgb`](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_compressed_texture_s3tc_srgb)
*/
COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT = 0x8C4F,
COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT = 0x8c4f,

/**
* One-channel unsigned format compression.
Expand Down Expand Up @@ -218,267 +218,267 @@ enum TextureFormat {
* block of pixels.
* @see [`WEBGL_compressed_texture_pvrtc`](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_compressed_texture_pvrtc)
*/
COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 0x8C00,
COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 0x8c00,

/**
* RGBA compression in 4-bit mode, with one block for every four-by-four
* block of pixels.
* @see [`WEBGL_compressed_texture_pvrtc`](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_compressed_texture_pvrtc)
*/
COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 0x8C02,
COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 0x8c02,

/**
* RGB compression in 2-bit mode, with one block for every eight-by-four
* block of pixels.
* @see [`WEBGL_compressed_texture_pvrtc`](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_compressed_texture_pvrtc)
*/
COMPRESSED_RGB_PVRTC_2BPPV1_IMG = 0x8C01,
COMPRESSED_RGB_PVRTC_2BPPV1_IMG = 0x8c01,

/**
* RGBA compression in 2-bit mode, with one block for every eight-by-four
* block of pixels.
* @see [`WEBGL_compressed_texture_pvrtc`](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_compressed_texture_pvrtc)
*/
COMPRESSED_RGBA_PVRTC_2BPPV1_IMG = 0x8C03,
COMPRESSED_RGBA_PVRTC_2BPPV1_IMG = 0x8c03,

/**
* An ASTC-compressed texture format with four-by-four blocks for RGBA data.
* @see [`WEBGL_compressed_texture_astc`](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_compressed_texture_astc)
*/
COMPRESSED_RGBA_ASTC_4x4_KHR = 0x93B0,
COMPRESSED_RGBA_ASTC_4x4_KHR = 0x93b0,

/**
* An ASTC-compressed texture format with four-by-four blocks for sRGBA
* data.
* @see [`WEBGL_compressed_texture_astc`](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_compressed_texture_astc)
*/
COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR = 0x93D0,
COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR = 0x93d0,

/**
* An ASTC-compressed texture format with five-by-four blocks for RGBA data.
* @see [`WEBGL_compressed_texture_astc`](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_compressed_texture_astc)
*/
COMPRESSED_RGBA_ASTC_5x4_KHR = 0x93B1,
COMPRESSED_RGBA_ASTC_5x4_KHR = 0x93b1,

/**
* An ASTC-compressed texture format with five-by-four blocks for sRGBA
* data.
* @see [`WEBGL_compressed_texture_astc`](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_compressed_texture_astc)
*/
COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR = 0x93D1,
COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR = 0x93d1,

/**
* An ASTC-compressed texture format with five-by-five blocks for RGBA data.
* @see [`WEBGL_compressed_texture_astc`](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_compressed_texture_astc)
*/
COMPRESSED_RGBA_ASTC_5x5_KHR = 0x93B2,
COMPRESSED_RGBA_ASTC_5x5_KHR = 0x93b2,

/**
* An ASTC-compressed texture format with five-by-five blocks for sRGBA
* data.
* @see [`WEBGL_compressed_texture_astc`](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_compressed_texture_astc)
*/
COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR = 0x93D2,
COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR = 0x93d2,

/**
* An ASTC-compressed texture format with six-by-five blocks for RGBA data.
* @see [`WEBGL_compressed_texture_astc`](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_compressed_texture_astc)
*/
COMPRESSED_RGBA_ASTC_6x5_KHR = 0x93B3,
COMPRESSED_RGBA_ASTC_6x5_KHR = 0x93b3,

/**
* An ASTC-compressed texture format with six-by-five blocks for sRGBA data.
* @see [`WEBGL_compressed_texture_astc`](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_compressed_texture_astc)
*/
COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR = 0x93D3,
COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR = 0x93d3,

/**
* An ASTC-compressed texture format with six-by-six blocks for RGBA data.
* @see [`WEBGL_compressed_texture_astc`](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_compressed_texture_astc)
*/
COMPRESSED_RGBA_ASTC_6x6_KHR = 0x93B4,
COMPRESSED_RGBA_ASTC_6x6_KHR = 0x93b4,

/**
* An ASTC-compressed texture format with six-by-six blocks for sRGBA data.
* @see [`WEBGL_compressed_texture_astc`](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_compressed_texture_astc)
*/
COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR = 0x93D4,
COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR = 0x93d4,

/**
* An ASTC-compressed texture format with eight-by-five blocks for RGBA
* data.
* @see [`WEBGL_compressed_texture_astc`](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_compressed_texture_astc)
*/
COMPRESSED_RGBA_ASTC_8x5_KHR = 0x93B5,
COMPRESSED_RGBA_ASTC_8x5_KHR = 0x93b5,

/**
* An ASTC-compressed texture format with eight-by-five blocks for sRGBA
* data.
* @see [`WEBGL_compressed_texture_astc`](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_compressed_texture_astc)
*/
COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR = 0x93D5,
COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR = 0x93d5,

/**
* An ASTC-compressed texture format with eight-by-six blocks for RGBA data.
* @see [`WEBGL_compressed_texture_astc`](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_compressed_texture_astc)
*/
COMPRESSED_RGBA_ASTC_8x6_KHR = 0x93B6,
COMPRESSED_RGBA_ASTC_8x6_KHR = 0x93b6,

/**
* An ASTC-compressed texture format with eight-by-six blocks for sRGBA
* data.
* @see [`WEBGL_compressed_texture_astc`](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_compressed_texture_astc)
*/
COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR = 0x93D6,
COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR = 0x93d6,

/**
* An ASTC-compressed texture format with eight-by-eight blocks for RGBA
* data.
* @see [`WEBGL_compressed_texture_astc`](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_compressed_texture_astc)
*/
COMPRESSED_RGBA_ASTC_8x8_KHR = 0x93B7,
COMPRESSED_RGBA_ASTC_8x8_KHR = 0x93b7,

/**
* An ASTC-compressed texture format with eight-by-eight blocks for sRGBA
* data.
* @see [`WEBGL_compressed_texture_astc`](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_compressed_texture_astc)
*/
COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR = 0x93D7,
COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR = 0x93d7,

/**
* An ASTC-compressed texture format with ten-by-five blocks for RGBA data.
* @see [`WEBGL_compressed_texture_astc`](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_compressed_texture_astc)
*/
COMPRESSED_RGBA_ASTC_10x5_KHR = 0x93B8,
COMPRESSED_RGBA_ASTC_10x5_KHR = 0x93b8,

/**
* An ASTC-compressed texture format with ten-by-five blocks for sRGBA data.
* @see [`WEBGL_compressed_texture_astc`](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_compressed_texture_astc)
*/
COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR = 0x93D8,
COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR = 0x93d8,

/**
* An ASTC-compressed texture format with ten-by-six blocks for RGBA data.
* @see [`WEBGL_compressed_texture_astc`](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_compressed_texture_astc)
*/
COMPRESSED_RGBA_ASTC_10x6_KHR = 0x93B9,
COMPRESSED_RGBA_ASTC_10x6_KHR = 0x93b9,

/**
* An ASTC-compressed texture format with ten-by-six blocks for sRGBA data.
* @see [`WEBGL_compressed_texture_astc`](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_compressed_texture_astc)
*/
COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR = 0x93D9,
COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR = 0x93d9,

/**
* An ASTC-compressed texture format with ten-by-eight blocks for RGBA data.
* @see [`WEBGL_compressed_texture_astc`](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_compressed_texture_astc)
*/
COMPRESSED_RGBA_ASTC_10x8_KHR = 0x93BA,
COMPRESSED_RGBA_ASTC_10x8_KHR = 0x93ba,

/**
* An ASTC-compressed texture format with ten-by-eight blocks for sRGBA
* data.
* @see [`WEBGL_compressed_texture_astc`](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_compressed_texture_astc)
*/
COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR = 0x93DA,
COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR = 0x93da,

/**
* An ASTC-compressed texture format with ten-by-ten blocks for RGBA data.
* @see [`WEBGL_compressed_texture_astc`](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_compressed_texture_astc)
*/
COMPRESSED_RGBA_ASTC_10x10_KHR = 0x93BB,
COMPRESSED_RGBA_ASTC_10x10_KHR = 0x93bb,

/**
* An ASTC-compressed texture format with ten-by-ten blocks for sRGBA data.
* @see [`WEBGL_compressed_texture_astc`](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_compressed_texture_astc)
*/
COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR = 0x93DB,
COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR = 0x93db,

/**
* An ASTC-compressed texture format with twelve-by-ten blocks for RGBA
* data.
* @see [`WEBGL_compressed_texture_astc`](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_compressed_texture_astc)
*/
COMPRESSED_RGBA_ASTC_12x10_KHR = 0x93BC,
COMPRESSED_RGBA_ASTC_12x10_KHR = 0x93bc,

/**
* An ASTC-compressed texture format with twelve-by-ten blocks for sRGBA
* data.
* @see [`WEBGL_compressed_texture_astc`](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_compressed_texture_astc)
*/
COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR = 0x93DC,
COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR = 0x93dc,

/**
* An ASTC-compressed texture format with twelve-by-twelve blocks for RGBA
* data.
* @see [`WEBGL_compressed_texture_astc`](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_compressed_texture_astc)
*/
COMPRESSED_RGBA_ASTC_12x12_KHR = 0x93BD,
COMPRESSED_RGBA_ASTC_12x12_KHR = 0x93bd,

/**
* An ASTC-compressed texture format with twelve-by-twelve blocks for sRGBA
* data.
* @see [`WEBGL_compressed_texture_astc`](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_compressed_texture_astc)
*/
COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR = 0x93DD,
COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR = 0x93dd,

/**
* Compressed 8-bit fixed-point data in which each four-by-four block of
* texels consists of 128 bits of RGBA data.
* @see [`EXT_texture_compression_bptc`](https://developer.mozilla.org/en-US/docs/Web/API/EXT_texture_compression_bptc)
*/
COMPRESSED_RGBA_BPTC_UNORM_EXT = 0x8E8C,
COMPRESSED_RGBA_BPTC_UNORM_EXT = 0x8e8c,

/**
* Compressed 8-bit fixed-point data in which each four-by-four block of
* texels consists of 128 bits of sRGBA data.
* @see [`EXT_texture_compression_bptc`](https://developer.mozilla.org/en-US/docs/Web/API/EXT_texture_compression_bptc)
*/
COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT = 0x8E8D,
COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT = 0x8e8d,

/**
* Compressed high dynamic range signed floating-point values in which each
* four-by-four block of texels consists of 128 bits of RGB data and the
* returned alpha value is one.
* @see [`EXT_texture_compression_bptc`](https://developer.mozilla.org/en-US/docs/Web/API/EXT_texture_compression_bptc)
*/
COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT = 0x8E8E,
COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT = 0x8e8e,

/**
* Compressed high dynamic range unsigned floating-point values in which
* each four-by-four block of texels consists of 128 bits of RGB data and
* the returned alpha value is one.
* @see [`EXT_texture_compression_bptc`](https://developer.mozilla.org/en-US/docs/Web/API/EXT_texture_compression_bptc)
*/
COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT = 0x8E8F,
COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT = 0x8e8f,

/**
* Each four-by-four block of texels consists of 64 bits of unsigned red
* image data.
* @see [`EXT_texture_compression_rgtc`](https://developer.mozilla.org/en-US/docs/Web/API/EXT_texture_compression_rgtc)
*/
COMPRESSED_RED_RGTC1_EXT = 0x8DBB,
COMPRESSED_RED_RGTC1_EXT = 0x8dbb,

/**
* Each four-by-four block of texels consists of 64 bits of signed red
* image data.
* @see [`EXT_texture_compression_rgtc`](https://developer.mozilla.org/en-US/docs/Web/API/EXT_texture_compression_rgtc)
*/
COMPRESSED_SIGNED_RED_RGTC1_EXT = 0x8DBC,
COMPRESSED_SIGNED_RED_RGTC1_EXT = 0x8dbc,

/**
* Each four-by-four block of texels consists of 64 bits of unsigned red
* image data followed by 64 bits of unsigned green image data.
* @see [`EXT_texture_compression_rgtc`](https://developer.mozilla.org/en-US/docs/Web/API/EXT_texture_compression_rgtc)
*/
COMPRESSED_RED_GREEN_RGTC2_EXT = 0x8DBD,
COMPRESSED_RED_GREEN_RGTC2_EXT = 0x8dbd,

/**
* Each four-by-four block of texels consists of 64 bits of signed red
* image data followed by 64 bits of signed green image data.
* @see [`EXT_texture_compression_rgtc`](https://developer.mozilla.org/en-US/docs/Web/API/EXT_texture_compression_rgtc)
*/
COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT = 0x8DBE
COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT = 0x8dbe
}

export default TextureFormat;
Loading

0 comments on commit c713335

Please sign in to comment.