#346 instancing shaders is excessivly expensive

non_fatal
open
nobody
general (168)
6
2012-09-20
2008-12-15
Chris Foster
No

Instancing shaders many times is much more expensive than it needs to be, both in memory and time.

The attached test case comes from the forum and contains about 80000 instances of the same shader with slightly different parameters. aqsis uses at least several hundred megabytes to read in the RIB (I killed it after that, though the original author claims that it causes aqsis to crash).

Looking at the code, the most obvious thing we're doing wrong is Clone()ing the entire shader program for each instance of the shader (see renderer.cpp:1188). At the least, we need a way to separate loaded shader programs from shader instances.

Discussion


Anonymous


Cancel   Add attachments