Original Post
I am currently handling HLSL shaders through my own class interface that handles the validation, state changes and handle setting. The class is starting to become convoluted, and I am considering switching over to the effects framework (through the ID3DXEffect interface) instead of my own handling of the shaders and shader states. However, whenever I look into the effects interface I become worried about performance issues in regards to how the effects framework handles its state changes. In order to optimize graphics performance, we must minimize state changes. The effects framework handles the state changes by allowing us to set all the states neccesary for every effect, and it saves and switches states when you begin the effect. My concern is how the Effects framework handles these state changes internally. Does it protect against redundant state changes? Must it query the device in order to determine which states it must change - which will void the usage of a pure device? I have attempted to find any information about how the effects framework handles its state changes, but the information does not appear readily available, or I am searching in the wrong places. My intuition suggests the microsoft tutorials on the effects framework would advertise efficient usage of state changes if that were the case. My main question to all you champs here is: Will using the effects framework yield any performance penalty over handling shaders and state changes on my own (which would emphasize minimal state changes)? - Shaun