summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/TextureConversionShader.cpp
diff options
context:
space:
mode:
authorMarkus Wick <degasus@users.noreply.github.com>2017-12-06 09:28:52 +0100
committerGitHub <noreply@github.com>2017-12-06 09:28:52 +0100
commitcde02b5b5f5d300d9a5cb04233aee5e45b42bc93 (patch)
tree49a457a6d93769a0efe384bcd17befec29966376 /Source/Core/VideoCommon/TextureConversionShader.cpp
parent08da19fc87fc69d241a2d61e437ec0704d6e8b87 (diff)
parentd0601c0a8372780ae3412d25bf81561d23e89ac1 (diff)
Merge pull request #6239 from stenzek/d3d-videocommon-efbtotex
D3D: Use VideoCommon EFB-to-Texture Shaders
Diffstat (limited to 'Source/Core/VideoCommon/TextureConversionShader.cpp')
-rw-r--r--Source/Core/VideoCommon/TextureConversionShader.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/Core/VideoCommon/TextureConversionShader.cpp b/Source/Core/VideoCommon/TextureConversionShader.cpp
index 044e3a4868..9535ccc88b 100644
--- a/Source/Core/VideoCommon/TextureConversionShader.cpp
+++ b/Source/Core/VideoCommon/TextureConversionShader.cpp
@@ -72,6 +72,12 @@ static void WriteSwizzler(char*& p, EFBCopyFormat format, APIType ApiType)
WRITE(p, "uniform float y_scale;\n");
}
+ // D3D does not have roundEven(), only round(), which is specified "to the nearest integer".
+ // This differs from the roundEven() behavior, but to get consistency across drivers in OpenGL
+ // we need to use roundEven().
+ if (ApiType == APIType::D3D)
+ WRITE(p, "#define roundEven(x) round(x)\n");
+
// Alpha channel in the copy is set to 1 the EFB format does not have an alpha channel.
WRITE(p, "float4 RGBA8ToRGB8(float4 src)\n");
WRITE(p, "{\n");