Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/renderers/webgpu/nodes/WGSLNodeFunction.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ const wgslTypeLib = {
'mat4x4f': 'mat4',

'sampler': 'sampler',
'sampler_comparison': 'samplerComparison',

'texture_1d': 'texture',

Expand Down
15 changes: 3 additions & 12 deletions src/renderers/webgpu/utils/WebGPUAttributeUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', ]],
] );

Expand All @@ -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' ]
] );

Expand Down Expand Up @@ -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 ) {

Expand Down Expand Up @@ -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: [],
Expand Down