mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-20 18:29:23 +00:00
Generic template and forward in stringstream.
This CL updates the templates in the StringStream to match more types. All of the internal `operator<<` methods have been converted over to StringStream. The precision was increased in order to better match the precision needed to read back as a double. Bug: tint:1686 Change-Id: Iaa15cf247f174967dd1014647ba5a74804997c22 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122080 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Ben Clayton <bclayton@google.com> Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
This commit is contained in:
committed by
Dawn LUCI CQ
parent
03de0e83ae
commit
6cc183c85a
@@ -16,7 +16,7 @@
|
||||
|
||||
namespace tint::type {
|
||||
|
||||
std::ostream& operator<<(std::ostream& out, SamplerKind kind) {
|
||||
utils::StringStream& operator<<(utils::StringStream& out, SamplerKind kind) {
|
||||
switch (kind) {
|
||||
case SamplerKind::kSampler:
|
||||
out << "sampler";
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#ifndef SRC_TINT_TYPE_SAMPLER_KIND_H_
|
||||
#define SRC_TINT_TYPE_SAMPLER_KIND_H_
|
||||
|
||||
#include <ostream>
|
||||
#include "src/tint/utils/string_stream.h"
|
||||
|
||||
namespace tint::type {
|
||||
|
||||
@@ -27,10 +27,10 @@ enum class SamplerKind {
|
||||
kComparisonSampler
|
||||
};
|
||||
|
||||
/// @param out the std::ostream to write to
|
||||
/// @param out the stream to write to
|
||||
/// @param kind the SamplerKind
|
||||
/// @return the std::ostream so calls can be chained
|
||||
std::ostream& operator<<(std::ostream& out, SamplerKind kind);
|
||||
/// @return the stream so calls can be chained
|
||||
utils::StringStream& operator<<(utils::StringStream& out, SamplerKind kind);
|
||||
|
||||
} // namespace tint::type
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
namespace tint::type {
|
||||
|
||||
std::ostream& operator<<(std::ostream& out, type::TextureDimension dim) {
|
||||
utils::StringStream& operator<<(utils::StringStream& out, type::TextureDimension dim) {
|
||||
switch (dim) {
|
||||
case type::TextureDimension::kNone:
|
||||
out << "None";
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#ifndef SRC_TINT_TYPE_TEXTURE_DIMENSION_H_
|
||||
#define SRC_TINT_TYPE_TEXTURE_DIMENSION_H_
|
||||
|
||||
#include <ostream>
|
||||
#include "src/tint/utils/string_stream.h"
|
||||
|
||||
namespace tint::type {
|
||||
|
||||
@@ -37,10 +37,10 @@ enum class TextureDimension {
|
||||
kCubeArray,
|
||||
};
|
||||
|
||||
/// @param out the std::ostream to write to
|
||||
/// @param out the stream to write to
|
||||
/// @param dim the type::TextureDimension
|
||||
/// @return the std::ostream so calls can be chained
|
||||
std::ostream& operator<<(std::ostream& out, type::TextureDimension dim);
|
||||
/// @return the stream so calls can be chained
|
||||
utils::StringStream& operator<<(utils::StringStream& out, type::TextureDimension dim);
|
||||
|
||||
} // namespace tint::type
|
||||
|
||||
|
||||
Reference in New Issue
Block a user