From 46d9c7745efafff1afe1f0d2f4d9a3c760b1da85 Mon Sep 17 00:00:00 2001 From: Ben Clayton Date: Wed, 18 Nov 2020 14:31:00 +0000 Subject: [PATCH] Fix linter warnings, stdout test spew Change-Id: I2fed4cf2a052686e2121066588686f05907a169f Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/33200 Commit-Queue: Ben Clayton Commit-Queue: dan sinclair Auto-Submit: Ben Clayton Reviewed-by: dan sinclair --- src/reader/spirv/parser_impl_handle_test.cc | 13 ++----------- src/reader/spirv/usage.h | 12 ++++++++---- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/src/reader/spirv/parser_impl_handle_test.cc b/src/reader/spirv/parser_impl_handle_test.cc index 6708c67558..8026e766ad 100644 --- a/src/reader/spirv/parser_impl_handle_test.cc +++ b/src/reader/spirv/parser_impl_handle_test.cc @@ -851,11 +851,6 @@ TEST_P(SpvParserTest_RegisterHandleUsage_SampledImage, FunctionParam) { Usage su = p->GetHandleUsage(10); Usage iu = p->GetHandleUsage(20); - std::cout << p->GetHandleUsage(10) << std::endl; - std::cout << p->GetHandleUsage(20) << std::endl; - std::cout << p->GetHandleUsage(110) << std::endl; - std::cout << p->GetHandleUsage(120) << std::endl; - EXPECT_THAT(su.to_str(), Eq(GetParam().expected_sampler_usage)); EXPECT_THAT(iu.to_str(), Eq(GetParam().expected_image_usage)); } @@ -923,9 +918,7 @@ INSTANTIATE_TEST_SUITE_P( // OpImageQueryLod SampledImageCase{ "%result = OpImageQueryLod %v2float %sampled_image %coords", - "Usage(Sampler( ))", "Usage(Texture( is_sampled ))"} - - )); + "Usage(Sampler( ))", "Usage(Texture( is_sampled ))"})); // Test RegisterHandleUsage, raw image cases. // For these we test the use of an image value directly, and not combined @@ -1052,9 +1045,7 @@ INSTANTIATE_TEST_SUITE_P( RawImageCase{"f_texture_2d_ms", "%result = OpImageQuerySamples " "%uint %im", - "Usage(Texture( is_sampled ms ))"} - - )); + "Usage(Texture( is_sampled ms ))"})); } // namespace } // namespace spirv diff --git a/src/reader/spirv/usage.h b/src/reader/spirv/usage.h index 2336f88c1f..42861fc7f5 100644 --- a/src/reader/spirv/usage.h +++ b/src/reader/spirv/usage.h @@ -39,8 +39,12 @@ namespace spirv { /// AddSampledTexture and AddDepthTexture usages class Usage { public: + /// Constructor Usage(); + /// Copy constructor + /// @param other the Usage to clone Usage(const Usage& other); + /// Destructor ~Usage(); /// @returns true if this usage is internally consistent @@ -94,16 +98,16 @@ class Usage { void AddTexture(); /// Records usage as a read-only storage texture. void AddStorageReadTexture(); - // Records usage as a write-only storage texture. + /// Records usage as a write-only storage texture. void AddStorageWriteTexture(); - // Records usage as a sampled texture. + /// Records usage as a sampled texture. void AddSampledTexture(); - // Records usage as a multisampled texture. + /// Records usage as a multisampled texture. void AddMultisampledTexture(); /// Records usage as a depth texture. void AddDepthTexture(); - /// Returns this usage object as a string. + /// @returns this usage object as a string. std::string to_str() const; private: