From b01ca1794a81435c215519ef42b5ffd056a54170 Mon Sep 17 00:00:00 2001 From: Jules Blok Date: Sat, 15 Aug 2015 13:46:34 +0200 Subject: Revert "VideoCommon: Clamp integer conversions." This reverts commit 0f2c72f0f844c219e168faa7de8dd515f8723fdc. --- Source/Core/VideoCommon/TextureConversionShader.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Source/Core/VideoCommon/TextureConversionShader.cpp') diff --git a/Source/Core/VideoCommon/TextureConversionShader.cpp b/Source/Core/VideoCommon/TextureConversionShader.cpp index f93d465a16..2d8b7ef9c9 100644 --- a/Source/Core/VideoCommon/TextureConversionShader.cpp +++ b/Source/Core/VideoCommon/TextureConversionShader.cpp @@ -492,7 +492,7 @@ static void WriteZ16Encoder(char*& p,API_TYPE ApiType) WriteSampleColor(p, "r", "depth", 0, ApiType); if (ApiType == API_D3D) WRITE(p, "depth = 1.0f - depth;\n"); - WRITE(p, " depth = clamp(depth * 16777216.0, 0.0, float(0xFFFFFF));\n"); + WRITE(p, " depth *= 16777216.0;\n"); WRITE(p, " expanded.r = floor(depth / (256.0 * 256.0));\n"); WRITE(p, " depth -= expanded.r * 256.0 * 256.0;\n"); WRITE(p, " expanded.g = floor(depth / 256.0);\n"); @@ -503,7 +503,7 @@ static void WriteZ16Encoder(char*& p,API_TYPE ApiType) WriteSampleColor(p, "r", "depth", 1, ApiType); if (ApiType == API_D3D) WRITE(p, "depth = 1.0f - depth;\n"); - WRITE(p, " depth = clamp(depth * 16777216.0, 0.0, float(0xFFFFFF));\n"); + WRITE(p, " depth *= 16777216.0;\n"); WRITE(p, " expanded.r = floor(depth / (256.0 * 256.0));\n"); WRITE(p, " depth -= expanded.r * 256.0 * 256.0;\n"); WRITE(p, " expanded.g = floor(depth / 256.0);\n"); @@ -526,7 +526,7 @@ static void WriteZ16LEncoder(char*& p,API_TYPE ApiType) WriteSampleColor(p, "r", "depth", 0, ApiType); if (ApiType == API_D3D) WRITE(p, "depth = 1.0f - depth;\n"); - WRITE(p, " depth = clamp(depth * 16777216.0, 0.0, float(0xFFFFFF));\n"); + WRITE(p, " depth *= 16777216.0;\n"); WRITE(p, " expanded.r = floor(depth / (256.0 * 256.0));\n"); WRITE(p, " depth -= expanded.r * 256.0 * 256.0;\n"); WRITE(p, " expanded.g = floor(depth / 256.0);\n"); @@ -539,7 +539,7 @@ static void WriteZ16LEncoder(char*& p,API_TYPE ApiType) WriteSampleColor(p, "r", "depth", 1, ApiType); if (ApiType == API_D3D) WRITE(p, "depth = 1.0f - depth;\n"); - WRITE(p, " depth = clamp(depth * 16777216.0, 0.0, float(0xFFFFFF));\n"); + WRITE(p, " depth *= 16777216.0;\n"); WRITE(p, " expanded.r = floor(depth / (256.0 * 256.0));\n"); WRITE(p, " depth -= expanded.r * 256.0 * 256.0;\n"); WRITE(p, " expanded.g = floor(depth / 256.0);\n"); @@ -568,7 +568,7 @@ static void WriteZ24Encoder(char*& p, API_TYPE ApiType) for (int i = 0; i < 2; i++) { - WRITE(p, " depth%i = clamp(depth%i * 16777216.0, 0.0, float(0xFFFFFF));\n", i, i); + WRITE(p, " depth%i *= 16777216.0;\n", i); WRITE(p, " expanded%i.r = floor(depth%i / (256.0 * 256.0));\n", i, i); WRITE(p, " depth%i -= expanded%i.r * 256.0 * 256.0;\n", i, i); -- cgit v1.2.3