From 5fdda135d2b3a71e674c4632838c57a83b5db667 Mon Sep 17 00:00:00 2001 From: Yuriy O'Donnell Date: Thu, 16 Oct 2014 20:39:58 +0200 Subject: [PATCH] Workaround for MSVC not optimizing away Write() in GeneratePixelShader ShaderConstantProfile and ShaderUid now have an empty implementation of Write() that uses variadic templates instead of varargs. MSVC is now able to inline and optimize away this when necessary. --- Source/Core/VideoCommon/ShaderGenCommon.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Core/VideoCommon/ShaderGenCommon.h b/Source/Core/VideoCommon/ShaderGenCommon.h index 4f97865d54..527beeb725 100644 --- a/Source/Core/VideoCommon/ShaderGenCommon.h +++ b/Source/Core/VideoCommon/ShaderGenCommon.h @@ -30,7 +30,8 @@ public: * Can be used like printf. * @note In the ShaderCode implementation, this does indeed write the parameter string to an internal buffer. However, you're free to do whatever you like with the parameter. */ - void Write(const char* fmt, ...) {} + template + void Write(const char*, Args...) {} /* * Returns a read pointer to the internal buffer.