Specify mip level and array layer in TextureMTL lazy clear

These were accidentally left out in the original code and fixes
WebGPU CTS zero init tests with renderable formats on Mac.

Bug: dawn:145
Change-Id: Ied886098408a749c094addb2ceaeb7e8c14938d7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/34726
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
This commit is contained in:
Austin Eng 2020-12-03 16:55:53 +00:00 committed by Commit Bot service account
parent 10cb17e079
commit 600f6f55db
1 changed files with 4 additions and 0 deletions

View File

@ -438,12 +438,16 @@ namespace dawn_native { namespace metal {
switch (aspect) {
case Aspect::Depth:
descriptor.depthAttachment.texture = GetMTLTexture();
descriptor.depthAttachment.level = level;
descriptor.depthAttachment.slice = arrayLayer;
descriptor.depthAttachment.loadAction = MTLLoadActionClear;
descriptor.depthAttachment.storeAction = MTLStoreActionStore;
descriptor.depthAttachment.clearDepth = dClearColor;
break;
case Aspect::Stencil:
descriptor.stencilAttachment.texture = GetMTLTexture();
descriptor.stencilAttachment.level = level;
descriptor.stencilAttachment.slice = arrayLayer;
descriptor.stencilAttachment.loadAction = MTLLoadActionClear;
descriptor.stencilAttachment.storeAction = MTLStoreActionStore;
descriptor.stencilAttachment.clearStencil =