From e7bb3fd1192f46c0ef8c8416042d6e86392e95a9 Mon Sep 17 00:00:00 2001 From: Jiawei Shao Date: Thu, 14 Feb 2019 23:51:18 +0000 Subject: [PATCH] Remove redundant RenderPass in Dawn unittests This patch removes all the redundant creations of RenderPass in Dawn unittests. In these tests render passes are actually never used. BUG=dawn:6 Change-Id: I6301a150ea21af1a7ccc3b7ce2dd78351eb7e179 Reviewed-on: https://dawn-review.googlesource.com/c/4720 Reviewed-by: Corentin Wallez Commit-Queue: Jiawei Shao --- src/tests/unittests/validation/InputStateValidationTests.cpp | 4 +--- src/tests/unittests/validation/QueueSubmitValidationTests.cpp | 1 - .../unittests/validation/RenderPipelineValidationTests.cpp | 3 --- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/tests/unittests/validation/InputStateValidationTests.cpp b/src/tests/unittests/validation/InputStateValidationTests.cpp index c4909f152c..07ac93ae83 100644 --- a/src/tests/unittests/validation/InputStateValidationTests.cpp +++ b/src/tests/unittests/validation/InputStateValidationTests.cpp @@ -20,8 +20,6 @@ class InputStateTest : public ValidationTest { protected: void CreatePipeline(bool success, const dawn::InputState& inputState, std::string vertexSource) { - DummyRenderPass renderpassData = CreateDummyRenderPass(); - dawn::ShaderModule vsModule = utils::CreateShaderModule(device, dawn::ShaderStage::Vertex, vertexSource.c_str()); dawn::ShaderModule fsModule = utils::CreateShaderModule(device, dawn::ShaderStage::Fragment, R"( #version 450 @@ -35,7 +33,7 @@ class InputStateTest : public ValidationTest { descriptor.cVertexStage.module = vsModule; descriptor.cFragmentStage.module = fsModule; descriptor.inputState = inputState; - descriptor.cColorAttachments[0]->format = renderpassData.attachmentFormat; + descriptor.cColorAttachments[0]->format = dawn::TextureFormat::R8G8B8A8Unorm; if (!success) { ASSERT_DEVICE_ERROR(device.CreateRenderPipeline(&descriptor)); diff --git a/src/tests/unittests/validation/QueueSubmitValidationTests.cpp b/src/tests/unittests/validation/QueueSubmitValidationTests.cpp index 96e940ec98..88b286d64b 100644 --- a/src/tests/unittests/validation/QueueSubmitValidationTests.cpp +++ b/src/tests/unittests/validation/QueueSubmitValidationTests.cpp @@ -44,7 +44,6 @@ TEST_F(QueueSubmitValidationTest, SubmitWithMappedBuffer) { // Create a command buffer that reads from the mappable buffer. dawn::CommandBuffer commands; { - dawn::RenderPassDescriptor renderpass = CreateSimpleRenderPass(); dawn::CommandBufferBuilder builder = device.CreateCommandBufferBuilder(); builder.CopyBufferToBuffer(buffer, 0, targetBuffer, 0, 4); commands = builder.GetResult(); diff --git a/src/tests/unittests/validation/RenderPipelineValidationTests.cpp b/src/tests/unittests/validation/RenderPipelineValidationTests.cpp index 361847b79c..1bd6f9049a 100644 --- a/src/tests/unittests/validation/RenderPipelineValidationTests.cpp +++ b/src/tests/unittests/validation/RenderPipelineValidationTests.cpp @@ -23,8 +23,6 @@ class RenderPipelineValidationTest : public ValidationTest { void SetUp() override { ValidationTest::SetUp(); - renderpass = CreateSimpleRenderPass(); - vsModule = utils::CreateShaderModule(device, dawn::ShaderStage::Vertex, R"( #version 450 void main() { @@ -40,7 +38,6 @@ class RenderPipelineValidationTest : public ValidationTest { })"); } - dawn::RenderPassDescriptor renderpass; dawn::ShaderModule vsModule; dawn::ShaderModule fsModule; };