Remove deprecated wgpu::StoreOp::Clear
Bug: dawn:937 Change-Id: I80cdb3b6b3caecc83a6e8cc009bb494179808cd9 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63742 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Brandon Jones <bajones@google.com> Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
parent
e2cc5d624a
commit
77755b9f55
|
@ -1094,8 +1094,7 @@
|
|||
"category": "enum",
|
||||
"values": [
|
||||
{"value": 0, "name": "store"},
|
||||
{"value": 1, "name": "discard"},
|
||||
{"value": 2, "name": "clear"}
|
||||
{"value": 1, "name": "discard"}
|
||||
]
|
||||
},
|
||||
"origin 3D": {
|
||||
|
|
|
@ -127,7 +127,6 @@ namespace dawn_native {
|
|||
break;
|
||||
|
||||
case wgpu::StoreOp::Discard:
|
||||
case wgpu::StoreOp::Clear:
|
||||
view->GetTexture()->SetIsSubresourceContentInitialized(false, range);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -41,14 +41,6 @@ namespace dawn_native {
|
|||
|
||||
namespace {
|
||||
|
||||
MaybeError ValidateDeprecatedStoreOp(DeviceBase* device, wgpu::StoreOp value) {
|
||||
if (value == wgpu::StoreOp::Clear) {
|
||||
device->EmitDeprecationWarning(
|
||||
"The 'clear' storeOp is deprecated. Use 'discard' instead.");
|
||||
}
|
||||
return ValidateStoreOp(value);
|
||||
}
|
||||
|
||||
MaybeError ValidateB2BCopyAlignment(uint64_t dataSize,
|
||||
uint64_t srcOffset,
|
||||
uint64_t dstOffset) {
|
||||
|
@ -232,7 +224,7 @@ namespace dawn_native {
|
|||
}
|
||||
|
||||
DAWN_TRY(ValidateLoadOp(colorAttachment.loadOp));
|
||||
DAWN_TRY(ValidateDeprecatedStoreOp(device, colorAttachment.storeOp));
|
||||
DAWN_TRY(ValidateStoreOp(colorAttachment.storeOp));
|
||||
|
||||
if (colorAttachment.loadOp == wgpu::LoadOp::Clear) {
|
||||
if (std::isnan(colorAttachment.clearColor.r) ||
|
||||
|
@ -286,8 +278,8 @@ namespace dawn_native {
|
|||
|
||||
DAWN_TRY(ValidateLoadOp(depthStencilAttachment->depthLoadOp));
|
||||
DAWN_TRY(ValidateLoadOp(depthStencilAttachment->stencilLoadOp));
|
||||
DAWN_TRY(ValidateDeprecatedStoreOp(device, depthStencilAttachment->depthStoreOp));
|
||||
DAWN_TRY(ValidateDeprecatedStoreOp(device, depthStencilAttachment->stencilStoreOp));
|
||||
DAWN_TRY(ValidateStoreOp(depthStencilAttachment->depthStoreOp));
|
||||
DAWN_TRY(ValidateStoreOp(depthStencilAttachment->stencilStoreOp));
|
||||
|
||||
if (attachment->GetAspects() == (Aspect::Depth | Aspect::Stencil) &&
|
||||
depthStencilAttachment->depthReadOnly != depthStencilAttachment->stencilReadOnly) {
|
||||
|
|
|
@ -36,7 +36,6 @@ namespace dawn_native { namespace d3d12 {
|
|||
D3D12_RENDER_PASS_ENDING_ACCESS_TYPE D3D12EndingAccessType(wgpu::StoreOp storeOp) {
|
||||
switch (storeOp) {
|
||||
case wgpu::StoreOp::Discard:
|
||||
case wgpu::StoreOp::Clear:
|
||||
return D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_DISCARD;
|
||||
case wgpu::StoreOp::Store:
|
||||
return D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_PRESERVE;
|
||||
|
@ -56,7 +55,7 @@ namespace dawn_native { namespace d3d12 {
|
|||
ToBackend(resolveDestination->GetTexture())->GetD3D12Resource();
|
||||
|
||||
// Clear or preserve the resolve source.
|
||||
if (storeOp == wgpu::StoreOp::Discard || storeOp == wgpu::StoreOp::Clear) {
|
||||
if (storeOp == wgpu::StoreOp::Discard) {
|
||||
resolveParameters.PreserveResolveSource = false;
|
||||
} else if (storeOp == wgpu::StoreOp::Store) {
|
||||
resolveParameters.PreserveResolveSource = true;
|
||||
|
|
|
@ -101,7 +101,6 @@ namespace dawn_native { namespace metal {
|
|||
kMTLStoreActionStoreAndMultisampleResolve;
|
||||
break;
|
||||
case wgpu::StoreOp::Discard:
|
||||
case wgpu::StoreOp::Clear:
|
||||
descriptor.colorAttachments[i].storeAction =
|
||||
MTLStoreActionMultisampleResolve;
|
||||
break;
|
||||
|
@ -112,7 +111,6 @@ namespace dawn_native { namespace metal {
|
|||
descriptor.colorAttachments[i].storeAction = MTLStoreActionStore;
|
||||
break;
|
||||
case wgpu::StoreOp::Discard:
|
||||
case wgpu::StoreOp::Clear:
|
||||
descriptor.colorAttachments[i].storeAction = MTLStoreActionDontCare;
|
||||
break;
|
||||
}
|
||||
|
@ -137,7 +135,6 @@ namespace dawn_native { namespace metal {
|
|||
break;
|
||||
|
||||
case wgpu::StoreOp::Discard:
|
||||
case wgpu::StoreOp::Clear:
|
||||
descriptor.depthAttachment.storeAction = MTLStoreActionDontCare;
|
||||
break;
|
||||
}
|
||||
|
@ -165,7 +162,6 @@ namespace dawn_native { namespace metal {
|
|||
break;
|
||||
|
||||
case wgpu::StoreOp::Discard:
|
||||
case wgpu::StoreOp::Clear:
|
||||
descriptor.stencilAttachment.storeAction = MTLStoreActionDontCare;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -1055,8 +1055,7 @@ namespace dawn_native { namespace opengl {
|
|||
}
|
||||
}
|
||||
|
||||
if (attachmentInfo->storeOp == wgpu::StoreOp::Discard ||
|
||||
attachmentInfo->storeOp == wgpu::StoreOp::Clear) {
|
||||
if (attachmentInfo->storeOp == wgpu::StoreOp::Discard) {
|
||||
// TODO(natlee@microsoft.com): call glDiscard to do optimization
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,46 +34,6 @@ class DeprecationTests : public DawnTest {
|
|||
}
|
||||
};
|
||||
|
||||
// Test that StoreOp::Clear is deprecated.
|
||||
TEST_P(DeprecationTests, StoreOpClear) {
|
||||
utils::BasicRenderPass renderPass = utils::CreateBasicRenderPass(device, 1, 1);
|
||||
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
|
||||
wgpu::RenderPassEncoder pass;
|
||||
|
||||
// Check that a storeOp of Clear for color attachments raises a validation warning.
|
||||
renderPass.renderPassInfo.cColorAttachments[0].storeOp = wgpu::StoreOp::Clear;
|
||||
|
||||
EXPECT_DEPRECATION_WARNING(pass = encoder.BeginRenderPass(&renderPass.renderPassInfo));
|
||||
pass.EndPass();
|
||||
|
||||
// Check that a storeOp of Clear for depth/stencil attachments raises a validation warning.
|
||||
wgpu::TextureDescriptor descriptor;
|
||||
descriptor.dimension = wgpu::TextureDimension::e2D;
|
||||
descriptor.size = {1, 1, 1};
|
||||
descriptor.sampleCount = 1;
|
||||
descriptor.format = wgpu::TextureFormat::Depth24PlusStencil8;
|
||||
descriptor.mipLevelCount = 1;
|
||||
descriptor.usage = wgpu::TextureUsage::RenderAttachment;
|
||||
wgpu::Texture depthStencil = device.CreateTexture(&descriptor);
|
||||
|
||||
wgpu::RenderPassDepthStencilAttachment* depthAttachment =
|
||||
&renderPass.renderPassInfo.cDepthStencilAttachmentInfo;
|
||||
renderPass.renderPassInfo.depthStencilAttachment = depthAttachment;
|
||||
depthAttachment->view = depthStencil.CreateView();
|
||||
|
||||
renderPass.renderPassInfo.cColorAttachments[0].storeOp = wgpu::StoreOp::Discard;
|
||||
depthAttachment->depthStoreOp = wgpu::StoreOp::Clear;
|
||||
|
||||
EXPECT_DEPRECATION_WARNING(pass = encoder.BeginRenderPass(&renderPass.renderPassInfo));
|
||||
pass.EndPass();
|
||||
|
||||
depthAttachment->depthStoreOp = wgpu::StoreOp::Discard;
|
||||
depthAttachment->stencilStoreOp = wgpu::StoreOp::Clear;
|
||||
|
||||
EXPECT_DEPRECATION_WARNING(pass = encoder.BeginRenderPass(&renderPass.renderPassInfo));
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
// Test that readonly storage textures are deprecated
|
||||
TEST_P(DeprecationTests, ReadOnlyStorageTextures) {
|
||||
// Control case: WriteOnly storage textures are allowed.
|
||||
|
|
Loading…
Reference in New Issue