diff --git a/Source/Core/VideoCommon/ShaderGenCommon.h b/Source/Core/VideoCommon/ShaderGenCommon.h index 12fa76fb72..889a446df8 100644 --- a/Source/Core/VideoCommon/ShaderGenCommon.h +++ b/Source/Core/VideoCommon/ShaderGenCommon.h @@ -6,11 +6,14 @@ #include #include +#include #include #include #include #include +#include + #include "Common/CommonTypes.h" #include "Common/StringUtil.h" #include "VideoCommon/VideoCommon.h" @@ -101,6 +104,8 @@ class ShaderCode : public ShaderGeneratorInterface public: ShaderCode() { m_buffer.reserve(16384); } const std::string& GetBuffer() const { return m_buffer; } + + // Deprecated: Writes format strings using traditional printf format strings. void Write(const char* fmt, ...) #ifdef __GNUC__ __attribute__((format(printf, 2, 3))) @@ -112,6 +117,13 @@ public: va_end(arglist); } + // Writes format strings using fmtlib format strings. + template + void WriteFmt(std::string_view format, Args&&... args) + { + fmt::format_to(std::back_inserter(m_buffer), format, std::forward(args)...); + } + protected: std::string m_buffer; };