diff --git a/src/renderers/webgpu/nodes/WGSLNodeFunction.js b/src/renderers/webgpu/nodes/WGSLNodeFunction.js index 2ce518a7a1db64..0c0b1864ee4df2 100644 --- a/src/renderers/webgpu/nodes/WGSLNodeFunction.js +++ b/src/renderers/webgpu/nodes/WGSLNodeFunction.js @@ -50,6 +50,7 @@ const wgslTypeLib = { 'mat4x4f': 'mat4', 'sampler': 'sampler', + 'sampler_comparison': 'samplerComparison', 'texture_1d': 'texture', diff --git a/src/renderers/webgpu/utils/WebGPUAttributeUtils.js b/src/renderers/webgpu/utils/WebGPUAttributeUtils.js index f683d74a3d10cd..0d4ab9c7f58db2 100644 --- a/src/renderers/webgpu/utils/WebGPUAttributeUtils.js +++ b/src/renderers/webgpu/utils/WebGPUAttributeUtils.js @@ -14,8 +14,8 @@ const typedArraysToVertexFormatPrefix = new Map( [ [ Uint8Array, [ 'uint8', 'unorm8' ]], [ Int16Array, [ 'sint16', 'snorm16' ]], [ Uint16Array, [ 'uint16', 'unorm16' ]], - [ Int32Array, [ 'sint32', 'snorm32' ]], - [ Uint32Array, [ 'uint32', 'unorm32' ]], + [ Int32Array, [ 'sint32' ]], + [ Uint32Array, [ 'uint32' ]], [ Float32Array, [ 'float32', ]], ] ); @@ -31,9 +31,7 @@ const typedAttributeToVertexFormatPrefix = new Map( [ const typeArraysToVertexFormatPrefixForItemSize1 = new Map( [ [ Int32Array, 'sint32' ], - [ Int16Array, 'sint32' ], // patch for INT16 [ Uint32Array, 'uint32' ], - [ Uint16Array, 'uint32' ], // patch for UINT16 [ Float32Array, 'float32' ] ] ); @@ -82,7 +80,7 @@ class WebGPUAttributeUtils { let array = bufferAttribute.array; // patch for INT16 and UINT16 - if ( attribute.normalized === false ) { + if ( attribute.normalized === false && attribute.isInterleavedBufferAttribute !== true ) { if ( array.constructor === Int16Array || array.constructor === Int8Array ) { @@ -321,13 +319,6 @@ class WebGPUAttributeUtils { } - // patch for INT16 and UINT16 - if ( geometryAttribute.normalized === false && ( geometryAttribute.array.constructor === Int16Array || geometryAttribute.array.constructor === Uint16Array ) ) { - - arrayStride = 4; - - } - vertexBufferLayout = { arrayStride, attributes: [],