Hello,
I wanted to learn more about OpenGL during the weekend and started
reading the "OpenGL Programming Guide". The first example I tried
(Example 3.1 Transformed Cube) displayed only a black window with hw
accel but worked fine with LIBGL_ALWAYS_INDIRECT=1.
I made some modifications to the programme and was then able to
illustrate some real strange effects. It looks like transformation
information is either lost or not updated in the radeon driver at
appropriate times when the window is moved or resized. Could someone
else with a Radeon 7x00 try to reproduce this please. I attached the
source code.
I defined three macros which influence the behaviour. The following
table lists the effects I am seeing depending on which macros are
defined.
(shortcuts: v=VIEWPORT_IN_DISPLAY, f=FRUSTUM_IN_DISPLAY, u=DO_USLEEP)
defined
macros behaviour with radeon driver behaviour with indirect rendering
(none) window is black transformed cube is displayed,
resizing the window distorts the cube
subsequently abbrev. "ok"
--v black ok
-f- cube is displayed ok
move window => cube stays at
same position on screen
resize window => cube disappears
rarely reappears
-fv ok ok
u-- windows starts black ok
resize window => cube somtimes
appears
move window when cube visible
=> cube disappears while moving
window opaquely, reappears when
dropping window at same screen
position
resize window again => cube
at correct position in window
(if visible)
u-v window starts black ok
resize window => like u--
move window when cube visible
=> cube disappears while moving
window opaquely, reappears when
dropping window, cube moves
with the window
uf- cube is displayed ok
resize window => cube flickers
move window => cube disappears
while moving window apaquely,
reappears when dropping window
at same screen position
resize window again => cube
at correct position in window
(if visible)
ufv ok, except ok
cube disappears while moving
cube flickers while resizing
I had similar effects with glxgears (gears disappeared and reappeared
when moving) about two weeks ago but they disappeared for unknown
reasons. Now they reappeared. I'm not sure what triggered this. May be a
cvs update or a make world. Now that I think about it, the first time I
got this was after the first make world with gcc-3.2.
I made my tests with 16 and 24 bit color depth, w/ and w/o page
flipping, w/ and w/o TCL. With RADEON_NO_RAST the cube is always in the
correct position in the window but disappears and rarely reappears when
resizing.
Thanks for reading this long mail to the end ;-)
Felix
__\|/__ ___ ___ ___
__Tsch��_______\_6 6_/___/__ \___/__ \___/___\___You can do anything,___
_____Felix_______\�/\ \_____\ \_____\ \______U___just not everything____
[EMAIL PROTECTED] >o<__/ \___/ \___/ at the same time!
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
#include <unistd.h>
//#define VIEWPORT_IN_DISPLAY
//#define FRUSTUM_IN_DISPLAY
//#define DO_USLEEP
void init () {
glClearColor (0.0, 0.0, 0.0, 0.0);
glShadeModel (GL_FLAT);
}
int width, height;
void display () {
#ifdef VIEWPORT_IN_DISPLAY
glViewport (0, 0, (GLsizei) width, (GLsizei) height);
#endif
#ifdef FRUSTUM_IN_DISPLAY
glMatrixMode (GL_PROJECTION);
glLoadIdentity ();
glFrustum (-1.0, 1.0, -1.0, 1.0, 1.5, 20.0);
glMatrixMode (GL_MODELVIEW);
#endif
glClear (GL_COLOR_BUFFER_BIT);
glColor3f (1.0, 1.0, 1.0);
glLoadIdentity (); /* clear the matrix */
/* viewing transformation */
gluLookAt (0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
glScalef (1.0, 2.0, 1.0); /* modeling transformation */
glutWireCube (1.0);
glutSwapBuffers();
#ifdef DO_USLEEP
usleep(1); /* more friendly with LIBGL_ALWAYS_INDIRECT */
#endif
}
void reshape (int w, int h) {
width = w; height = h;
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
glMatrixMode (GL_PROJECTION);
glLoadIdentity ();
glFrustum (-1.0, 1.0, -1.0, 1.0, 1.5, 20.0);
glMatrixMode (GL_MODELVIEW);
}
int main (int argc, char *argv[]) {
int winId;
glutInit (&argc, argv);
glutInitDisplayMode (GLUT_RGBA | GLUT_DOUBLE);
glutInitWindowSize (500, 500);
glutInitWindowPosition (100, 100);
winId = glutCreateWindow ("Light Test");
init ();
glutDisplayFunc (display);
glutReshapeFunc (reshape);
glutIdleFunc (display);
glutMainLoop ();
return 0;
}