PDA

View Full Version : probable bug in nvidia linux drivers secondary_color



zed
12-22-2002, 10:28 AM
uncommenting any of the following two lines will cause a seg_fault

float dd[3];
// glSecondaryColorPointerEXT( 3, GL_FLOAT, 0, dd );
glColorPointer( 3, GL_FLOAT, 0, dd );
GLubyte rr[3];
// glSecondaryColor3ubvEXT(rr);

the exact same code works on windows

method of getting access to extension is
glSecondaryColor3ubvEXT =(PFNGLSECONDARYCOLOR3UBVEXTPROC) SDL_GL_GetProcAddress("glSecondaryColor3ubvEXT");

other extensions work eg multitexture,register combiners etc

i assume this is a bug (unless ive missed something in the spec (which ive gone over 3x))
tested on nvidia drivers tested 28.xx + 41.91

this has been holding up my alpha release of KEA for the last week (been working 7days a week thus aint done much time on codingm, but anyways), so please anyone i want confirmation this is a bug (then i can work around it)
cheers zed

pbrown
12-22-2002, 05:23 PM
zed,

I do most of my driver development work on Windows, so I'm not the best source for this info. I do know that we have a good number of tests that use secondary color in our validation suite.

glSecondaryColorPointerEXT is a fairly innocous call -- all it should be doing is setting up a pointer and some type information. It kind of sounds like something is getting dispatched to the wrong place. Is the GetProcAddress call returning valid-looking pointers for these functions? What happens if you step through the code? (I am assuming by your comment that your program is crashing the same way on all the drivers you've tested.)

If you can send me some more info off-line, I can consult with our Linux driver guys. ((Please email me, as there are plenty of days that I don't have any time to check the forums.))

zed
12-24-2002, 10:16 AM
pat ill email u the source (inluded below) + an linux exe.

heres the output
glSecondaryColorPointerEXT 0
glSecondaryColorPointerEXT 8049f18
glSecondaryColorPointerEXT test:Fatal signal: Segmentation Fault (SDL Parachute Deployed)

(ill post this in the linux forum as well perhaps others have experienced this before)




#define NO_SDL_GLEXT 1

#include <SDL/SDL.h>
#include <SDL/SDL_opengl.h>
#include "glext.h"

#include <stdio.h>
#include <stdlib.h>

int window_Width=500, window_Height=500;
PFNGLSECONDARYCOLORPOINTEREXTPROC glSecondaryColorPointerEXT = NULL;

void setup_opengl_extensions( void )
{
printf( "glSecondaryColorPointerEXT %x\n", glSecondaryColorPointerEXT );
glSecondaryColorPointerEXT = (PFNGLSECONDARYCOLORPOINTEREXTPROC) SDL_GL_GetProcAddress("glSecondaryColorPointerEXT");
printf( "glSecondaryColorPointerEXT %x\n", glSecondaryColorPointerEXT );
}

static void quit_tutorial( int code )
{
SDL_Quit( );
exit( code );
}

static void process_events( void )
{
SDL_Event event;
while( SDL_PollEvent( &amp;event ) )
{
switch( event.type )
{
case SDL_KEYDOWN:
if ( event.key.keysym.sym == SDLK_ESCAPE )
quit_tutorial( 0 );
break;
case SDL_QUIT:
quit_tutorial( 0 );
break;
}
}
}

static void draw_screen( void )
{
glClear ( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );

glViewport( 0, 0, window_Width, window_Height );
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0,100,0,100,-100,100);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();

glEnableClientState( GL_SECONDARY_COLOR_ARRAY_EXT );

float dd[3];
glColorPointer( 3, GL_FLOAT, 0, dd );
fprintf( stderr,"glSecondaryColorPointerEXT test:" );
fflush( stderr );
glSecondaryColorPointerEXT( 3, GL_FLOAT, 0, dd );
fprintf( stderr,"pass\n");

SDL_GL_SwapBuffers( );
}

int main( int argc, char* argv[] )
{
const SDL_VideoInfo* info = NULL;
int width = 0;
int height = 0;
int bpp = 0;
int flags = 0;

if( SDL_Init( SDL_INIT_VIDEO | SDL_INIT_AUDIO ) < 0 )
{
fprintf( stderr, "Video initialization failed: %s\n", SDL_GetError( ) );
quit_tutorial( 1 );
}

info = SDL_GetVideoInfo( );

if( !info )
{
fprintf( stderr, "Video query failed: %s\n", SDL_GetError( ) );
quit_tutorial( 1 );
}

bpp = info->vfmt->BitsPerPixel;
SDL_GL_SetAttribute( SDL_GL_RED_SIZE, 5 );
SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 6 );
SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 5 );
SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 16 );
SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );

flags = SDL_OPENGL;// | SDL_FULLSCREEN;


if( SDL_SetVideoMode( window_Width, window_Height, bpp, flags ) == 0 )
{
fprintf( stderr, "Video mode set failed: %s\n", SDL_GetError( ) );
quit_tutorial( 1 );
}

setup_opengl_extensions();

while( 1 )
{
process_events( );
draw_screen( );
}
return 0;
}