From ec24bb2f0ce2eed088d0d1fc9dcd2a087d51f5f9 Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Tue, 28 Feb 2023 14:58:36 +0000 Subject: [PATCH] Convert SPIR-V Writer over to utils::StringStream. This CL updates the spir-v writer to use utils::StringStream. Bug: tint:1686 Change-Id: I0b1367991de9ecb9fe02bdd0d1827aeba633f2fb Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121940 Reviewed-by: Ben Clayton Commit-Queue: Dan Sinclair Kokoro: Kokoro --- src/tint/writer/spirv/builder.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tint/writer/spirv/builder.cc b/src/tint/writer/spirv/builder.cc index ad0d7466f5..40f98d8a30 100644 --- a/src/tint/writer/spirv/builder.cc +++ b/src/tint/writer/spirv/builder.cc @@ -49,6 +49,7 @@ #include "src/tint/utils/compiler_macros.h" #include "src/tint/utils/defer.h" #include "src/tint/utils/map.h" +#include "src/tint/utils/string_stream.h" #include "src/tint/writer/append_vector.h" #include "src/tint/writer/check_supported_extensions.h" @@ -4138,7 +4139,7 @@ SpvImageFormat Builder::convert_texel_format_to_spv(const builtin::TexelFormat f bool Builder::push_function_inst(spv::Op op, const OperandList& operands) { if (functions_.empty()) { - std::ostringstream ss; + utils::StringStream ss; ss << "Internal error: trying to add SPIR-V instruction " << int(op) << " outside a function"; error_ = ss.str();