Fix linter warnings, stdout test spew

Change-Id: I2fed4cf2a052686e2121066588686f05907a169f
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/33200
Commit-Queue: Ben Clayton <bclayton@google.com>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Auto-Submit: Ben Clayton <bclayton@google.com>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
This commit is contained in:
Ben Clayton 2020-11-18 14:31:00 +00:00 committed by Commit Bot service account
parent 5eae9bfaf5
commit 46d9c7745e
2 changed files with 10 additions and 15 deletions

View File

@ -851,11 +851,6 @@ TEST_P(SpvParserTest_RegisterHandleUsage_SampledImage, FunctionParam) {
Usage su = p->GetHandleUsage(10); Usage su = p->GetHandleUsage(10);
Usage iu = p->GetHandleUsage(20); 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(su.to_str(), Eq(GetParam().expected_sampler_usage));
EXPECT_THAT(iu.to_str(), Eq(GetParam().expected_image_usage)); EXPECT_THAT(iu.to_str(), Eq(GetParam().expected_image_usage));
} }
@ -923,9 +918,7 @@ INSTANTIATE_TEST_SUITE_P(
// OpImageQueryLod // OpImageQueryLod
SampledImageCase{ SampledImageCase{
"%result = OpImageQueryLod %v2float %sampled_image %coords", "%result = OpImageQueryLod %v2float %sampled_image %coords",
"Usage(Sampler( ))", "Usage(Texture( is_sampled ))"} "Usage(Sampler( ))", "Usage(Texture( is_sampled ))"}));
));
// Test RegisterHandleUsage, raw image cases. // Test RegisterHandleUsage, raw image cases.
// For these we test the use of an image value directly, and not combined // 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", RawImageCase{"f_texture_2d_ms",
"%result = OpImageQuerySamples " "%result = OpImageQuerySamples "
"%uint %im", "%uint %im",
"Usage(Texture( is_sampled ms ))"} "Usage(Texture( is_sampled ms ))"}));
));
} // namespace } // namespace
} // namespace spirv } // namespace spirv

View File

@ -39,8 +39,12 @@ namespace spirv {
/// AddSampledTexture and AddDepthTexture usages /// AddSampledTexture and AddDepthTexture usages
class Usage { class Usage {
public: public:
/// Constructor
Usage(); Usage();
/// Copy constructor
/// @param other the Usage to clone
Usage(const Usage& other); Usage(const Usage& other);
/// Destructor
~Usage(); ~Usage();
/// @returns true if this usage is internally consistent /// @returns true if this usage is internally consistent
@ -94,16 +98,16 @@ class Usage {
void AddTexture(); void AddTexture();
/// Records usage as a read-only storage texture. /// Records usage as a read-only storage texture.
void AddStorageReadTexture(); void AddStorageReadTexture();
// Records usage as a write-only storage texture. /// Records usage as a write-only storage texture.
void AddStorageWriteTexture(); void AddStorageWriteTexture();
// Records usage as a sampled texture. /// Records usage as a sampled texture.
void AddSampledTexture(); void AddSampledTexture();
// Records usage as a multisampled texture. /// Records usage as a multisampled texture.
void AddMultisampledTexture(); void AddMultisampledTexture();
/// Records usage as a depth texture. /// Records usage as a depth texture.
void AddDepthTexture(); void AddDepthTexture();
/// Returns this usage object as a string. /// @returns this usage object as a string.
std::string to_str() const; std::string to_str() const;
private: private: