From ab00dd0725d6f28d8c6cee1c5dbd7887b836af4f Mon Sep 17 00:00:00 2001 From: Jiawei Shao Date: Tue, 10 Jan 2023 01:09:28 +0000 Subject: [PATCH] Remove ShaderModuleValidationTest.FragmentOutputLocationExceedsMaxColorAttachments This patch removes the test ShaderModuleValidationTest.FragmentOutputLocationExceedsMaxColorAttachments from dawn_unittests because now the emission of the validation errors about the maximum value of fragment output location is delayed from CreateShaderModule() to CreateRenderPipeline(), however this test expects the error will still be reported in CreateShaderModule(). Previously this test can still pass because kMaxColorAttachments is declared as an uint8_t, so it will be added as "\b" (ascii code is 8) in string stream when constructing the shader, then we can still get a shader-creation error because it is not an integer that is inside the bracket of the location() expression. Bug: dawn:986 Change-Id: Iaf03f83b2c27e3d9e986f813b2086726b51a0aeb Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/116554 Reviewed-by: Austin Eng Commit-Queue: Jiawei Shao Reviewed-by: Corentin Wallez Kokoro: Kokoro --- .../validation/ShaderModuleValidationTests.cpp | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/dawn/tests/unittests/validation/ShaderModuleValidationTests.cpp b/src/dawn/tests/unittests/validation/ShaderModuleValidationTests.cpp index 4d788e35f1..d96b910070 100644 --- a/src/dawn/tests/unittests/validation/ShaderModuleValidationTests.cpp +++ b/src/dawn/tests/unittests/validation/ShaderModuleValidationTests.cpp @@ -55,16 +55,6 @@ TEST_F(ShaderModuleValidationTest, CreationSuccess) { utils::CreateShaderModuleFromASM(device, shader); } -// Tests that if the output location exceeds kMaxColorAttachments the fragment shader will fail to -// be compiled. -TEST_F(ShaderModuleValidationTest, FragmentOutputLocationExceedsMaxColorAttachments) { - std::ostringstream stream; - stream << "@fragment fn main() -> @location(" << kMaxColorAttachments << R"() vec4 { - return vec4(0.0, 1.0, 0.0, 1.0); - })"; - ASSERT_DEVICE_ERROR(utils::CreateShaderModule(device, 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) {