Make Texture/QuerySet destroy always valid.
This follows the recent semantic from the WebGPU spec and fixes a couple
failing CTS tests.
Bug: None
Change-Id: I9197ea3fda6c15bd9302f8d60e70ee00f1d37708
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120980
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
diff --git a/src/dawn/native/QuerySet.cpp b/src/dawn/native/QuerySet.cpp
index 0682495..585e185 100644
--- a/src/dawn/native/QuerySet.cpp
+++ b/src/dawn/native/QuerySet.cpp
@@ -165,9 +165,6 @@
}
void QuerySetBase::APIDestroy() {
- if (GetDevice()->ConsumedError(ValidateDestroy())) {
- return;
- }
Destroy();
}
@@ -179,9 +176,4 @@
return mQueryCount;
}
-MaybeError QuerySetBase::ValidateDestroy() const {
- DAWN_TRY(GetDevice()->ValidateObject(this));
- return {};
-}
-
} // namespace dawn::native
diff --git a/src/dawn/native/QuerySet.h b/src/dawn/native/QuerySet.h
index fa288a0..d0cfd89 100644
--- a/src/dawn/native/QuerySet.h
+++ b/src/dawn/native/QuerySet.h
@@ -59,8 +59,6 @@
~QuerySetBase() override;
private:
- MaybeError ValidateDestroy() const;
-
wgpu::QueryType mQueryType;
uint32_t mQueryCount;
std::vector<wgpu::PipelineStatisticName> mPipelineStatistics;
diff --git a/src/dawn/native/Texture.cpp b/src/dawn/native/Texture.cpp
index 2467533..3fe9e58 100644
--- a/src/dawn/native/Texture.cpp
+++ b/src/dawn/native/Texture.cpp
@@ -807,10 +807,6 @@
}
void TextureBase::APIDestroy() {
- if (GetDevice()->ConsumedError(ValidateDestroy(), "calling %s.Destroy().", this)) {
- return;
- }
- ASSERT(!IsError());
Destroy();
}
@@ -845,11 +841,6 @@
return mUsage;
}
-MaybeError TextureBase::ValidateDestroy() const {
- DAWN_TRY(GetDevice()->ValidateObject(this));
- return {};
-}
-
// TextureViewBase
TextureViewBase::TextureViewBase(TextureBase* texture, const TextureViewDescriptor* descriptor)
diff --git a/src/dawn/native/Texture.h b/src/dawn/native/Texture.h
index 8513ad0..91372af 100644
--- a/src/dawn/native/Texture.h
+++ b/src/dawn/native/Texture.h
@@ -118,7 +118,6 @@
private:
TextureBase(DeviceBase* device, const TextureDescriptor* descriptor, ObjectBase::ErrorTag tag);
- MaybeError ValidateDestroy() const;
wgpu::TextureDimension mDimension;
const Format& mFormat;
FormatSet mViewFormats;
diff --git a/webgpu-cts/expectations.txt b/webgpu-cts/expectations.txt
index 9961181..c1eb289 100644
--- a/webgpu-cts/expectations.txt
+++ b/webgpu-cts/expectations.txt
@@ -380,7 +380,6 @@
crbug.com/dawn/0000 webgpu:api,validation,encoding,createRenderBundleEncoder:attachment_state,limits,maxColorAttachmentBytesPerSample,aligned:format="rgba8unorm" [ Failure ]
crbug.com/dawn/0000 webgpu:api,validation,encoding,createRenderBundleEncoder:attachment_state,limits,maxColorAttachmentBytesPerSample,aligned:format="rgba8unorm-srgb" [ Failure ]
crbug.com/dawn/0000 webgpu:api,validation,encoding,createRenderBundleEncoder:attachment_state,limits,maxColorAttachmentBytesPerSample,unaligned:formats=["r32float","rgba8unorm","rgba32float","r8unorm","r8unorm"] [ Failure ]
-crbug.com/dawn/0000 webgpu:api,validation,query_set,destroy:invalid_queryset: [ Failure ]
crbug.com/dawn/0000 webgpu:api,validation,render_pass,render_pass_descriptor:color_attachments,limits,maxColorAttachmentBytesPerSample,aligned:format="bgra8unorm" [ Failure ]
crbug.com/dawn/0000 webgpu:api,validation,render_pass,render_pass_descriptor:color_attachments,limits,maxColorAttachmentBytesPerSample,aligned:format="bgra8unorm-srgb" [ Failure ]
crbug.com/dawn/0000 webgpu:api,validation,render_pass,render_pass_descriptor:color_attachments,limits,maxColorAttachmentBytesPerSample,aligned:format="rg32float" [ Failure ]
@@ -415,7 +414,6 @@
crbug.com/dawn/0000 webgpu:api,validation,render_pipeline,overrides:identifier,fragment:isAsync=true;fragmentConstants={"s%C3%A9quen%C3%A7age":0} [ Failure ]
crbug.com/dawn/0000 webgpu:api,validation,render_pipeline,overrides:identifier,vertex:isAsync=false;vertexConstants={"s%C3%A9quen%C3%A7age":0} [ Failure ]
crbug.com/dawn/0000 webgpu:api,validation,render_pipeline,overrides:identifier,vertex:isAsync=true;vertexConstants={"s%C3%A9quen%C3%A7age":0} [ Failure ]
-crbug.com/dawn/0000 webgpu:api,validation,texture,destroy:invalid_texture: [ Failure ]
crbug.com/dawn/0000 [ monterey ] webgpu:web_platform,canvas,configure:alpha_mode:* [ Failure ]
crbug.com/dawn/0000 [ monterey ] webgpu:web_platform,canvas,configure:defaults:* [ Failure ]
crbug.com/dawn/0000 [ monterey ] webgpu:web_platform,canvas,configure:device:* [ Failure ]