Bugzilla – Attachment 27726 Details for
Bug 64945
fglrx: points w/ vertex progs broken
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
IDP Log In
|
Forgot Password
Test case
point_vprog.c (text/plain), 3.23 KB, created by
Matthias Hopf
on 2005-01-18 23:20:52 UTC
(
hide
)
Description:
Test case
Filename:
MIME Type:
Creator:
Matthias Hopf
Created:
2005-01-18 23:20:52 UTC
Size:
3.23 KB
patch
obsolete
>#include <stdio.h> >#include <stdlib.h> >#include <string.h> >#include <assert.h> > >#include <GL/glut.h> >#include <GL/glext.h> > >#define CHECKERR(a) do { int i = glGetError (); if (i != GL_NO_ERROR) printf (" *** %s: 0x%x = %s\n", a, i, gluErrorString (i)); } while (0) > >#if defined (_WIN32) >#define getaddr(x) wglGetProcAddress(x) >#else >extern void (*glXGetProcAddressARB(const GLubyte *procName))(); >#define getaddr(x) glXGetProcAddressARB(x) >#endif > > >int gfxsizex = 400, gfxsizey = 300; > >PFNGLBINDPROGRAMARBPROC glBindProgramARB_; >PFNGLGENPROGRAMSARBPROC glGenProgramsARB_; >PFNGLPROGRAMSTRINGARBPROC glProgramStringARB_; > >GLint vprog; > >const char *vprog_src = "!!ARBvp1.0\n" > "ATTRIB posin = vertex.position;\n" > "ATTRIB colin = vertex.color;\n" > "PARAM const = 100;\n" > "PARAM trafo[] = { state.matrix.mvp };\n" > "OUTPUT posout = result.position;\n" > "OUTPUT colout = result.color;\n" > "MOV colout, colin;\n" > "DP4 posout.x, posin, trafo[0];\n" > "DP4 posout.y, posin, trafo[1];\n" > "DP4 posout.z, posin, trafo[2];\n" > "DP4 posout.w, posin, trafo[3];\n" > "END\n"; > > >void init (void) { > glBindProgramARB_ = getaddr ("glBindProgramARB"); > glGenProgramsARB_ = getaddr ("glGenProgramsARB"); > glProgramStringARB_ = getaddr ("glProgramStringARB"); > assert (glBindProgramARB_); > assert (glGenProgramsARB_); > assert (glProgramStringARB_); > > glPointSize (50); > glHint (GL_POINT_SMOOTH_HINT, GL_NICEST); > glEnable (GL_POINT_SMOOTH); > > glGenProgramsARB_ (1, &vprog); > glBindProgramARB_ (GL_VERTEX_PROGRAM_ARB, vprog); > glProgramStringARB_ (GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, > strlen (vprog_src), vprog_src); >} > >void run (void) { > if (! glBindProgramARB_) > return; > glClear (GL_COLOR_BUFFER_BIT); > glEnable (GL_VERTEX_PROGRAM_ARB); > glBindProgramARB_ (GL_VERTEX_PROGRAM_ARB, vprog); > glBegin (GL_POINTS); > glColor4ub (255, 0, 0, 255); > glVertex3f (100, 100, -0.5); > glVertex3f (200, 100, -0.5); > glVertex3f (300, 100, -0.5); > glEnd (); > glDisable (GL_VERTEX_PROGRAM_ARB); > glBegin (GL_POINTS); > glColor4ub (0, 255, 0, 255); > glVertex3f (100, 200, -0.5); > glVertex3f (200, 200, -0.5); > glVertex3f (300, 200, -0.5); > glEnd (); > > glutSwapBuffers (); > glutPostRedisplay (); >} > > >void reshape (int width, int height) { > fprintf (stderr, "reshape %d %d\n", width, height); > gfxsizex = width; > gfxsizey = height; > glViewport (0, 0, width, height); > glMatrixMode (GL_PROJECTION); > glLoadIdentity (); > glOrtho (0, width, 0, height, 0, 1); > glMatrixMode (GL_MODELVIEW); > glLoadIdentity (); > init (); > glutPostRedisplay (); >} > > >void keyboard (unsigned char key, int x, int y) { > exit (0); >} > > >int main (int argc, char *argv[]) { > glutInitWindowSize (gfxsizex, gfxsizey); > glutInit (&argc, argv); > > glutInitDisplayMode (GLUT_RGB|GLUT_DOUBLE); > glutCreateWindow (argv[0]); > glutReshapeFunc (reshape); > glutDisplayFunc (run); > glutKeyboardFunc (keyboard); > > glutMainLoop (); > exit (0); >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
Attachments on
bug 64945
: 27726 |
27727