Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(157)

Unified Diff: src/core/SkNormalSource.cpp

Issue 2124183004: Fixed error when normal.z = 1 in GPUs with binary16 floats (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Fixed error when normal.z = 1 in GPUs with binary16 floats Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkNormalSource.cpp
diff --git a/src/core/SkNormalSource.cpp b/src/core/SkNormalSource.cpp
index 52bb4adaa70092504a58bc4f17ecd825f6b4988a..03c1a3a80c39e31caea8b412eb0fc1634c41044b 100644
--- a/src/core/SkNormalSource.cpp
+++ b/src/core/SkNormalSource.cpp
@@ -109,7 +109,7 @@ public:
// transforming all the normals here!
// If there's no x & y components, return (0, 0, +/- 1) instead to avoid division by 0
- fragBuilder->codeAppend( "if (abs(normal.z) > 0.9999) {");
+ fragBuilder->codeAppend( "if (abs(normal.z) > 0.999) {");
fragBuilder->codeAppendf(" %s = normalize(vec4(0.0, 0.0, normal.z, 0.0));",
args.fOutputColor);
// Else, Normalizing the transformed X and Y, while keeping constant both Z and the
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698