cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

MiKom3
Journeyman III

Changing CG shader parameters from another thread.

I'm developing a graphics engine in which graphics and game logic are executed in separate threads. CG is used as shader language.

When I try to update shader parameters from the logic thread (during scene graph evaluation) program crashes on CgSetParameter*() functions. OpenGL context was created in the rendering thread.

When I changed the engine to be single-threaded everything works fine.

Multi-threaded version works fine on NVIDIA cards.

So my question is: is it possible to change shader parameters from thread that hasn't created OpenGL context?

0 Likes
1 Reply
Byron
Staff

CG is nVidia’s shader language, we don’t support it...

You should be using GLSL on OpenGL instead and you mention that everything works fine in single-threaded but it shouldn’t.

 

0 Likes