[gtk+] vulkan: Fix border shader to premultiply color
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] vulkan: Fix border shader to premultiply color
- Date: Sat, 2 Dec 2017 15:22:21 +0000 (UTC)
commit abc8d61730a657dc8640fc8d40c55d8859e74ae6
Author: Benjamin Otte <otte redhat com>
Date: Fri Dec 1 14:32:38 2017 +0100
vulkan: Fix border shader to premultiply color
The inColor wasn't premultiplied, so the resulting colors were wrong
with translucent borders.
gsk/resources/vulkan/border-clip-rounded.frag.spv | Bin 10212 -> 10456 bytes
gsk/resources/vulkan/border-clip.frag.spv | Bin 9560 -> 9804 bytes
gsk/resources/vulkan/border.frag | 2 +-
gsk/resources/vulkan/border.frag.spv | Bin 9560 -> 9804 bytes
4 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gsk/resources/vulkan/border-clip-rounded.frag.spv
b/gsk/resources/vulkan/border-clip-rounded.frag.spv
index 690c02b..f60047f 100644
Binary files a/gsk/resources/vulkan/border-clip-rounded.frag.spv and
b/gsk/resources/vulkan/border-clip-rounded.frag.spv differ
diff --git a/gsk/resources/vulkan/border-clip.frag.spv b/gsk/resources/vulkan/border-clip.frag.spv
index 1a3fda7..2fc1ca1 100644
Binary files a/gsk/resources/vulkan/border-clip.frag.spv and b/gsk/resources/vulkan/border-clip.frag.spv
differ
diff --git a/gsk/resources/vulkan/border.frag b/gsk/resources/vulkan/border.frag
index 988b1f6..193ccfa 100644
--- a/gsk/resources/vulkan/border.frag
+++ b/gsk/resources/vulkan/border.frag
@@ -20,5 +20,5 @@ void main()
float alpha = clamp (rounded_rect_coverage (routside, inPos) -
rounded_rect_coverage (rinside, inPos),
0.0, 1.0);
- color = clip (inPos, inColor * alpha);
+ color = clip (inPos, vec4(inColor.rgb * inColor.a, inColor.a) * alpha);
}
diff --git a/gsk/resources/vulkan/border.frag.spv b/gsk/resources/vulkan/border.frag.spv
index 1a3fda7..2fc1ca1 100644
Binary files a/gsk/resources/vulkan/border.frag.spv and b/gsk/resources/vulkan/border.frag.spv differ
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]