@@ -26,10 +26,12 @@ import {
2626 RGB_ETC2_Format ,
2727 RGB_PVRTC_4BPPV1_Format ,
2828 RGB_S3TC_DXT1_Format ,
29+ RGBFormat ,
2930 RGFormat ,
3031 RedFormat ,
3132 SRGBColorSpace ,
32- UnsignedByteType
33+ UnsignedByteType ,
34+ UnsignedInt5999Type
3335} from 'three' ;
3436import { WorkerPool } from '../utils/WorkerPool.js' ;
3537import {
@@ -70,6 +72,7 @@ import {
7072 VK_FORMAT_R8G8_UNORM ,
7173 VK_FORMAT_R8_SRGB ,
7274 VK_FORMAT_R8_UNORM ,
75+ VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 ,
7376 VK_FORMAT_UNDEFINED
7477} from '../libs/ktx-parse.module.js' ;
7578import { ZSTDDecoder } from '../libs/zstddec.module.js' ;
@@ -918,7 +921,7 @@ KTX2Loader.BasisWorker = function () {
918921// Parsing for non-Basis textures. These textures may have supercompression
919922// like Zstd, but they do not require transcoding.
920923
921- const UNCOMPRESSED_FORMATS = new Set ( [ RGBAFormat , RGFormat , RedFormat ] ) ;
924+ const UNCOMPRESSED_FORMATS = new Set ( [ RGBAFormat , RGBFormat , RGFormat , RedFormat ] ) ;
922925
923926const FORMAT_MAP = {
924927
@@ -937,6 +940,8 @@ const FORMAT_MAP = {
937940 [ VK_FORMAT_R8_SRGB ] : RedFormat ,
938941 [ VK_FORMAT_R8_UNORM ] : RedFormat ,
939942
943+ [ VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 ] : RGBFormat ,
944+
940945 [ VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK ] : RGB_ETC2_Format ,
941946 [ VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK ] : RGBA_ETC2_EAC_Format ,
942947
@@ -979,6 +984,8 @@ const TYPE_MAP = {
979984 [ VK_FORMAT_R8_SRGB ] : UnsignedByteType ,
980985 [ VK_FORMAT_R8_UNORM ] : UnsignedByteType ,
981986
987+ [ VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 ] : UnsignedInt5999Type ,
988+
982989 [ VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK ] : UnsignedByteType ,
983990 [ VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK ] : UnsignedByteType ,
984991
@@ -1071,6 +1078,16 @@ async function createRawTexture( container ) {
10711078
10721079 ) ;
10731080
1081+ } else if ( TYPE_MAP [ vkFormat ] === UnsignedInt5999Type ) {
1082+
1083+ data = new Uint32Array (
1084+
1085+ levelData . buffer ,
1086+ levelData . byteOffset ,
1087+ levelData . byteLength / Uint32Array . BYTES_PER_ELEMENT
1088+
1089+ ) ;
1090+
10741091 } else {
10751092
10761093 data = levelData ;
0 commit comments