Add missing validation for unsupported texture view dims.

BUG=chromium:984809

Change-Id: Iea6bf88f79f9749237052c16e0ab2dd15d7d4308
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/9081
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Corentin Wallez 2019-07-17 14:49:37 +00:00 committed by Commit Bot service account
parent ee0fa175a3
commit 9dbb81f004
1 changed files with 5 additions and 0 deletions

View File

@ -373,6 +373,11 @@ namespace dawn_native {
} }
DAWN_TRY(ValidateTextureViewDimension(descriptor->dimension)); DAWN_TRY(ValidateTextureViewDimension(descriptor->dimension));
if (descriptor->dimension == dawn::TextureViewDimension::e1D ||
descriptor->dimension == dawn::TextureViewDimension::e3D) {
return DAWN_VALIDATION_ERROR("Texture view dimension must be 2D compatible.");
}
DAWN_TRY(ValidateTextureFormat(descriptor->format)); DAWN_TRY(ValidateTextureFormat(descriptor->format));
// TODO(jiawei.shao@intel.com): check stuff based on resource limits // TODO(jiawei.shao@intel.com): check stuff based on resource limits