From df21eb6f5081b1f44f08b17e567d62eb0b3daef0 Mon Sep 17 00:00:00 2001
From: Brian Paul <brianp@vmware.com>
Date: Fri, 18 Dec 2009 12:12:46 -0700
Subject: [PATCH] glsl-reload-source: use gl_Vertex instead of generic position attribute

Binding the "position" attribute to 0 and using the conventional
GL_VERTEX_ARRAY array (in piglit_draw_rect()) is a fuzzy area in the
spec.  It doesn't work in Mesa; not sure about other OpenGL implementations.

Since the point of this piglit test is to test shader source
reloading, this is a separate issue that should be exercised in
another test, if we care about it.
---
 tests/shaders/glsl-reload-source.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/tests/shaders/glsl-reload-source.c b/tests/shaders/glsl-reload-source.c
index 84a4d79..ce33b10 100644
--- a/tests/shaders/glsl-reload-source.c
+++ b/tests/shaders/glsl-reload-source.c
@@ -43,18 +43,16 @@ int piglit_width = 100, piglit_height = 100;
 int piglit_window_mode = GLUT_RGB;
 
 static const char vs_one[] =
-"attribute vec4 position;\n"
 "varying vec4 color;\n"
 "void main() {\n"
-"   gl_Position = gl_ModelViewProjectionMatrix * position;\n"
+"   gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n"
 "   color = vec4(0.0, 0.4, 0.0, 1.0);\n"
 "}\n";
 
 static const char vs_two[] =
-"attribute vec4 position;\n"
 "varying vec4 color;\n"
 "void main() {\n"
-"   gl_Position = gl_ModelViewProjectionMatrix * position;\n"
+"   gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n"
 "   color = vec4(0.4, 0.4, 0.0, 1.0);\n"
 "}\n";
 
@@ -119,7 +117,6 @@ static void setup_shaders(const char * vstext, const char * fstext)
 	link_program(program);
 
 	glUseProgramObjectARB(program);
-	glBindAttribLocationARB(program, 0, "position");
 }
 
 enum piglit_result
-- 
1.6.2.5

