From 455545f02473e893ffe4c304c06437a5a488b12c Mon Sep 17 00:00:00 2001 From: Andy Hovingh <6198728+AndyHovingh@users.noreply.github.com> Date: Tue, 5 Aug 2025 16:35:25 -0500 Subject: [PATCH] wgpu: fix ssao bent normals --- libs/filamat/src/shaders/CodeGenerator.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/filamat/src/shaders/CodeGenerator.cpp b/libs/filamat/src/shaders/CodeGenerator.cpp index 03907251fa..c781719f6d 100644 --- a/libs/filamat/src/shaders/CodeGenerator.cpp +++ b/libs/filamat/src/shaders/CodeGenerator.cpp @@ -539,13 +539,14 @@ io::sstream& CodeGenerator::generateOutput(io::sstream& out, ShaderStage stage, const char* swizzleString = ""; - // Metal doesn't support some 3-component texture formats, so the backend uses 4-component + // Metal and WebGPU don't support some 3-component texture formats, so the backend uses 4-component // formats behind the scenes. It's an error to output fewer components than the attachment // needs, so we always output a float4 instead of a float3. It's never an error to output extra // components. // // Meanwhile, ESSL 1.0 must always write to gl_FragColor, a vec4. - if (mTargetApi == TargetApi::METAL || mFeatureLevel == FeatureLevel::FEATURE_LEVEL_0) { + if (mTargetApi == TargetApi::METAL || mTargetApi == TargetApi::WEBGPU || + mFeatureLevel == FeatureLevel::FEATURE_LEVEL_0) { if (outputType == MaterialBuilder::OutputType::FLOAT3) { outputType = MaterialBuilder::OutputType::FLOAT4; swizzleString = ".rgb";