Forráskód Böngészése

WebGPURenderer: Update to latest vertex formats.

Mugen87 4 éve
szülő
commit
80c838c9ad

+ 14 - 14
examples/jsm/renderers/webgpu/WebGPURenderPipelines.js

@@ -734,20 +734,20 @@ class WebGPURenderPipelines {
 
 
 		// @TODO: This code is GLSL specific. We need to update when we switch to WGSL.
 		// @TODO: This code is GLSL specific. We need to update when we switch to WGSL.
 
 
-		if ( type === 'float' ) return GPUVertexFormat.Float;
-		if ( type === 'vec2' ) return GPUVertexFormat.Float2;
-		if ( type === 'vec3' ) return GPUVertexFormat.Float3;
-		if ( type === 'vec4' ) return GPUVertexFormat.Float4;
-
-		if ( type === 'int' ) return GPUVertexFormat.Int;
-		if ( type === 'ivec2' ) return GPUVertexFormat.Int2;
-		if ( type === 'ivec3' ) return GPUVertexFormat.Int3;
-		if ( type === 'ivec4' ) return GPUVertexFormat.Int4;
-
-		if ( type === 'uint' ) return GPUVertexFormat.UInt;
-		if ( type === 'uvec2' ) return GPUVertexFormat.UInt2;
-		if ( type === 'uvec3' ) return GPUVertexFormat.UInt3;
-		if ( type === 'uvec4' ) return GPUVertexFormat.UInt4;
+		if ( type === 'float' ) return GPUVertexFormat.Float32;
+		if ( type === 'vec2' ) return GPUVertexFormat.Float32x2;
+		if ( type === 'vec3' ) return GPUVertexFormat.Float32x3;
+		if ( type === 'vec4' ) return GPUVertexFormat.Float32x4;
+
+		if ( type === 'int' ) return GPUVertexFormat.Sint32;
+		if ( type === 'ivec2' ) return GPUVertexFormat.Sint32x2;
+		if ( type === 'ivec3' ) return GPUVertexFormat.Sint32x3;
+		if ( type === 'ivec4' ) return GPUVertexFormat.Sint32x4;
+
+		if ( type === 'uint' ) return GPUVertexFormat.Uint32;
+		if ( type === 'uvec2' ) return GPUVertexFormat.Uint32x2;
+		if ( type === 'uvec3' ) return GPUVertexFormat.Uint32x3;
+		if ( type === 'uvec4' ) return GPUVertexFormat.Uint32x4;
 
 
 		console.error( 'THREE.WebGPURenderer: Shader variable type not supported yet.', type );
 		console.error( 'THREE.WebGPURenderer: Shader variable type not supported yet.', type );
 
 

+ 30 - 30
examples/jsm/renderers/webgpu/constants.js

@@ -43,36 +43,36 @@ export const GPUIndexFormat = {
 };
 };
 
 
 export const GPUVertexFormat = {
 export const GPUVertexFormat = {
-	Uchar2: 'uchar2',
-	Uchar4: 'uchar4',
-	Char2: 'char2',
-	Char4: 'char4',
-	Uchar2Norm: 'uchar2norm',
-	Uchar4Norm: 'uchar4norm',
-	Char2Norm: 'char2norm',
-	Char4Norm: 'char4norm',
-	Ushort2: 'ushort2',
-	Ushort4: 'ushort4',
-	Short2: 'short2',
-	Short4: 'short4',
-	Ushort2Norm: 'ushort2norm',
-	Ushort4Norm: 'ushort4norm',
-	Short2Norm: 'short2norm',
-	Short4Norm: 'short4norm',
-	Half2: 'half2',
-	Half4: 'half4',
-	Float: 'float',
-	Float2: 'float2',
-	Float3: 'float3',
-	Float4: 'float4',
-	Uint: 'uint',
-	Uint2: 'uint2',
-	Uint3: 'uint3',
-	Uint4: 'uint4',
-	Int: 'int',
-	Int2: 'int2',
-	Int3: 'int3',
-	Int4: 'int4',
+	Uint8x2: 'uint8x2',
+	Uint8x4: 'uint8x4',
+	Sint8x2: 'sint8x2',
+	Sint8x4: 'sint8x4',
+	Unorm8x2: 'unorm8x2',
+	Unorm8x4: 'unorm8x4',
+	Snorm8x2: 'snorm8x2',
+	Snorm8x4: 'snorm8x4',
+	Uint16x2: 'uint16x2',
+	Uint16x4: 'uint16x4',
+	Sint16x2: 'sint16x2',
+	Sint16x4: 'sint16x4',
+	Unorm16x2: 'unorm16x2',
+	Unorm16x4: 'unorm16x4',
+	Snorm16x2: 'snorm16x2',
+	Snorm16x4: 'snorm16x4',
+	Float16x2: 'float16x2',
+	Float16x4: 'float16x4',
+	Float32: 'float32',
+	Float32x2: 'float32x2',
+	Float32x3: 'float32x3',
+	Float32x4: 'float32x4',
+	Uint32: 'uint32',
+	Uint32x2: 'uint32x2',
+	Uint32x3: 'uint32x3',
+	Uint32x4: 'uint32x4',
+	Sint32: 'sint32',
+	Sint32x2: 'sint32x2',
+	Sint32x3: 'sint32x3',
+	Sint32x4: 'sint32x4'
 };
 };
 
 
 export const GPUTextureFormat = {
 export const GPUTextureFormat = {