Clear reference to MTLTexture on TextureView::DestroyImpl
Bug: dawn:1355 Change-Id: I834b02a05d50c39b1a8d272e2d437d7ce1f96fb5 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/115061 Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: Austin Eng <enga@chromium.org> Reviewed-by: Loko Kung <lokokung@google.com>
This commit is contained in:
parent
13e48132c0
commit
5cc118bde7
|
@ -104,8 +104,8 @@ class TextureView final : public TextureViewBase {
|
|||
private:
|
||||
using TextureViewBase::TextureViewBase;
|
||||
MaybeError Initialize(const TextureViewDescriptor* descriptor);
|
||||
void DestroyImpl() override;
|
||||
|
||||
// TODO(crbug.com/dawn/1355): Clear this reference on texture destroy.
|
||||
NSPRef<id<MTLTexture>> mMtlTextureView;
|
||||
};
|
||||
|
||||
|
|
|
@ -1124,6 +1124,10 @@ MaybeError TextureView::Initialize(const TextureViewDescriptor* descriptor) {
|
|||
return {};
|
||||
}
|
||||
|
||||
void TextureView::DestroyImpl() {
|
||||
mMtlTextureView = nil;
|
||||
}
|
||||
|
||||
id<MTLTexture> TextureView::GetMTLTexture() const {
|
||||
ASSERT(mMtlTextureView != nullptr);
|
||||
return mMtlTextureView.Get();
|
||||
|
|
Loading…
Reference in New Issue