progs/fp: Add a bit of local variable testing to fp-tri
authorJakob Bornecrantz <jakob@tungstengraphics.com>
Thu, 18 Sep 2008 12:14:56 +0000 (14:14 +0200)
committerJakob Bornecrantz <jakob@tungstengraphics.com>
Thu, 18 Sep 2008 12:14:56 +0000 (14:14 +0200)
progs/fp/fp-tri.c
progs/fp/local.txt [new file with mode: 0644]

index cb991f803ebeb6aa80fc32e77144bef94bb8e78a..2512e824ee75516d4fd233bdb54df6e5a1fa8038 100644 (file)
@@ -130,6 +130,8 @@ static void Display(void)
 {
    glClear(GL_COLOR_BUFFER_BIT);
 
+   glProgramLocalParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, 0, 1.0, 1.0, 0.0, 0.0);
+   glProgramLocalParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, 1, 0.0, 0.0, 1.0, 1.0);
    glBegin(GL_TRIANGLES);
    glColor3f(0,0,1);
    glVertex3f( 0.9, -0.9, -30.0);
diff --git a/progs/fp/local.txt b/progs/fp/local.txt
new file mode 100644 (file)
index 0000000..6cb2a2f
--- /dev/null
@@ -0,0 +1,11 @@
+!!ARBfp1.0
+TEMP R0;
+PARAM c[4] = { { 0, 0, 0, 0 },
+               program.local[0..1],
+               { 1, 1, 1, 1 } };
+MOV R0, c[1];
+SUB R0, R0, c[0];
+ADD R0, R0, c[2];
+MUL R0, R0, c[3];
+MOV result.color, R0;
+END