[gtk/wip/baedert/gl-rework: 65/71] gl renderer: Shorten shaders a bit
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/baedert/gl-rework: 65/71] gl renderer: Shorten shaders a bit
- Date: Thu, 23 Jan 2020 15:17:55 +0000 (UTC)
commit d6d5a7d8e03e3598c6534330570f893a8fb2055a
Author: Timm Bäder <mail baedert org>
Date: Mon Jan 20 11:21:52 2020 +0100
gl renderer: Shorten shaders a bit
gsk/resources/glsl/preamble.fs.glsl | 8 ++------
gsk/resources/glsl/preamble.vs.glsl | 6 +-----
2 files changed, 3 insertions(+), 11 deletions(-)
---
diff --git a/gsk/resources/glsl/preamble.fs.glsl b/gsk/resources/glsl/preamble.fs.glsl
index b5c958ebf1..5107470e00 100644
--- a/gsk/resources/glsl/preamble.fs.glsl
+++ b/gsk/resources/glsl/preamble.fs.glsl
@@ -77,9 +77,7 @@ rounded_rect_coverage (RoundedRect r, vec2 p)
}
vec4 Texture(sampler2D sampler, vec2 texCoords) {
-#if GSK_GLES
- return texture2D(sampler, texCoords);
-#elif GSK_LEGACY
+#if defined(GSK_GLES) || defined(GSK_LEGACY)
return texture2D(sampler, texCoords);
#else
return texture(sampler, texCoords);
@@ -95,9 +93,7 @@ void setOutputColor(vec4 color) {
// We do *NOT* transform the clip rect here since we already
// need to do that on the CPU.
-#if GSK_GLES
- gl_FragColor = color * rounded_rect_coverage(create_rect(u_clip_rect), f.xy);
-#elif GSK_LEGACY
+#if defined(GSK_GLES) || defined(GSK_LEGACY)
gl_FragColor = color * rounded_rect_coverage(create_rect(u_clip_rect), f.xy);
#else
outputColor = color * rounded_rect_coverage(create_rect(u_clip_rect), f.xy);
diff --git a/gsk/resources/glsl/preamble.vs.glsl b/gsk/resources/glsl/preamble.vs.glsl
index 1dc4a5e7bf..76de2d6561 100644
--- a/gsk/resources/glsl/preamble.vs.glsl
+++ b/gsk/resources/glsl/preamble.vs.glsl
@@ -2,11 +2,7 @@ uniform mat4 u_projection;
uniform mat4 u_modelview;
uniform float u_alpha;
-#if GSK_GLES
-attribute vec2 aPosition;
-attribute vec2 aUv;
-_OUT_ vec2 vUv;
-#elif GSK_LEGACY
+#if defined(GSK_GLES) || defined(GSK_LEGACY)
attribute vec2 aPosition;
attribute vec2 aUv;
_OUT_ vec2 vUv;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]