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 <rharrison@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Ryan Harrison 2021-04-21 08:52:30 +00:00 committed by Commit Bot service account
parent 55c43bff00
commit 5147cb51e1
1 changed files with 8 additions and 7 deletions

View File

@ -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<f32>;", "vec4<f32>", "b", 16, wgpu::BufferBindingType::Uniform}});
{{0, 0, "a : f32; b : f32;", "f32", "a", 8, wgpu::BufferBindingType::Uniform,
wgpu::ShaderStage::Vertex},
{0, 1, "c : vec4<f32>;", "vec4<f32>", "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);