[PATCH xserver] glamor: Declare "pos" in glamor_dash.c

Eric Engestrom eric.engestrom at imgtec.com
Thu Feb 23 13:28:43 UTC 2017


From: "Dr.-Ing. Dieter Jurzitza" <dieter.jurzitza at t-online.de>

Fixes compile failure:

 Failed to compile VS: 0:13(43): error: `pos' undeclared
0:13(14): error: operands to arithmetic operators must be numeric
0:13(13): error: operands to arithmetic operators must be numeric

 Program source:
#version 130
attribute vec3 primitive;
varying float dash_offset;
uniform vec2 fill_offset;
uniform vec2 fill_size_inv;
varying vec2 fill_pos;
uniform float dash_length;
uniform vec4 v_matrix;
void main() {
       dash_offset = primitive.z / dash_length;
       gl_Position.xy = primitive.xy.xy * v_matrix.xz + v_matrix.yw;
       gl_Position.zw = vec2(0.0,1.0);
       fill_pos = (fill_offset + primitive.xy + pos) * fill_size_inv;
}
 (EE) Fatal server error:
 (EE) GLSL compile failure

Signed-off-by: Dr.-Ing. Dieter Jurzitza <dieter.jurzitza at t-online.de>
Tested-by: Stefan Dirsch <sndirsch at suse.com>
---


I looked a bit more into this, and while I don't know much about glamor
(or glsl, to be honest), I don't think this fix is correct.

Was `pos` in glamor_program.c intended to be `gl_Position`, by any
chance?  That would make more sense to me.

Cc: Keith Packard <keithp at keithp.com>


---
 glamor/glamor_dash.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/glamor/glamor_dash.c b/glamor/glamor_dash.c
index 3c19dba32..78a4fa37a 100644
--- a/glamor/glamor_dash.c
+++ b/glamor/glamor_dash.c
@@ -32,6 +32,7 @@ static const char dash_vs_vars[] =
 
 static const char dash_vs_exec[] =
     "       dash_offset = primitive.z / dash_length;\n"
+    "       vec2 pos = vec2(0,0);\n"
     GLAMOR_POS(gl_Position, primitive.xy);
 
 static const char dash_fs_vars[] =
-- 
Cheers,
  Eric



More information about the xorg-devel mailing list