Texture: Add validation that the mip chain can't be too large

BUG=chromium:954769

Change-Id: I07a00230294cb9385b79edb6150d9f0f7b4b7284
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6760
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This commit is contained in:
Corentin Wallez
2019-04-29 09:31:06 +00:00
committed by Commit Bot service account
parent 9286adcb0f
commit bbed457796
3 changed files with 76 additions and 2 deletions

View File

@@ -183,7 +183,7 @@ TEST_F(TextureViewValidationTest, CreateCubeMapTextureView) {
// It is an error to create a cube map texture view with width != height.
{
dawn::Texture nonSquareTexture = Create2DArrayTexture(device, 18, 32, 16);
dawn::Texture nonSquareTexture = Create2DArrayTexture(device, 18, 32, 16, 5);
dawn::TextureViewDescriptor descriptor = base2DArrayTextureViewDescriptor;
descriptor.dimension = dawn::TextureViewDimension::Cube;
@@ -193,7 +193,7 @@ TEST_F(TextureViewValidationTest, CreateCubeMapTextureView) {
// It is an error to create a cube map array texture view with width != height.
{
dawn::Texture nonSquareTexture = Create2DArrayTexture(device, 18, 32, 16);
dawn::Texture nonSquareTexture = Create2DArrayTexture(device, 18, 32, 16, 5);
dawn::TextureViewDescriptor descriptor = base2DArrayTextureViewDescriptor;
descriptor.dimension = dawn::TextureViewDimension::CubeArray;