Original Post
I have been trying to figure out how to gain some improvement in rendering my GUI over the last couple of days and have kind of ran into a wall. While rendering all of the buttons in a given screen, my effect file system will sort all of the objects by type so that everything that uses the same effect get rendered together. Then the effect is started, each object is rendered during the first pass of the selected technique, each object is rendered for the second pass ... and so on until the effect is finished. Then it ends the effect and moves on to the next one. The problem comes in when rendering the objects pass by pass. In between the various objects rendering I have to call CommitChanges to update any rendering parameters that the object has changed prior to rendering itself - in particular textures. By calling CommitChanges every button that I render is calling SetTexture, giving me 30+ set texture calls that should only be 1 set texture call!!! So I am wondering what you DX experts have done to get around this problem. It would be close to impossible to keep track of what texture is set in each effect at all times - not to mention the fact that other (non-texture) parameters may change as well and I would have to keep track of those too. Is there any relatively painless way to keep objects separate but still not set EVERY parameter individually? Thanks in advance for any help or advice that someone can give!