We're running into a lack of support for automatic type conversion (again) via bug 1829879. Ugh. ETA: After consuming gnikoloff/webgpu-sponza-demo
#24, which resolves subsequent items, this is the only blocker I have discovered:
Uncaptured WebGPU error: Shader module creation failed: Shader validation error
Encountered one or more errors while creating shader module "Update Lights Shader Module"
WebGPU compilation info for shader module "Update Lights Shader Module" (1 error(s), 0 warning(s), 0 info)
Shader validation error: Entry point updatePointLights at Compute is invalid
┌─ Update Lights Shader Module:94:7
│
94 │ (*particle).life = 0;
│ ^^^^^^^^^^^^^^^^ ^ naga::Expression [25]
│ │
│ naga::Expression [24]
│
= The type of [25] doesn't match the type stored in [24]
Uncaptured WebGPU error: ShaderModule with 'Update Lights Shader Module' label is invalid
Uncaptured WebGPU error: Pipeline constant error in ShaderStages(VERTEX) shader: MSL: MissingValue("ANIMATED_PARTICLES_OFFSET_START")
Encountered one or more errors while creating shader module "Skybox Material material vertex shader module"
WebGPU compilation info for shader module "Skybox Material material vertex shader module" (1 error(s), 0 warning(s), 0 info)
Shader validation error: Entry point fragmentMain at Fragment is invalid
┌─ Skybox Material material vertex shader module:119:17
│
119 │ var color = textureSampleLevel(inTexture, inSampler, cubemapVec, 4); //7.8);
│ ^^^^^^^^^^^^^^^^^^ naga::Expression [10]
│
= Expression [10] is invalid
= Sample level (exact) type [9] has an invalid type
Uncaptured WebGPU error: Error matching ShaderStages(VERTEX) shader requirements against the pipeline, caused by: ShaderModule with 'Skybox Material material vertex shader module' label is invalid
Encountered one or more errors while creating shader module "Directional Light Pass Shader Module"
WebGPU compilation info for shader module "Directional Light Pass Shader Module" (1 error(s), 0 warning(s), 0 info)
Shader validation error: Function [8] 'PBRLighting' is invalid
┌─ Directional Light Pass Shader Module:189:3
│
189 │ ╭ fn PBRLighting(
190 │ │ material: Material,
191 │ │ instanceId: u32,
192 │ │ viewSpacePos: vec3f,
· │
264 │ │ let irradiance = textureSampleLevel(diffuseIBLTexture, envTexSampler, worldSpaceNorm, 0).rgb;
│ │ ^^^^^^^^^^^^^^^^^^ naga::Expression [110]
· │
294 │ │
295 │ │ return vec4f(color, opacity);
│ ╰─────────────────────────────────^ naga::Function [8]
│
= Expression [110] is invalid
= Sample level (exact) type [109] has an invalid type
Uncaptured WebGPU error: Error matching ShaderStages(FRAGMENT) shader requirements against the pipeline, caused by: ShaderModule with 'Directional Light Pass Shader Module' label is invalid
Encountered one or more errors while creating shader module "Shader Module #17"
WebGPU compilation info for shader module "Shader Module #17" (1 error(s), 0 warning(s), 0 info)
Shader validation error: Function [10] 'ShadowCalculate' is invalid
┌─ Shader Module #17:289:3
│
289 │ ╭ fn ShadowCalculate(
290 │ │ worldPos: vec3f,
291 │ │ N: vec3f,
292 │ │ lightPosition: vec3f,
· │
333 │ │ shadow /= 16;
│ │ ^^^^^^^^^^^^ naga::Expression [79]
334 │ │
335 │ │ return shadow;
│ ╰──────────────────^ naga::Function [10]
│
= Expression [79] is invalid
= Operation Divide can't work with [78] (of type Scalar(Scalar { kind: Float, width: 4 })) and [77] (of type Scalar(Scalar { kind: Sint, width: 4 }))
Uncaptured WebGPU error: Error matching ShaderStages(FRAGMENT) shader requirements against the pipeline, caused by: ShaderModule with 'Shader Module #17' label is invalid
Encountered one or more errors while creating shader module "Point Light Render Pass Fragment Shader"
WebGPU compilation info for shader module "Point Light Render Pass Fragment Shader" (1 error(s), 0 warning(s), 0 info)
Shader validation error: Function [10] 'ShadowCalculate' is invalid
┌─ Point Light Render Pass Fragment Shader:287:3
│
287 │ ╭ fn ShadowCalculate(
288 │ │ worldPos: vec3f,
289 │ │ N: vec3f,
290 │ │ lightPosition: vec3f,
· │
331 │ │ shadow /= 16;
│ │ ^^^^^^^^^^^^ naga::Expression [79]
332 │ │
333 │ │ return shadow;
│ ╰──────────────────^ naga::Function [10]
│
= Expression [79] is invalid
= Operation Divide can't work with [78] (of type Scalar(Scalar { kind: Float, width: 4 })) and [77] (of type Scalar(Scalar { kind: Sint, width: 4 }))
Uncaptured WebGPU error: Error matching ShaderStages(FRAGMENT) shader requirements against the pipeline, caused by: ShaderModule with 'Point Light Render Pass Fragment Shader' label is invalid
Encountered one or more errors while creating shader module "Shader Module #23"
WebGPU compilation info for shader module "Shader Module #23" (1 error(s), 0 warning(s), 0 info)
Shader validation error: Function [4] 'ComputePosAndReflection' is invalid
┌─ Shader Module #23:87:3
│
87 │ ╭ fn ComputePosAndReflection(
88 │ │ tid: vec2u,
89 │ │ viewNormal: vec3f,
90 │ │ projectionMatrix: mat4x4f,
· │
106 │ │ samplePosClipSpace.y *= -1;
│ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ naga::Expression [39]
· │
131 │ │ (*outMaxDistance) = min(*outMaxDistance, select((1 - (*outSamplePosInTexSpace).y) / (*outReflDirInTexSpace).y, -(*outSamplePosInTexSpace).y / (*outReflDirInTexSpace).y, (*outReflDirInTexSpace).y < 0));
132 │ │ (*outMaxDistance) = min(*outMaxDistance, select((1 - (*outSamplePosInTexSpace).z) / (*outReflDirInTexSpace).z, -(*outSamplePosInTexSpace).z / (*outReflDirInTexSpace).z, (*outReflDirInTexSpace).z < 0));
│ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────^ naga::Function [4]
│
= Expression [39] is invalid
= Operation Multiply can't work with [38] (of type Scalar(Scalar { kind: Float, width: 4 })) and [37] (of type Scalar(Scalar { kind: Sint, width: 4 }))
Uncaptured WebGPU error: ShaderModule with 'Shader Module #23' label is invalid
Encountered one or more errors while creating shader module "Shader Module #25"
WebGPU compilation info for shader module "Shader Module #25" (1 error(s), 0 warning(s), 0 info)
Shader validation error: Entry point main at Compute is invalid
┌─ Shader Module #25:34:13
│
34 │ let a = textureSampleLevel(srcTexture, srcSampler, vec2(texCoords.x - 2 * x, texCoords.y + 2 * y), 0).rgb;
│ ^^^^^^^^^^^^^^^^^^ naga::Expression [41]
│
= Expression [41] is invalid
= Sample level (exact) type [40] has an invalid type
Uncaptured WebGPU error: ShaderModule with 'Shader Module #25' label is invalid
Uncaptured WebGPU error: In a set_pipeline command, caused by: ComputePipeline with 'Update Lights Compute PSO' label is invalid
Uncaptured WebGPU error: Command encoder is locked by a previously created render/compute pass. Before recording any new commands, the pass must be ended.
Uncaptured WebGPU error: Command encoder is invalid
Uncaptured WebGPU error: CommandBuffer with 'Frame Command Encoder' label is invalid
Encountered one or more errors while creating shader module "Shader Module #31"
WebGPU compilation info for shader module "Shader Module #31" (1 error(s), 0 warning(s), 0 info)
Shader validation error: Entry point main at Compute is invalid
┌─ Shader Module #31:94:23
│
94 │ irradiance += textureSampleLevel(inTexture, cubeSampler, sampleVector, 2).rgb * cos(theta) * sin(theta);
│ ^^^^^^^^^^^^^^^^^^ naga::Expression [80]
│
= Expression [80] is invalid
= Sample level (exact) type [79] has an invalid type
Uncaptured WebGPU error: ShaderModule with 'Shader Module #31' label is invalid
Uncaptured WebGPU error: In a set_pipeline command, caused by: ComputePipeline with 'Diffuse IBL Compute PSO' label is invalid
Uncaptured WebGPU error: CommandBuffer with 'Diffuse IBL Command Encoder' label is invalid
Description
•