summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Arceri <tarceri@itsqueeze.com>2018-04-17 18:14:20 +1000
committerTimothy Arceri <tarceri@itsqueeze.com>2018-04-17 18:22:23 +1000
commite60d247eb359f044caf0c09904da14e39d7adca1 (patch)
tree78e5c3820f84e740988dfde02618b030ee5c7c69
parent007f0bf73de8743c00424664ec3d88572b706002 (diff)
glsl-max-vertex-attrib: fix shader and check for successful link
The previous vertex shader failed to compile.
-rw-r--r--tests/shaders/glsl-max-vertex-attrib.c22
1 files changed, 4 insertions, 18 deletions
diff --git a/tests/shaders/glsl-max-vertex-attrib.c b/tests/shaders/glsl-max-vertex-attrib.c
index c0b582eb4..a7d530657 100644
--- a/tests/shaders/glsl-max-vertex-attrib.c
+++ b/tests/shaders/glsl-max-vertex-attrib.c
@@ -56,7 +56,7 @@ static const char *vShaderString =
"attribute float pos;\n"
"void main()\n"
"{\n"
- " gl_Position = pos;\n"
+ " gl_Position = vec4(pos, 0.0, 0.0, 1.0);\n"
"}\n";
static const char *fShaderString =
@@ -77,26 +77,12 @@ enum piglit_result piglit_display(void)
GLenum type;
GLchar buffer[64];
- GLuint program, vShader, fShader;
+ GLuint program;
int maxAttribCount;
/* --- valid program needed for some of the functions --- */
-
- fShader = glCreateShader(GL_FRAGMENT_SHADER);
- vShader = glCreateShader(GL_VERTEX_SHADER);
-
- glShaderSource(fShader, 1, &fShaderString, NULL);
- glShaderSource(vShader, 1, &vShaderString, NULL);
-
- glCompileShader(vShader);
- glCompileShader(fShader);
-
- program = glCreateProgram();
-
- glAttachShader(program, vShader);
- glAttachShader(program, fShader);
-
- glLinkProgram(program);
+ program = piglit_build_simple_program(vShaderString, fShaderString);
+ piglit_check_gl_error(GL_NO_ERROR);
glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &maxAttribCount);