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 <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-06-03 16:43:35 +00:00 committed by Commit Bot service account
parent 0768ffa742
commit 2f02207805
1 changed files with 3 additions and 0 deletions

View File

@ -68,6 +68,9 @@ namespace dawn_native {
switch (bindingType) { switch (bindingType) {
case wgpu::BindingType::ReadonlyStorageTexture: case wgpu::BindingType::ReadonlyStorageTexture:
case wgpu::BindingType::WriteonlyStorageTexture: { case wgpu::BindingType::WriteonlyStorageTexture: {
if (storageTextureFormat == wgpu::TextureFormat::Undefined) {
return DAWN_VALIDATION_ERROR("Storage texture format is missing");
}
DAWN_TRY(ValidateTextureFormat(storageTextureFormat)); DAWN_TRY(ValidateTextureFormat(storageTextureFormat));
const Format* format = nullptr; const Format* format = nullptr;