Validate that ShaderModuleDescriptor has chained descriptor

Bug: chromium:1074575
Change-Id: Ibb124ca8c4771d9b8f2846d3a5f79dca6de8743d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/21360
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-05-08 18:05:19 +00:00
committed by Commit Bot service account
parent 70ffa0c285
commit 818c6b7082
2 changed files with 13 additions and 2 deletions

View File

@@ -108,3 +108,10 @@ TEST_F(ShaderModuleValidationTest, FragmentOutputLocationExceedsMaxColorAttachme
ASSERT_DEVICE_ERROR(utils::CreateShaderModule(device, utils::SingleShaderStage::Fragment,
stream.str().c_str()));
}
// Test that it is invalid to create a shader module with no chained descriptor. (It must be
// WGSL or SPIRV, not empty)
TEST_F(ShaderModuleValidationTest, NoChainedDescriptor) {
wgpu::ShaderModuleDescriptor desc = {};
ASSERT_DEVICE_ERROR(device.CreateShaderModule(&desc));
}