From 74ec15010f8a3cc14854ceba15b7fe0b78f3a0b1 Mon Sep 17 00:00:00 2001 From: Yunchao He Date: Thu, 3 Jan 2019 10:33:55 +0000 Subject: [PATCH] Assigning nullptr to descriptor's nextInChain in C++ is unneeded It has already been initialized to nullptr by C++ autogen code. BUG=dawn:82 Change-Id: I2c1cad003a7a12227cb3d17a90e12c16739ee9a0 Reviewed-on: https://dawn-review.googlesource.com/c/3600 Commit-Queue: Yunchao He Commit-Queue: Corentin Wallez Reviewed-by: Corentin Wallez --- src/tests/end2end/BlendStateTests.cpp | 5 ----- src/tests/end2end/TextureViewTests.cpp | 1 - src/tests/unittests/validation/BindGroupValidationTests.cpp | 3 --- src/tests/unittests/validation/TextureValidationTests.cpp | 3 +-- src/utils/ComboRenderPipelineDescriptor.cpp | 1 - 5 files changed, 1 insertion(+), 12 deletions(-) diff --git a/src/tests/end2end/BlendStateTests.cpp b/src/tests/end2end/BlendStateTests.cpp index d1722ff414..c2ff4ff2eb 100644 --- a/src/tests/end2end/BlendStateTests.cpp +++ b/src/tests/end2end/BlendStateTests.cpp @@ -139,7 +139,6 @@ class BlendStateTest : public DawnTest { descriptor.blendEnabled = true; descriptor.alphaBlend = blend; descriptor.colorBlend = blend; - descriptor.nextInChain = nullptr; descriptor.colorWriteMask = dawn::ColorWriteMask::All; SetupSingleSourcePipelines(descriptor); @@ -165,7 +164,6 @@ class BlendStateTest : public DawnTest { descriptor.blendEnabled = true; descriptor.colorBlend = colorBlend; descriptor.alphaBlend = alphaBlend; - descriptor.nextInChain = nullptr; descriptor.colorWriteMask = dawn::ColorWriteMask::All; SetupSingleSourcePipelines(descriptor); @@ -283,7 +281,6 @@ TEST_P(BlendStateTest, Basic) { blend.srcFactor = dawn::BlendFactor::One; blend.dstFactor = dawn::BlendFactor::Zero; dawn::BlendStateDescriptor descriptor; - descriptor.nextInChain = nullptr; descriptor.blendEnabled = false; descriptor.alphaBlend = blend; descriptor.colorBlend = blend; @@ -640,7 +637,6 @@ TEST_P(BlendStateTest, ColorWriteMask) { blend.dstFactor = dawn::BlendFactor::One; dawn::BlendStateDescriptor descriptor; - descriptor.nextInChain = nullptr; descriptor.blendEnabled = true; descriptor.colorBlend = blend; descriptor.alphaBlend = blend; @@ -688,7 +684,6 @@ TEST_P(BlendStateTest, ColorWriteMaskBlendingDisabled) { blend.srcFactor = dawn::BlendFactor::One; blend.dstFactor = dawn::BlendFactor::Zero; dawn::BlendStateDescriptor descriptor; - descriptor.nextInChain = nullptr; descriptor.alphaBlend = blend; descriptor.colorBlend = blend; diff --git a/src/tests/end2end/TextureViewTests.cpp b/src/tests/end2end/TextureViewTests.cpp index 470ed9f6ec..e005132501 100644 --- a/src/tests/end2end/TextureViewTests.cpp +++ b/src/tests/end2end/TextureViewTests.cpp @@ -116,7 +116,6 @@ protected: mTexture = Create2DTexture( device, textureWidthLevel0, textureHeightLevel0, layerCount, levelCount, kUsage); - mDefaultTextureViewDescriptor.nextInChain = nullptr; mDefaultTextureViewDescriptor.dimension = dawn::TextureViewDimension::e2DArray; mDefaultTextureViewDescriptor.format = kDefaultFormat; mDefaultTextureViewDescriptor.baseMipLevel = 0; diff --git a/src/tests/unittests/validation/BindGroupValidationTests.cpp b/src/tests/unittests/validation/BindGroupValidationTests.cpp index 5718d994b2..c76c46d339 100644 --- a/src/tests/unittests/validation/BindGroupValidationTests.cpp +++ b/src/tests/unittests/validation/BindGroupValidationTests.cpp @@ -141,7 +141,6 @@ TEST_F(BindGroupValidationTest, SamplerBindingType) { binding.size = 0; dawn::BindGroupDescriptor descriptor; - descriptor.nextInChain = nullptr; descriptor.layout = layout; descriptor.numBindings = 1; descriptor.bindings = &binding; @@ -179,7 +178,6 @@ TEST_F(BindGroupValidationTest, TextureBindingType) { binding.size = 0; dawn::BindGroupDescriptor descriptor; - descriptor.nextInChain = nullptr; descriptor.layout = layout; descriptor.numBindings = 1; descriptor.bindings = &binding; @@ -217,7 +215,6 @@ TEST_F(BindGroupValidationTest, BufferBindingType) { binding.size = 0; dawn::BindGroupDescriptor descriptor; - descriptor.nextInChain = nullptr; descriptor.layout = layout; descriptor.numBindings = 1; descriptor.bindings = &binding; diff --git a/src/tests/unittests/validation/TextureValidationTests.cpp b/src/tests/unittests/validation/TextureValidationTests.cpp index ae5994b0b9..ab5fd36bfb 100644 --- a/src/tests/unittests/validation/TextureValidationTests.cpp +++ b/src/tests/unittests/validation/TextureValidationTests.cpp @@ -32,7 +32,6 @@ constexpr dawn::TextureFormat kDefaultTextureFormat = dawn::TextureFormat::R8G8B dawn::TextureDescriptor CreateDefaultTextureDescriptor() { dawn::TextureDescriptor descriptor; - descriptor.nextInChain = nullptr; descriptor.size.width = kWidth; descriptor.size.height = kHeight; descriptor.size.depth = 1; @@ -65,4 +64,4 @@ TEST_F(TextureValidationTest, SampleCount) { ASSERT_DEVICE_ERROR(device.CreateTexture(&descriptor)); } } -} \ No newline at end of file +} // namespace diff --git a/src/utils/ComboRenderPipelineDescriptor.cpp b/src/utils/ComboRenderPipelineDescriptor.cpp index ac799b35ec..9e9ff97b4a 100644 --- a/src/utils/ComboRenderPipelineDescriptor.cpp +++ b/src/utils/ComboRenderPipelineDescriptor.cpp @@ -62,7 +62,6 @@ namespace utils { blend.srcFactor = dawn::BlendFactor::One; blend.dstFactor = dawn::BlendFactor::Zero; dawn::BlendStateDescriptor blendStateDescriptor; - blendStateDescriptor.nextInChain = nullptr; blendStateDescriptor.blendEnabled = false; blendStateDescriptor.alphaBlend = blend; blendStateDescriptor.colorBlend = blend;