Skip to content

Commit

Permalink
WebGPU: initDefaultUniformBlocks outside of an ASSERT
Browse files Browse the repository at this point in the history
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 <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
  • Loading branch information
vonture authored and Angle LUCI CQ committed Sep 23, 2024
1 parent a6ec0bb commit b563ede
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/libANGLE/renderer/wgpu/ProgramWgpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit b563ede

Please sign in to comment.