diff --git a/src/backend/BindGroupLayout.cpp b/src/backend/BindGroupLayout.cpp index a7a97c7a18..64d4941470 100644 --- a/src/backend/BindGroupLayout.cpp +++ b/src/backend/BindGroupLayout.cpp @@ -109,7 +109,6 @@ namespace backend { BindGroupLayoutBase blueprint(this, true); auto* result = mDevice->GetOrCreateBindGroupLayout(&blueprint, this); - result->Reference(); return result; } diff --git a/src/backend/Device.cpp b/src/backend/Device.cpp index 8bce2e6ed4..98f794de99 100644 --- a/src/backend/Device.cpp +++ b/src/backend/Device.cpp @@ -82,6 +82,7 @@ namespace backend { // modified. auto iter = mCaches->bindGroupLayouts.find(const_cast(blueprint)); if (iter != mCaches->bindGroupLayouts.end()) { + (*iter)->Reference(); return *iter; }