Skip to content

Commit 83e0d44

Browse files
authored
WebGPUTextureUtils: Add missing rgba8unorm-srgb to _getTypedArrayType(). (#31655)
1 parent 5a16f4b commit 83e0d44

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/renderers/webgpu/utils/WebGPUTextureUtils.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,7 +1033,7 @@ class WebGPUTextureUtils {
10331033
if ( format === GPUTextureFormat.RG8Snorm ) return Int8Array;
10341034
if ( format === GPUTextureFormat.RGBA8Uint ) return Uint8Array;
10351035
if ( format === GPUTextureFormat.RGBA8Sint ) return Int8Array;
1036-
if ( format === GPUTextureFormat.RGBA8Unorm ) return Uint8Array;
1036+
if ( format === GPUTextureFormat.RGBA8Unorm || format === GPUTextureFormat.RGBA8UnormSRGB ) return Uint8Array;
10371037
if ( format === GPUTextureFormat.RGBA8Snorm ) return Int8Array;
10381038

10391039

@@ -1058,8 +1058,7 @@ class WebGPUTextureUtils {
10581058
if ( format === GPUTextureFormat.RGBA32Sint ) return Int32Array;
10591059
if ( format === GPUTextureFormat.RGBA32Float ) return Float32Array;
10601060

1061-
if ( format === GPUTextureFormat.BGRA8Unorm ) return Uint8Array;
1062-
if ( format === GPUTextureFormat.BGRA8UnormSRGB ) return Uint8Array;
1061+
if ( format === GPUTextureFormat.BGRA8Unorm || format === GPUTextureFormat.BGRA8UnormSRGB ) return Uint8Array;
10631062
if ( format === GPUTextureFormat.RGB10A2Unorm ) return Uint32Array;
10641063
if ( format === GPUTextureFormat.RGB9E5UFloat ) return Uint32Array;
10651064
if ( format === GPUTextureFormat.RG11B10UFloat ) return Uint32Array;

0 commit comments

Comments
 (0)