From d020de45014756b86d0ad3c3e0ddda474f4d8041 Mon Sep 17 00:00:00 2001 From: Austin Eng Date: Wed, 24 Mar 2021 08:38:32 +0000 Subject: [PATCH] Validate the texture Aspect enum in ImageCopyTexture Bug: chromium:1191389, chromium:1191770 Change-Id: I973b8951d43bd0463afcd05fdd7104184db1be2d Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/45841 Reviewed-by: Jiawei Shao Reviewed-by: Corentin Wallez Commit-Queue: Corentin Wallez --- src/dawn_native/CommandValidation.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/dawn_native/CommandValidation.cpp b/src/dawn_native/CommandValidation.cpp index b5cfc7c8b9..7ddd044194 100644 --- a/src/dawn_native/CommandValidation.cpp +++ b/src/dawn_native/CommandValidation.cpp @@ -24,6 +24,7 @@ #include "dawn_native/QuerySet.h" #include "dawn_native/RenderBundle.h" #include "dawn_native/RenderPipeline.h" +#include "dawn_native/ValidationUtils_autogen.h" namespace dawn_native { @@ -287,6 +288,7 @@ namespace dawn_native { return DAWN_VALIDATION_ERROR("mipLevel out of range"); } + DAWN_TRY(ValidateTextureAspect(textureCopy.aspect)); if (SelectFormatAspects(texture->GetFormat(), textureCopy.aspect) == Aspect::None) { return DAWN_VALIDATION_ERROR("Texture does not have selected aspect for texture copy."); }