summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/TextureConversionShader.cpp
diff options
context:
space:
mode:
authorJules Blok <jules.blok@gmail.com>2015-05-07 23:50:14 +0200
committerJules Blok <jules.blok@gmail.com>2015-05-08 14:32:24 +0200
commitd04af15ad442d410ebc9d2ba348fea062eb89d92 (patch)
treef5b357483768e6daf7e920cad9a077d5a30c52fb /Source/Core/VideoCommon/TextureConversionShader.cpp
parent5dbb43ae1d8a7cd1550ee55ad6e5afacbabad483 (diff)
TextureConversionShader: Use floating point values in clamp().
Diffstat (limited to 'Source/Core/VideoCommon/TextureConversionShader.cpp')
-rw-r--r--Source/Core/VideoCommon/TextureConversionShader.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/Source/Core/VideoCommon/TextureConversionShader.cpp b/Source/Core/VideoCommon/TextureConversionShader.cpp
index 844710c3ee..9d8c4eab5c 100644
--- a/Source/Core/VideoCommon/TextureConversionShader.cpp
+++ b/Source/Core/VideoCommon/TextureConversionShader.cpp
@@ -487,7 +487,7 @@ static void WriteZ16Encoder(char*& p,API_TYPE ApiType)
WriteSampleColor(p, "r", "depth", 0, ApiType);
- WRITE(p, " depth = clamp(depth * 16777216.0, 0, 0xFFFFFF);\n");
+ WRITE(p, " depth = clamp(depth * 16777216.0, 0.0, float(0xFFFFFF));\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");
@@ -497,7 +497,7 @@ static void WriteZ16Encoder(char*& p,API_TYPE ApiType)
WriteSampleColor(p, "r", "depth", 1, ApiType);
- WRITE(p, " depth = clamp(depth * 16777216.0, 0, 0xFFFFFF);\n");
+ WRITE(p, " depth = clamp(depth * 16777216.0, 0.0, float(0xFFFFFF));\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");
@@ -519,7 +519,7 @@ static void WriteZ16LEncoder(char*& p,API_TYPE ApiType)
WriteSampleColor(p, "r", "depth", 0, ApiType);
- WRITE(p, " depth = clamp(depth * 16777216.0, 0, 0xFFFFFF);\n");
+ WRITE(p, " depth = clamp(depth * 16777216.0, 0.0, float(0xFFFFFF));\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");
@@ -531,7 +531,7 @@ static void WriteZ16LEncoder(char*& p,API_TYPE ApiType)
WriteSampleColor(p, "r", "depth", 1, ApiType);
- WRITE(p, " depth = clamp(depth * 16777216.0, 0, 0xFFFFFF);\n");
+ WRITE(p, " depth = clamp(depth * 16777216.0, 0.0, float(0xFFFFFF));\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");
@@ -558,7 +558,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, 0xFFFFFF);\n", i, i);
+ WRITE(p, " depth%i = clamp(depth%i * 16777216.0, 0.0, float(0xFFFFFF));\n", i, 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);