PDA

View Full Version : Context switches



titan
05-09-2003, 06:59 PM
I wanted to render some robots with a shadow map applied for self shadowing. I thought I'd create a nice big texture and reuse it to create a shadow for each character.

This kills the frame rate. Even if I don't actually render anything to the texture, the cost of switching contexts in killer (on a GF4Ti anyway).

Is switching contexts just a really expensive thing and if I want it to work I can really only draw one shadow map for the entire scene instead of one per character?

knackered
05-10-2003, 02:02 AM
Why are you switching contexts?
Are you using render-to-texture?

titan
05-10-2003, 09:26 PM
Originally posted by knackered:
Why are you switching contexts?
Are you using render-to-texture?

Yeah, I've got a bunch of textures (mostly shadow maps) I use each frame which are different than the previous frame.

As they needed to be regenerated I thought it would be smart to simply reuse the texture and save the memory for the static textures.

Humus
05-11-2003, 03:02 AM
Context switches shouldn't be overly expensive. Switch times should be insignificant compared to time it takes to render to the texture. If not, then you'll have to push nVidia to speed things up I suppose.

Korval
05-11-2003, 09:59 AM
You're using ARB_Render_texture, yes (along with the other assiciated extensions)? It is known that nVidia's implementation of this extension isn't terribly well optimized. Some have speculated that an internal texture copy operation is involved.