[gtk+] vulkan: Fix mask shader to premultiply color



commit 9048d40bc233c1dd110233553e030c2223103ffb
Author: Benjamin Otte <otte redhat com>
Date:   Fri Dec 1 14:44:09 2017 +0100

    vulkan: Fix mask shader to premultiply color
    
    The inColor wasn't premultiplied, so the resulting colors were wrong
    with translucent borders.

 gsk/resources/vulkan/mask-clip-rounded.frag.spv |  Bin 8508 -> 8636 bytes
 gsk/resources/vulkan/mask-clip.frag.spv         |  Bin 1600 -> 1728 bytes
 gsk/resources/vulkan/mask.frag                  |    2 +-
 gsk/resources/vulkan/mask.frag.spv              |  Bin 1600 -> 1728 bytes
 4 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gsk/resources/vulkan/mask-clip-rounded.frag.spv b/gsk/resources/vulkan/mask-clip-rounded.frag.spv
index 0791cb5..0e5fd97 100644
Binary files a/gsk/resources/vulkan/mask-clip-rounded.frag.spv and 
b/gsk/resources/vulkan/mask-clip-rounded.frag.spv differ
diff --git a/gsk/resources/vulkan/mask-clip.frag.spv b/gsk/resources/vulkan/mask-clip.frag.spv
index 85fc5f0..5e321e2 100644
Binary files a/gsk/resources/vulkan/mask-clip.frag.spv and b/gsk/resources/vulkan/mask-clip.frag.spv differ
diff --git a/gsk/resources/vulkan/mask.frag b/gsk/resources/vulkan/mask.frag
index f713371..81f6833 100644
--- a/gsk/resources/vulkan/mask.frag
+++ b/gsk/resources/vulkan/mask.frag
@@ -12,5 +12,5 @@ layout(location = 0) out vec4 color;
 
 void main()
 {
-  color = clip (inPos, vec4(inColor.rgb, texture(inTexture, inTexCoord).a));
+  color = clip (inPos, vec4(inColor.rgb * inColor.a, inColor.a) * texture(inTexture, inTexCoord).a);
 }
diff --git a/gsk/resources/vulkan/mask.frag.spv b/gsk/resources/vulkan/mask.frag.spv
index 85fc5f0..5e321e2 100644
Binary files a/gsk/resources/vulkan/mask.frag.spv and b/gsk/resources/vulkan/mask.frag.spv differ


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]