Skip to content

Commit

Permalink
Use consistent naming for ASTC constants.
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkCallow committed Sep 6, 2024
1 parent 2377122 commit 2e793dd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions interface/js_binding/ktx_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -762,15 +762,15 @@ enum VkFormat = {
// purpose of this IDL. Any VkFormat valid for KTX can be used. As shown
// here, omit the VK_FORMAT_ prefix and enclose in quotes.
enum astc_quality_levels = { // **
enum pack_astc_quality_levels = { // **
"FASTEST",
"FAST",
"MEDIUM",
"THOROUGH",
"EXHAUSTIVE",
};
enum astc_block_dimension = { // **
enum pack_astc_block_dimension = { // **
// 2D formats
"D4x4",
"D5x4",
Expand Down Expand Up @@ -1337,15 +1337,15 @@ EMSCRIPTEN_BINDINGS(ktx)
.property("generateMipmaps", &ktxTextureCreateInfo::generateMipmaps)
;

enum_<ktx_pack_astc_quality_levels_e>("astc_quality_levels")
enum_<ktx_pack_astc_quality_levels_e>("pack_astc_quality_levels")
.value("FASTEST", KTX_PACK_ASTC_QUALITY_LEVEL_FASTEST)
.value("FAST", KTX_PACK_ASTC_QUALITY_LEVEL_FAST)
.value("MEDIUM", KTX_PACK_ASTC_QUALITY_LEVEL_MEDIUM)
.value("THOROUGH", KTX_PACK_ASTC_QUALITY_LEVEL_THOROUGH)
.value("EXHAUSTIVE", KTX_PACK_ASTC_QUALITY_LEVEL_EXHAUSTIVE)
;

enum_<ktx_pack_astc_block_dimension_e>("astc_block_dimension")
enum_<ktx_pack_astc_block_dimension_e>("pack_astc_block_dimension")
// 2D formats
.value("D4x4", KTX_PACK_ASTC_BLOCK_DIMENSION_4x4) //: 8.00 bpp
.value("D5x4", KTX_PACK_ASTC_BLOCK_DIMENSION_5x4) //: 6.40 bpp
Expand Down
4 changes: 2 additions & 2 deletions tests/webgl/libktx-webgl/libktx-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -886,9 +886,9 @@ async function testEncodeBasis(ktexture) {
async function testEncodeAstc(ktexture) {
const params = new ktx.astcParams();

params.blockDimension = ktx.astc_block_dimension.D8x8;
params.blockDimension = ktx.pack_astc_block_dimension.D8x8;
params.mode = ktx.pack_astc_encoder_mode.DEFAULT;
params.qualityLevel = ktx.astc_quality_levels.FAST;
params.qualityLevel = ktx.pack_astc_quality_levels.FAST;
params.normalMap = false;

// Before we compress, test inputSwizzle setting
Expand Down

0 comments on commit 2e793dd

Please sign in to comment.