PDA

View Full Version : what's wrong with this?



haigu
03-12-2002, 04:50 AM
My opengl program runs only 7 FPS on Radeon 8500. I have trimmed the code so that it only draws a cube with no texturing, no buffer clear, no vertex buffer.

This program can reach over 200 FPS on TNT2, Geforce, G450, etc, with the only exception of 7 FPS on Radeon 8500. I am sure I have installed the latest driver.

This program calls ogl functions in MFC's CChildView::OnPaint().

Other glut programs run well.

Can anyone tell me what may cause the problem?

Diapolo
03-12-2002, 04:55 AM
1. Have you got the latest ATI drivers for your radeon?
2. Perhaps some form of memory leak?
3. Perhaps something with the stencil buffer or a non HW accelerated feature on the Radeon (SW Pixelformat)?

I guess it would be the best to give us a short look into your source http://www.opengl.org/discussion_boards/ubb/smile.gif.

Diapolo

dorbie
03-12-2002, 04:56 AM
Perhaps you request pixelformatdescriptor which is not available for hardware rendering on the Radeon.

haigu
03-13-2002, 04:09 AM
Well, here is the pixel format init code...




BOOL CGLWindow::InitPixel(HDC hdc)
{
PIXELFORMATDESCRIPTOR pfd = {
sizeof(PIXELFORMATDESCRIPTOR), // size of this pfd
1, // version number
PFD_DRAW_TO_WINDOW | // support window
PFD_SUPPORT_OPENGL | // support OpenGL
PFD_DOUBLEBUFFER ,

PFD_TYPE_RGBA, // RGBA type
16, // 24-bit color depth
0, 0, 0, 0, 0, 0, // color bits ignored
0, // no alpha buffer
0, // shift bit ignored
0, // no accumulation buffer
0, 0, 0, 0, // accum bits ignored
32, // 32-bit z-buffer
0, // no stencil buffer
0, // no auxiliary buffer
PFD_MAIN_PLANE, // main layer
0, // reserved
0, 0, 0 // layer masks ignored
};
int iPixelFormat = ChoosePixelFormat(hdc, &pfd );
BOOL bResault = SetPixelFormat(hdc, iPixelFormat , &pfd );
m_hGlRC = wglCreateContext( hdc );
wglMakeCurrent( hdc, m_hGlRC );
glDepthFunc( GL_LEQUAL );
return TRUE;
}

JML
03-13-2002, 04:50 AM
16, // 24-bit color depth
...
32, // 32-bit z-buffer


Don't know the Radeon (I'm on GF2), but 16 bit color combined with 32 bit depth may be the prob.

HTH

Jean-Marc


[This message has been edited by JML (edited 03-13-2002).]

Diapolo
03-13-2002, 05:21 AM
Try this, if the if-key is true, then you only have got SW mode.






int iPFDFormat = pfd.dwFlags & PFD_GENERIC_FORMAT;
int iPFDAccelerated = pfd.dwFlags & PFD_GENERIC_ACCELERATED;
if(iPFDFormat && ! iPFDAccelerated)
{
// SW mode
}


Diapolo