Fix unittests that are broken by --enable-toggles=use_tint_generator

Tests fixed by this CL:
  BindGroupLayoutCompatibilityTest.ROStorageInBGLWithRWStorageInShader
  BindGroupLayoutCompatibilityTest.TextureViewDimension
  BindingsValidationTest.PipelineLayoutWithLessBindingsThanPipeline
  GetBindGroupLayoutTests.SameObject
  GetBindGroupLayoutTests.DefaultShaderStageAndDynamicOffsets
  GetBindGroupLayoutTests.ComputePipeline
  GetBindGroupLayoutTests.BindingType
  GetBindGroupLayoutTests.ViewDimension
  GetBindGroupLayoutTests.TextureComponentType
  GetBindGroupLayoutTests.BindingIndices
  GetBindGroupLayoutTests.MinBufferSize
  GetBindGroupLayoutTests.StageAggregation
  GetBindGroupLayoutTests.ConflictingBindingType
  GetBindGroupLayoutTests.ConflictingBindingTextureMultisampling
  GetBindGroupLayoutTests.ConflictingBindingViewDimension
  GetBindGroupLayoutTests.ConflictingBindingTextureComponentType
  GetBindGroupLayoutTests.UnusedIndex
  MinBufferSizePipelineCreationTests.LayoutSizesTooSmall
  MinBufferSizePipelineCreationTests.LayoutSizesTooSmallMultipleGroups
  MinBufferSizeDrawTimeValidationTests.ZeroMinSizeAndTooSmallBinding
  MinBufferSizeDrawTimeValidationTests.UnorderedBindings
  MinBufferSizeDrawTimeValidationTests.MultipleGroups
  MinBufferSizeDefaultLayoutTests.DefaultLayoutVariousWGSLTypes
  MinBufferSizeDefaultLayoutTests.DefaultLayoutVariousBindingTypes
  MinBufferSizeDefaultLayoutTests.MultipleBindGroups
  MinBufferSizeDefaultLayoutTests.NonDefaultLayout
  RenderPipelineValidationTest.TextureComponentTypeCompatibility
  RenderPipelineValidationTest.TextureViewDimensionCompatibility
  StorageTextureValidationTests.BindGroupLayoutEntryTypeMatchesShaderDeclaration
  StorageTextureValidationTests.BindGroupLayoutStorageTextureFormatMatchesShaderDeclaration
  StorageTextureValidationTests.BindGroupLayoutViewDimensionMatchesShaderDeclaration

Also enables GetBindGroupLayoutTests.FromCorrectEntryPoint for
use_tint_generator, since it handles this case, unlike SPIRV-Cross.

These tests remain skipped, but with bugs listed for fixing the underlying issues:
  MinBufferSizeDefaultLayoutTests.RenderPassConsidersBothStages
  ShaderModuleValidationTest.MultisampledArrayTexture
  StorageTextureValidationTests.ReadWriteStorageTexture
  StorageTextureValidationTests.StorageTextureFormatInShaders
  StorageTextureValidationTests.UnsupportedWGSLStorageTextureFormat

BUG=dawn:756

Change-Id: Ib6b0d4144927073d949cb8d1409063a767fd47e9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/47823
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-15 07:18:08 +00:00
committed by Commit Bot service account
parent e87ea2bedc
commit 0a5696079b
6 changed files with 147 additions and 115 deletions

View File

@@ -393,8 +393,6 @@ TEST_F(RenderPipelineValidationTest, AlphaToCoverageAndSampleCount) {
// Tests that the texture component type in shader must match the bind group layout.
TEST_F(RenderPipelineValidationTest, TextureComponentTypeCompatibility) {
DAWN_SKIP_TEST_IF(HasToggleEnabled("use_tint_generator"));
constexpr uint32_t kNumTextureComponentType = 3u;
std::array<const char*, kNumTextureComponentType> kScalarTypes = {{"f32", "i32", "u32"}};
std::array<wgpu::TextureSampleType, kNumTextureComponentType> kTextureComponentTypes = {{
@@ -414,6 +412,7 @@ TEST_F(RenderPipelineValidationTest, TextureComponentTypeCompatibility) {
<< kScalarTypes[i] << R"(>;
[[stage(fragment)]] fn main() {
textureDimensions(myTexture);
})";
descriptor.cFragment.module = utils::CreateShaderModule(device, stream.str().c_str());
@@ -432,8 +431,6 @@ TEST_F(RenderPipelineValidationTest, TextureComponentTypeCompatibility) {
// Tests that the texture view dimension in shader must match the bind group layout.
TEST_F(RenderPipelineValidationTest, TextureViewDimensionCompatibility) {
DAWN_SKIP_TEST_IF(HasToggleEnabled("use_tint_generator"));
constexpr uint32_t kNumTextureViewDimensions = 6u;
std::array<const char*, kNumTextureViewDimensions> kTextureKeywords = {{
"texture_1d",
@@ -463,6 +460,7 @@ TEST_F(RenderPipelineValidationTest, TextureViewDimensionCompatibility) {
[[group(0), binding(0)]] var myTexture : )"
<< kTextureKeywords[i] << R"(<f32>;
[[stage(fragment)]] fn main() {
textureDimensions(myTexture);
})";
descriptor.cFragment.module = utils::CreateShaderModule(device, stream.str().c_str());