[gtk+/wip/otte/shader: 179/269] xxx: Change the clip shader do not use #f
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/otte/shader: 179/269] xxx: Change the clip shader do not use #f
- Date: Tue, 24 Oct 2017 06:05:39 +0000 (UTC)
commit dbb511442bcada7660e2dc523afe7a3d76b472f2
Author: Benjamin Otte <otte redhat com>
Date: Mon Oct 2 16:59:32 2017 +0200
xxx: Change the clip shader do not use #f
Use #ifdef instead.
gsk/resources/vulkan/clip.frag.glsl | 10 ++++++++--
gsk/resources/vulkan/clip.vert.glsl | 10 ++++++++--
2 files changed, 16 insertions(+), 4 deletions(-)
---
diff --git a/gsk/resources/vulkan/clip.frag.glsl b/gsk/resources/vulkan/clip.frag.glsl
index 472dc6f..1717e99 100644
--- a/gsk/resources/vulkan/clip.frag.glsl
+++ b/gsk/resources/vulkan/clip.frag.glsl
@@ -11,13 +11,17 @@ vec4 clip(vec2 pos, vec4 color)
return color * rounded_rect_coverage (r, pos);
}
-#elif defined(CLIP_RECT)
+#else
+#ifdef CLIP_RECT
+//#elif defined(CLIP_RECT)
vec4 clip(vec2 pos, vec4 color)
{
/* clipped in vertex shader already */
return color;
}
-#elif defined(CLIP_NONE)
+#else
+#ifdef CLIP_NONE
+//#elif defined(CLIP_NONE)
vec4 clip(vec2 pos, vec4 color)
{
return color;
@@ -25,5 +29,7 @@ vec4 clip(vec2 pos, vec4 color)
#else
#error "No clipping define given. Need CLIP_NONE, CLIP_RECT or CLIP_ROUNDED_RECT"
#endif
+#endif
+#endif
#endif
diff --git a/gsk/resources/vulkan/clip.vert.glsl b/gsk/resources/vulkan/clip.vert.glsl
index 0dce1a0..629b3c5 100644
--- a/gsk/resources/vulkan/clip.vert.glsl
+++ b/gsk/resources/vulkan/clip.vert.glsl
@@ -19,12 +19,16 @@ vec4 clip(vec4 rect)
/* rounded corner clipping is done in fragment shader */
return intersect(rect, push.clip_bounds);
}
-#elif defined(CLIP_RECT)
+#else
+#ifdef CLIP_RECT
+//#elif defined(CLIP_RECT)
vec4 clip(vec4 rect)
{
return intersect(rect, push.clip_bounds);
}
-#elif defined(CLIP_NONE)
+#else
+#ifdef CLIP_NONE
+//#elif defined(CLIP_NONE)
vec4 clip(vec4 rect)
{
return rect;
@@ -32,5 +36,7 @@ vec4 clip(vec4 rect)
#else
#error "No clipping define given. Need CLIP_NONE, CLIP_RECT or CLIP_ROUNDED_RECT"
#endif
+#endif
+#endif
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]