зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1860921 - Revert Texture::Destroy() and add Texture::ForceDestroy() r=webgpu-reviewers,nical
This is a short term fix. Long term fix needs to be done by Bug 1860958. Presenting WebGPU without readback needs a way to destroy Texture. Then Texture::ForceDestroy() is added for it. Differential Revision: https://phabricator.services.mozilla.com/D191829
This commit is contained in:
Родитель
ba0d5e580e
Коммит
40d51bef58
|
@ -201,7 +201,7 @@ void CanvasContext::SwapChainPresent() {
|
|||
mBridge->SwapChainPresent(mTexture->mId, *mLastRemoteTextureId,
|
||||
*mRemoteTextureOwnerId);
|
||||
if (mUseExternalTextureInSwapChain) {
|
||||
mTexture->Destroy();
|
||||
mTexture->ForceDestroy();
|
||||
mNewTextureRequested = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -67,6 +67,13 @@ already_AddRefed<TextureView> Texture::CreateView(
|
|||
return view.forget();
|
||||
}
|
||||
|
||||
void Texture::Destroy() { Cleanup(); }
|
||||
void Texture::Destroy() {
|
||||
// TODO: we don't have to implement it right now, but it's used by the
|
||||
// examples
|
||||
|
||||
// XXX Bug 1860958.
|
||||
}
|
||||
|
||||
void Texture::ForceDestroy() { Cleanup(); }
|
||||
|
||||
} // namespace mozilla::webgpu
|
||||
|
|
|
@ -56,6 +56,7 @@ class Texture final : public ObjectBase, public ChildOf<Device> {
|
|||
already_AddRefed<TextureView> CreateView(
|
||||
const dom::GPUTextureViewDescriptor& aDesc);
|
||||
void Destroy();
|
||||
void ForceDestroy();
|
||||
|
||||
uint32_t Width() const { return mSize.width; }
|
||||
uint32_t Height() const { return mSize.height; }
|
||||
|
|
Загрузка…
Ссылка в новой задаче