From 5fdda135d2b3a71e674c4632838c57a83b5db667 Mon Sep 17 00:00:00 2001 From: Yuriy O'Donnell Date: Thu, 16 Oct 2014 20:39:58 +0200 Subject: [PATCH 1/2] 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. From d23da7dbef76a840f34c12579632131c9a62f7e3 Mon Sep 17 00:00:00 2001 From: Yuriy O'Donnell Date: Fri, 17 Oct 2014 21:50:41 +0200 Subject: [PATCH 2/2] Added __forceinline to AlphaTest::TestResult() to make MSVC inline it --- Source/Core/VideoCommon/BPMemory.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/VideoCommon/BPMemory.h b/Source/Core/VideoCommon/BPMemory.h index 346af479f2..6e5d49e94e 100644 --- a/Source/Core/VideoCommon/BPMemory.h +++ b/Source/Core/VideoCommon/BPMemory.h @@ -921,7 +921,7 @@ union AlphaTest PASS = 2, }; - inline TEST_RESULT TestResult() const + __forceinline TEST_RESULT TestResult() const { switch (logic) {