From 2f022078057366c369d155dbd642b398ad5a018d Mon Sep 17 00:00:00 2001 From: Austin Eng Date: Wed, 3 Jun 2020 16:43:35 +0000 Subject: [PATCH] Generate specific error when BGL storageTextureFormat is missing Some WebGPU CTS tests were failing with invalid WGPUTextureFormat when really the format was simply missing. This CL updates the validation code so it is more clear. Bug: dawn:433 Change-Id: Ie7aacd01ea424d9f5df0078703a474e98b72ce41 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/22543 Reviewed-by: Corentin Wallez Reviewed-by: Stephen White Commit-Queue: Austin Eng --- src/dawn_native/BindGroupLayout.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/dawn_native/BindGroupLayout.cpp b/src/dawn_native/BindGroupLayout.cpp index a7d19fb0a7..eb2cd066d9 100644 --- a/src/dawn_native/BindGroupLayout.cpp +++ b/src/dawn_native/BindGroupLayout.cpp @@ -68,6 +68,9 @@ namespace dawn_native { switch (bindingType) { case wgpu::BindingType::ReadonlyStorageTexture: case wgpu::BindingType::WriteonlyStorageTexture: { + if (storageTextureFormat == wgpu::TextureFormat::Undefined) { + return DAWN_VALIDATION_ERROR("Storage texture format is missing"); + } DAWN_TRY(ValidateTextureFormat(storageTextureFormat)); const Format* format = nullptr;