forked from mirrors/gecko-dev
Bug 1893188: Make ComputePipeline::Cleanup gracefully handle a missing bridge. r=webgpu-reviewers,ErichDonGubler
This aligns the implementation with RenderPipeline::Cleanup(). It also adds a drive-by assert to GetBindGroupLayout() in both classes to add confidence that the bridge is in the expected state. Differential Revision: https://phabricator.services.mozilla.com/D208916
This commit is contained in:
parent
14624240c9
commit
c0e2f475a2
2 changed files with 6 additions and 0 deletions
|
|
@ -33,6 +33,10 @@ void ComputePipeline::Cleanup() {
|
||||||
mValid = false;
|
mValid = false;
|
||||||
|
|
||||||
auto bridge = mParent->GetBridge();
|
auto bridge = mParent->GetBridge();
|
||||||
|
if (!bridge) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (bridge->CanSend()) {
|
if (bridge->CanSend()) {
|
||||||
bridge->SendComputePipelineDrop(mId);
|
bridge->SendComputePipelineDrop(mId);
|
||||||
if (mImplicitPipelineLayoutId) {
|
if (mImplicitPipelineLayoutId) {
|
||||||
|
|
@ -54,6 +58,7 @@ void ComputePipeline::Cleanup() {
|
||||||
already_AddRefed<BindGroupLayout> ComputePipeline::GetBindGroupLayout(
|
already_AddRefed<BindGroupLayout> ComputePipeline::GetBindGroupLayout(
|
||||||
uint32_t aIndex) const {
|
uint32_t aIndex) const {
|
||||||
auto bridge = mParent->GetBridge();
|
auto bridge = mParent->GetBridge();
|
||||||
|
MOZ_ASSERT(bridge && bridge->CanSend());
|
||||||
auto* client = bridge->GetClient();
|
auto* client = bridge->GetClient();
|
||||||
|
|
||||||
ipc::ByteBuf bb;
|
ipc::ByteBuf bb;
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,7 @@ void RenderPipeline::Cleanup() {
|
||||||
already_AddRefed<BindGroupLayout> RenderPipeline::GetBindGroupLayout(
|
already_AddRefed<BindGroupLayout> RenderPipeline::GetBindGroupLayout(
|
||||||
uint32_t aIndex) const {
|
uint32_t aIndex) const {
|
||||||
auto bridge = mParent->GetBridge();
|
auto bridge = mParent->GetBridge();
|
||||||
|
MOZ_ASSERT(bridge && bridge->CanSend());
|
||||||
auto* client = bridge->GetClient();
|
auto* client = bridge->GetClient();
|
||||||
|
|
||||||
ipc::ByteBuf bb;
|
ipc::ByteBuf bb;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue