From b563ede4e67246479734452d46cf6f04e3b2fad7 Mon Sep 17 00:00:00 2001 From: Geoff Lang Date: Fri, 20 Sep 2024 20:30:21 -0400 Subject: [PATCH] WebGPU: initDefaultUniformBlocks outside of an ASSERT initDefaultUniformBlocks was not being called in release builds and crashing when attempting to read the uniform layout info. Bug: angleproject:42267100 Change-Id: I9e13ffee1260e4f30aed24c7bfa9e767639a5c2b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5878925 Reviewed-by: Matthew Denton Commit-Queue: Geoff Lang --- src/libANGLE/renderer/wgpu/ProgramWgpu.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/libANGLE/renderer/wgpu/ProgramWgpu.cpp b/src/libANGLE/renderer/wgpu/ProgramWgpu.cpp index a1f9fc2cd26..70c7ddee434 100644 --- a/src/libANGLE/renderer/wgpu/ProgramWgpu.cpp +++ b/src/libANGLE/renderer/wgpu/ProgramWgpu.cpp @@ -224,12 +224,19 @@ class LinkTaskWgpu : public LinkTask // The default uniform block's CPU buffer needs to be allocated and the layout calculated, // now that the list of uniforms is known. - ASSERT(initDefaultUniformBlocks() == angle::Result::Continue); + angle::Result initUniformBlocksResult = initDefaultUniformBlocks(); + if (IsError(initUniformBlocksResult)) + { + mLinkResult = initUniformBlocksResult; + return; + } + + mLinkResult = angle::Result::Continue; } angle::Result getResult(const gl::Context *context, gl::InfoLog &infoLog) override { - return angle::Result::Continue; + return mLinkResult; } private: @@ -319,6 +326,7 @@ class LinkTaskWgpu : public LinkTask wgpu::Device mDevice; ProgramWgpu *mProgram = nullptr; const gl::ProgramExecutable *mExecutable; + angle::Result mLinkResult = angle::Result::Stop; }; } // anonymous namespace