Skip to content

Commit c3ad482

Browse files
committed
KTX2Loader: Add VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT
Fixes #31686
1 parent ca3194a commit c3ad482

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

examples/jsm/loaders/KTX2Loader.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ import {
4747
KHR_SUPERCOMPRESSION_NONE,
4848
KHR_SUPERCOMPRESSION_ZSTD,
4949
VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT,
50+
VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT,
5051
VK_FORMAT_ASTC_4x4_SRGB_BLOCK,
5152
VK_FORMAT_ASTC_4x4_UNORM_BLOCK,
5253
VK_FORMAT_ASTC_6x6_SRGB_BLOCK,
@@ -953,6 +954,7 @@ const FORMAT_MAP = {
953954
[ VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT ]: RGBA_ASTC_4x4_Format,
954955
[ VK_FORMAT_ASTC_4x4_SRGB_BLOCK ]: RGBA_ASTC_4x4_Format,
955956
[ VK_FORMAT_ASTC_4x4_UNORM_BLOCK ]: RGBA_ASTC_4x4_Format,
957+
[ VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT ]: RGBA_ASTC_6x6_Format,
956958
[ VK_FORMAT_ASTC_6x6_SRGB_BLOCK ]: RGBA_ASTC_6x6_Format,
957959
[ VK_FORMAT_ASTC_6x6_UNORM_BLOCK ]: RGBA_ASTC_6x6_Format,
958960

@@ -996,6 +998,7 @@ const TYPE_MAP = {
996998
[ VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK ]: UnsignedByteType,
997999

9981000
[ VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT ]: HalfFloatType,
1001+
[ VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT ]: HalfFloatType,
9991002
[ VK_FORMAT_ASTC_6x6_SRGB_BLOCK ]: UnsignedByteType,
10001003
[ VK_FORMAT_ASTC_6x6_UNORM_BLOCK ]: UnsignedByteType,
10011004

@@ -1007,7 +1010,7 @@ async function createRawTexture( container ) {
10071010

10081011
if ( FORMAT_MAP[ vkFormat ] === undefined ) {
10091012

1010-
throw new Error( 'THREE.KTX2Loader: Unsupported vkFormat.' );
1013+
throw new Error( 'THREE.KTX2Loader: Unsupported vkFormat: ' + vkFormat );
10111014

10121015
}
10131016

1.44 KB
Binary file not shown.

examples/webgl_loader_texture_ktx2.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@
128128
textures: [
129129
{ path: '2d_etc1s.ktx2' },
130130
{ path: '2d_uastc.ktx2' },
131+
{ path: '2d_uastc_hdr4x4.ktx2' },
131132
]
132133
},
133134
]

0 commit comments

Comments
 (0)