summaryrefslogtreecommitdiff
path: root/tests/shaders/fp-incomplete-tex.c
diff options
context:
space:
mode:
authorNicolai Haehnle <nhaehnle@gmail.com>2008-06-30 21:08:00 +0200
committerNicolai Haehnle <nhaehnle@gmail.com>2008-06-30 21:08:00 +0200
commit7a7fcc23e16c6f690e42db49bb9be44ec896edac (patch)
tree133078bb1fb8cb090d0f0b4ea289beacab327b3c /tests/shaders/fp-incomplete-tex.c
parent8900a6f0ec681045dc81715af2bd3778cd6e233d (diff)
Cleanup/Code sharing: Use piglit-util functions in a number of places
Diffstat (limited to 'tests/shaders/fp-incomplete-tex.c')
-rw-r--r--tests/shaders/fp-incomplete-tex.c46
1 files changed, 2 insertions, 44 deletions
diff --git a/tests/shaders/fp-incomplete-tex.c b/tests/shaders/fp-incomplete-tex.c
index 1a46da06b..571ba0554 100644
--- a/tests/shaders/fp-incomplete-tex.c
+++ b/tests/shaders/fp-incomplete-tex.c
@@ -238,50 +238,8 @@ static void Init(void)
piglit_require_fragment_program();
- /*
- * Fragment programs
- */
- pglGenProgramsARB(NUM_PROGRAMS, FragProg);
-
- for(i = 0; i < NUM_PROGRAMS; ++i) {
- GLint errorPos;
-
- check(FragProg[i]);
-
- pglBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, FragProg[i]);
- pglProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(ProgramText[i]),
- (const GLubyte *)ProgramText[i]);
- glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errorPos);
- if (glGetError() != GL_NO_ERROR || errorPos != -1) {
- int l = FindLine(ProgramText[i], errorPos);
- int a;
-
- fprintf(stderr, "%i: Fragment Program Error (pos=%d line=%d): %s\n",
- i, errorPos, l,
- (char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- for (a=-10; a<10; a++)
- {
- if (errorPos+a < 0)
- continue;
- if (errorPos+a >= strlen(ProgramText[i]))
- break;
- fprintf(stderr, "%c", ProgramText[i][errorPos+a]);
- }
- fprintf(stderr, "\n");
-
- if (Automatic)
- printf("PIGLIT: {'result': 'fail' }\n");
- exit(1);
- }
- if (!pglIsProgramARB(FragProg[i])) {
- fprintf(stderr, "pglIsProgramARB failed\n");
- if (Automatic)
- printf("PIGLIT: {'result': 'fail' }\n");
- exit(1);
- }
- }
+ for(i = 0; i < NUM_PROGRAMS; ++i)
+ FragProg[i] = piglit_compile_program(GL_FRAGMENT_PROGRAM_ARB, ProgramText[i]);
Reshape(Width,Height);
}