From c18b8f1c29da10f72a104ad17286b9786d225bd5 Mon Sep 17 00:00:00 2001
From: Magnus <nergal@nergal.se>
Date: Tue, 11 Dec 2018 09:24:17 +0100
Subject: [PATCH] Added position as out variable from vertex shader.

Adding the position out form vertex shader makes us skip computation of position in the fragment shader based on gl_FragCoord.
---
 pixelgl/glshader.go | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/pixelgl/glshader.go b/pixelgl/glshader.go
index 33e4f61..5023579 100644
--- a/pixelgl/glshader.go
+++ b/pixelgl/glshader.go
@@ -226,6 +226,7 @@ in float aIntensity;
 out vec4  vColor;
 out vec2  vTexCoords;
 out float vIntensity;
+out vec2  vPosition;
 
 uniform mat3 uTransform;
 uniform vec4 uBounds;
@@ -235,6 +236,7 @@ void main() {
 	vec2 normPos = (transPos - uBounds.xy) / uBounds.zw * 2 - vec2(1, 1);
 	gl_Position = vec4(normPos, 0.0, 1.0);
 	vColor = aColor;
+	vPosition = aPosition;
 	vTexCoords = aTexCoords;
 	vIntensity = aIntensity;
 }
-- 
GitLab