Jump to content
  • Advertisement
Sign in to follow this  
CRC

OpenGL wglShareLists and FPOs

This topic is 4949 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I have a program that uses multiple rendering contexts. I have been able to share textures and display lists successfully. However, recently, I decided to add fragment programs (using ARB_fragment_program extension) to the code. My problem is that after I call wglShareLists(hglrc1, hglrc2), I crash NVIDIA's OpenGL ICD whenever I call glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, <progname>). This problem appears to be specific with NVIDIA's driver, since I cannot reproduce the error on ATI machines. I was wondering if anyone has had similar issues with NVIDIA cards trying to share FPOs (i.e. fragment program objects) across multiple rendering contexts. FYI, here is the FP code: !!ARBfp1.0 TEMP R0; TEX R0, fragment.texcoord, texture, 3D; MAD result.color, R0, program.local[0].x, program.local[1].x; END I have noticed that if I comment out the MAD line, and replaced it simply with MOV result.color, R0 -- the FP works. Of course, it doesn't do anything interesting. Anyway, tnanks for any advice you can offer, or in helping me get in touch with NVIDIA's developer support. CRC

Share this post


Link to post
Share on other sites
Advertisement
Hello..

I just use GLSL, but I'll give it a try:
Have you tried to use that fragment program with only one rendering context?
I would guess you have to change the MAD line to something like:
MAD result.color, R0, program.local[0].xxxx, program.local[1].xxxx;

Make sure you do alot of error-checking.. + make use of the excelent tool glIntercept (http://glintercept.nutty.org/), it can find your bugs for you ;].

Good luck!

Share this post


Link to post
Share on other sites
Thanks for the pointer,

The FPO does work as intended in a single RC. As you could guess, it simply adjusts contrast and brightness.

glInterceptor wasn't able to provide much more information. It stopped logging right after the crash:
glEnable(GL_TEXTURE_GEN_S)
glEnable(GL_TEXTURE_GEN_T)
glEnable(GL_TEXTURE_GEN_R)
glIsTexture(1)=true
glBindTexture(GL_TEXTURE_3D,1)
glTexGeni(GL_S,GL_TEXTURE_GEN_MODE,9216)
glTexGeni(GL_T,GL_TEXTURE_GEN_MODE,9216)
glTexGeni(GL_R,GL_TEXTURE_GEN_MODE,9216)
glTexGenfv(GL_S,GL_EYE_PLANE,0x134d0f4)
glTexGenfv(GL_T,GL_EYE_PLANE,0x134d104)
glTexGenfv(GL_R,GL_EYE_PLANE,0x134d114)
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA)
glColor4f(1.000000,1.000000,1.000000,0.900000)
glEnable(GL_FRAGMENT_PROGRAM_ARB)
glIsProgramARB(1)=true
glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB,1)
glProgramLocalParameter4fARB(GL_FRAGMENT_PROGRAM_ARB,0,54.613335,0.000000,0.000000,0.000000)
glProgramLocalParameter4fARB(GL_FRAGMENT_PROGRAM_ARB,1,-0.166667,0.000000,0.000000,0.000000)
glBegin(GL_QUADS) FP=1 Textures[ (0,1) ]
----->wglGetCurrentContext()=0x0000
----->wglMakeCurrent(0xbd01085d,0x10001)
----->----->wglGetPixelFormat(0xbd01085d)=0 =false
----->wglGetCurrentContext()=0x0000
----->wglMakeCurrent(0xa70107f6,0x10000)
----->----->wglGetPixelFormat(0xa70107f6)=0 =false


I am beginning to suspect that it is an ICD problem.

Does anyone have suggestions for a workaround? I am interested in color scale and bias methods that doesn't require reloading a large 3D Texture. I thought FPOs would do the trick.

Thanks.

Share this post


Link to post
Share on other sites
I take it that
----->wglGetCurrentContext()=0x0000 
----->wglMakeCurrent(0xbd01085d,0x10001)
----->----->wglGetPixelFormat(0xbd01085d)=0 =false
----->wglGetCurrentContext()=0x0000
----->wglMakeCurrent(0xa70107f6,0x10000)
----->----->wglGetPixelFormat(0xa70107f6)=0 =false



isnt something you are calling?

Share this post


Link to post
Share on other sites
Hi,

As nearly as I can tell, those last 6 lines of the code happen after the crash. They come from cleanup code to delete the RCs (0x10001 and 0x10000), where I call wglMakeCurrent(NULL, NULL) to release the DC.

The actual crash happens right after glBegin(GL_QUADS).

So the idea was to bind the shared FPO, load in two local parameters (corresponding to scale and bias), and then draw the textured quad. It works in single RC cases, but not in multiple RCs on Nvidia drivers.

CRC

Share this post


Link to post
Share on other sites
Hello...

You can tell glIntercept to do ALOT of error-checking, and break on error.
That's what I'm using. The call-logging was only fun for Doom3 etc.. ;]
It's well documented in a txt-file and in the ini-files.

Good luck!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!