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>
This commit is contained in:
parent
f16b9bbd6e
commit
b4d2bbb24f
|
@ -165,9 +165,6 @@ MaybeError QuerySetBase::ValidateCanUseInSubmitNow() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void QuerySetBase::APIDestroy() {
|
void QuerySetBase::APIDestroy() {
|
||||||
if (GetDevice()->ConsumedError(ValidateDestroy())) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Destroy();
|
Destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -179,9 +176,4 @@ uint32_t QuerySetBase::APIGetCount() const {
|
||||||
return mQueryCount;
|
return mQueryCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
MaybeError QuerySetBase::ValidateDestroy() const {
|
|
||||||
DAWN_TRY(GetDevice()->ValidateObject(this));
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace dawn::native
|
} // namespace dawn::native
|
||||||
|
|
|
@ -59,8 +59,6 @@ class QuerySetBase : public ApiObjectBase {
|
||||||
~QuerySetBase() override;
|
~QuerySetBase() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
MaybeError ValidateDestroy() const;
|
|
||||||
|
|
||||||
wgpu::QueryType mQueryType;
|
wgpu::QueryType mQueryType;
|
||||||
uint32_t mQueryCount;
|
uint32_t mQueryCount;
|
||||||
std::vector<wgpu::PipelineStatisticName> mPipelineStatistics;
|
std::vector<wgpu::PipelineStatisticName> mPipelineStatistics;
|
||||||
|
|
|
@ -807,10 +807,6 @@ TextureViewBase* TextureBase::APICreateView(const TextureViewDescriptor* descrip
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextureBase::APIDestroy() {
|
void TextureBase::APIDestroy() {
|
||||||
if (GetDevice()->ConsumedError(ValidateDestroy(), "calling %s.Destroy().", this)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
ASSERT(!IsError());
|
|
||||||
Destroy();
|
Destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -845,11 +841,6 @@ wgpu::TextureUsage TextureBase::APIGetUsage() const {
|
||||||
return mUsage;
|
return mUsage;
|
||||||
}
|
}
|
||||||
|
|
||||||
MaybeError TextureBase::ValidateDestroy() const {
|
|
||||||
DAWN_TRY(GetDevice()->ValidateObject(this));
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
// TextureViewBase
|
// TextureViewBase
|
||||||
|
|
||||||
TextureViewBase::TextureViewBase(TextureBase* texture, const TextureViewDescriptor* descriptor)
|
TextureViewBase::TextureViewBase(TextureBase* texture, const TextureViewDescriptor* descriptor)
|
||||||
|
|
|
@ -118,7 +118,6 @@ class TextureBase : public ApiObjectBase {
|
||||||
private:
|
private:
|
||||||
TextureBase(DeviceBase* device, const TextureDescriptor* descriptor, ObjectBase::ErrorTag tag);
|
TextureBase(DeviceBase* device, const TextureDescriptor* descriptor, ObjectBase::ErrorTag tag);
|
||||||
|
|
||||||
MaybeError ValidateDestroy() const;
|
|
||||||
wgpu::TextureDimension mDimension;
|
wgpu::TextureDimension mDimension;
|
||||||
const Format& mFormat;
|
const Format& mFormat;
|
||||||
FormatSet mViewFormats;
|
FormatSet mViewFormats;
|
||||||
|
|
|
@ -380,7 +380,6 @@ crbug.com/dawn/0000 webgpu:api,validation,encoding,createRenderBundleEncoder:att
|
||||||
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" [ 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,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,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" [ 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="bgra8unorm-srgb" [ Failure ]
|
||||||
crbug.com/dawn/0000 webgpu:api,validation,render_pass,render_pass_descriptor:color_attachments,limits,maxColorAttachmentBytesPerSample,aligned:format="rg32float" [ 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,f
|
||||||
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,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=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,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: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:defaults:* [ Failure ]
|
||||||
crbug.com/dawn/0000 [ monterey ] webgpu:web_platform,canvas,configure:device:* [ Failure ]
|
crbug.com/dawn/0000 [ monterey ] webgpu:web_platform,canvas,configure:device:* [ Failure ]
|
||||||
|
|
Loading…
Reference in New Issue