// Copyright 2019 The Dawn & Tint Authors // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // 1. Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // // 2. Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // // 3. Neither the name of the copyright holder nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <vector> #include "dawn/tests/unittests/validation/ValidationTest.h" #include "dawn/utils/ComboRenderPipelineDescriptor.h" #include "dawn/utils/WGPUHelpers.h" namespace dawn { namespace { Not; // These tests works assuming Dawn Native's object deduplication. Comparing the pointer is // exploiting an implementation detail of Dawn Native. class ObjectCachingTest : public ValidationTest { … }; // Test that BindGroupLayouts are correctly deduplicated. TEST_F(ObjectCachingTest, BindGroupLayoutDeduplication) { … } // Test that two similar bind group layouts won't refer to the same one if they differ by dynamic. TEST_F(ObjectCachingTest, BindGroupLayoutDynamic) { … } // Test that two similar bind group layouts won't refer to the same one if they differ by min size. TEST_F(ObjectCachingTest, BindGroupLayoutMinBufferSize) { … } // Test that two similar bind group layouts won't refer to the same one if they differ by // textureComponentType TEST_F(ObjectCachingTest, BindGroupLayoutTextureComponentType) { … } // Test that two similar bind group layouts won't refer to the same one if they differ by // viewDimension TEST_F(ObjectCachingTest, BindGroupLayoutViewDimension) { … } // Test that BindGroupLayouts with a static sampler entry are correctly // deduplicated. TEST_F(ObjectCachingTest, BindGroupLayoutStaticSamplerDeduplication) { … } // Test that BindGroupLayouts with a static sampler entry keep a reference // to the static sampler, such that if a sampler is created from the same // params the same object will be returned. TEST_F(ObjectCachingTest, BindGroupLayoutKeepsRefToStaticSampler) { … } // Test that PipelineLayouts are correctly deduplicated. TEST_F(ObjectCachingTest, PipelineLayoutDeduplication) { … } // Test that ShaderModules are correctly deduplicated. TEST_F(ObjectCachingTest, ShaderModuleDeduplication) { … } // Test that ComputePipeline are correctly deduplicated wrt. their ShaderModule TEST_F(ObjectCachingTest, ComputePipelineDeduplicationOnShaderModule) { … } // Test that ComputePipeline are correctly deduplicated wrt. their constants override values TEST_F(ObjectCachingTest, ComputePipelineDeduplicationOnOverrides) { … } // Test that ComputePipeline are correctly deduplicated wrt. their layout TEST_F(ObjectCachingTest, ComputePipelineDeduplicationOnLayout) { … } // Test that RenderPipelines are correctly deduplicated wrt. their layout TEST_F(ObjectCachingTest, RenderPipelineDeduplicationOnLayout) { … } // Test that RenderPipelines are correctly deduplicated wrt. their vertex module TEST_F(ObjectCachingTest, RenderPipelineDeduplicationOnVertexModule) { … } // Test that RenderPipelines are correctly deduplicated wrt. their fragment module TEST_F(ObjectCachingTest, RenderPipelineDeduplicationOnFragmentModule) { … } // Test that Renderpipelines are correctly deduplicated wrt. their constants override values TEST_F(ObjectCachingTest, RenderPipelineDeduplicationOnOverrides) { … } // Test that Samplers are correctly deduplicated. TEST_F(ObjectCachingTest, SamplerDeduplication) { … } // Test that YCbCr samplers are correctly deduplicated. TEST_F(ObjectCachingTest, YCbCrSamplerDeduplication) { … } } // anonymous namespace } // namespace dawn