summaryrefslogtreecommitdiff
path: root/progs/vp
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2009-03-20 10:52:17 +1000
committerDave Airlie <airlied@redhat.com>2009-03-20 10:52:17 +1000
commit407e8ae5b167b0193e1e5b1266a5d61ed836dfb5 (patch)
tree2d9d05a5c3122f41a13aa8bd9ae921c1176e6b0d /progs/vp
parentbdaa0341caffc353fd26bbd91865c2d86eed11c1 (diff)
parent114bb54324f22cb53bcd14607234d0acd74d37bd (diff)
Merge remote branch 'main/master' into radeon-rewrite
Conflicts: src/mesa/drivers/dri/r300/r300_cmdbuf.c src/mesa/drivers/dri/r300/r300_state.c src/mesa/drivers/dri/r300/r300_swtcl.c src/mesa/drivers/dri/r300/radeon_ioctl.c src/mesa/drivers/dri/radeon/radeon_screen.c
Diffstat (limited to 'progs/vp')
-rw-r--r--progs/vp/addimm.txt5
-rw-r--r--progs/vp/arl-static.txt7
-rw-r--r--progs/vp/arl-unused.txt7
-rw-r--r--progs/vp/exp-no-w.txt6
-rw-r--r--progs/vp/msk.txt7
-rw-r--r--progs/vp/psiz-mul.txt6
-rw-r--r--progs/vp/vp-tris.c55
7 files changed, 89 insertions, 4 deletions
diff --git a/progs/vp/addimm.txt b/progs/vp/addimm.txt
new file mode 100644
index 0000000000..f5796d7810
--- /dev/null
+++ b/progs/vp/addimm.txt
@@ -0,0 +1,5 @@
+!!ARBvp1.0
+TEMP R0;
+ADD result.color, vertex.color, {.5}.x;
+MOV result.position, vertex.position;
+END
diff --git a/progs/vp/arl-static.txt b/progs/vp/arl-static.txt
new file mode 100644
index 0000000000..aea87b79a4
--- /dev/null
+++ b/progs/vp/arl-static.txt
@@ -0,0 +1,7 @@
+!!ARBvp1.0
+PARAM arr[5] = { {.0,.1,.2,.3}, {.4,.5,.6,.7}, {.8,.9,.10,.1}, {.12,.3,.4,.14}, {.5,.8,.1,.9}, {.2,0,.4,.1}, {.6,.1,.8,.9}};
+ADDRESS addr;
+ARL addr.x, {3}.x;
+MOV result.color, arr[addr.x];
+MOV result.position, vertex.position;
+END
diff --git a/progs/vp/arl-unused.txt b/progs/vp/arl-unused.txt
new file mode 100644
index 0000000000..7bdbb8e86c
--- /dev/null
+++ b/progs/vp/arl-unused.txt
@@ -0,0 +1,7 @@
+!!ARBvp1.0
+PARAM arr[5] = { {.0,.1,.2,.3}, {.4,.5,.6,.7}, {.8,.9,.10,.1}, {.12,.3,.4,.14}, {.5,.8,.1,.9}, {.2,0,.4,.1}, {.6,.1,.8,.9}};
+ADDRESS addr;
+ARL addr.x, {3}.x; # not actually used
+MOV result.color, arr[3];
+MOV result.position, vertex.position;
+END
diff --git a/progs/vp/exp-no-w.txt b/progs/vp/exp-no-w.txt
new file mode 100644
index 0000000000..98ed4b7a98
--- /dev/null
+++ b/progs/vp/exp-no-w.txt
@@ -0,0 +1,6 @@
+!!ARBvp1.0
+TEMP R0;
+EXP R0, vertex.color.x;
+SUB result.color, R0.z, {1.0}.x;
+MOV result.position, vertex.position;
+END
diff --git a/progs/vp/msk.txt b/progs/vp/msk.txt
new file mode 100644
index 0000000000..9e925aca11
--- /dev/null
+++ b/progs/vp/msk.txt
@@ -0,0 +1,7 @@
+!!ARBvp1.0
+TEMP R0;
+MOV R0.xz, vertex.color;
+MOV R0.yw, {0.5}.x;
+MOV result.color, R0;
+MOV result.position, vertex.position;
+END
diff --git a/progs/vp/psiz-mul.txt b/progs/vp/psiz-mul.txt
new file mode 100644
index 0000000000..a74df66de2
--- /dev/null
+++ b/progs/vp/psiz-mul.txt
@@ -0,0 +1,6 @@
+!!ARBvp1.0
+MOV result.color, vertex.color;
+MUL result.pointsize, vertex.color.x, {10.0}.x;
+MOV result.position, vertex.position;
+END
+
diff --git a/progs/vp/vp-tris.c b/progs/vp/vp-tris.c
index 87cb12b984..97995accdd 100644
--- a/progs/vp/vp-tris.c
+++ b/progs/vp/vp-tris.c
@@ -16,6 +16,10 @@
static const char *filename = NULL;
static GLuint nr_steps = 4;
+static GLuint prim = GL_TRIANGLES;
+static GLfloat psz = 1.0;
+static GLboolean pointsmooth = 0;
+static GLboolean program_point_size = 0;
static void usage( char *name )
{
@@ -186,6 +190,14 @@ static void subdiv( union vert *v0,
}
}
+static void enable( GLenum value, GLboolean flag )
+{
+ if (flag)
+ glEnable(value);
+ else
+ glDisable(value);
+}
+
/** Assignment */
#define ASSIGN_3V( V, V0, V1, V2 ) \
do { \
@@ -198,8 +210,12 @@ static void Display( void )
{
glClearColor(0.3, 0.3, 0.3, 1);
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
+ glPointSize(psz);
+
+ enable( GL_POINT_SMOOTH, pointsmooth );
+ enable( GL_VERTEX_PROGRAM_POINT_SIZE_ARB, program_point_size );
- glBegin(GL_TRIANGLES);
+ glBegin(prim);
{
@@ -243,9 +259,40 @@ static void Key( unsigned char key, int x, int y )
(void) x;
(void) y;
switch (key) {
- case 27:
- exit(0);
- break;
+ case 'p':
+ prim = GL_POINTS;
+ break;
+ case 't':
+ prim = GL_TRIANGLES;
+ break;
+ case 's':
+ psz += .5;
+ break;
+ case 'S':
+ if (psz > .5)
+ psz -= .5;
+ break;
+ case 'm':
+ pointsmooth = !pointsmooth;
+ break;
+ case 'z':
+ program_point_size = !program_point_size;
+ break;
+ case '+':
+ nr_steps++;
+ break;
+ case '-':
+ if (nr_steps)
+ nr_steps--;
+ break;
+ case ' ':
+ psz = 1.0;
+ prim = GL_TRIANGLES;
+ nr_steps = 4;
+ break;
+ case 27:
+ exit(0);
+ break;
}
glutPostRedisplay();
}