From 5147cb51e111b5f0d99ba424b2ea951c670f4f06 Mon Sep 17 00:00:00 2001 From: Ryan Harrison Date: Wed, 21 Apr 2021 08:52:30 +0000 Subject: [PATCH] Fix MinBufferSizeDefaultLayoutTests.RenderPassConsidersBothStages This test was passing on SPIRV-Cross due to SPRIV-Cross's overreporting of binding information per entry point. On Tint it was failing, because the resources in the vertex shader were not being referenced, so not being reported. I have corrected the values passed to the utility code that generates the shaders, so that it generates the needed references. I have also slightly tweaked the test, so it will distinguish between failure states better. BUG=tint:716 Change-Id: If88f600a36cba8b580d888e902b8d8102e05bd10 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/48520 Auto-Submit: Ryan Harrison Commit-Queue: Corentin Wallez Reviewed-by: Austin Eng Reviewed-by: Corentin Wallez --- .../MinimumBufferSizeValidationTests.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/tests/unittests/validation/MinimumBufferSizeValidationTests.cpp b/src/tests/unittests/validation/MinimumBufferSizeValidationTests.cpp index bb9a323eb3..7aaf5aabe6 100644 --- a/src/tests/unittests/validation/MinimumBufferSizeValidationTests.cpp +++ b/src/tests/unittests/validation/MinimumBufferSizeValidationTests.cpp @@ -573,15 +573,16 @@ TEST_F(MinBufferSizeDefaultLayoutTests, NonDefaultLayout) { // Minimum size should be the max requirement of both vertex and fragment stages. TEST_F(MinBufferSizeDefaultLayoutTests, RenderPassConsidersBothStages) { - // TODO(https://crbug.com/tint/716): Remove skip once this is resolved. - DAWN_SKIP_TEST_IF(HasToggleEnabled("use_tint_generator")); - std::string vertexShader = CreateVertexShaderWithBindings( - {{0, 0, "a : f32;", "f32", "a", 4, wgpu::BufferBindingType::Uniform}, - {0, 1, "b : vec4;", "vec4", "b", 16, wgpu::BufferBindingType::Uniform}}); + {{0, 0, "a : f32; b : f32;", "f32", "a", 8, wgpu::BufferBindingType::Uniform, + wgpu::ShaderStage::Vertex}, + {0, 1, "c : vec4;", "vec4", "c", 16, wgpu::BufferBindingType::Uniform, + wgpu::ShaderStage::Vertex}}); std::string fragShader = CreateFragmentShaderWithBindings( - {{0, 0, "a : f32; b : f32;", "f32", "a", 8, wgpu::BufferBindingType::Uniform}, - {0, 1, "c : f32; d : f32;", "f32", "c", 8, wgpu::BufferBindingType::Uniform}}); + {{0, 0, "a : f32;", "f32", "a", 4, wgpu::BufferBindingType::Uniform, + wgpu::ShaderStage::Fragment}, + {0, 1, "b : f32; c : f32;", "f32", "b", 8, wgpu::BufferBindingType::Uniform, + wgpu::ShaderStage::Fragment}}); wgpu::BindGroupLayout renderLayout = GetBGLFromRenderShaders(vertexShader, fragShader, 0);