|
|

楼主 |
发表于 2007-7-11 09:52:00
|
显示全部楼层
Re:关于D3DX Shader Effects State Management,一起讨论讨论
D3DX effects do lots of work behind the scenes to make programmer's life easier. D3D guys are making serious improvements in reducing Effect system overhead (optimizing internals), but some things just can't be optimized away. I'm mostly talking about the fact that by default, effects save and restore all modified D3D device state - this obviously has some overhead (probably mostly in D3D runtime and the driver, not in Effects themselves). This behavior is great for quick prototyping, but what if we could reduce the state management overhead?
One common advice is "don't save/restore state in Effects" (via D3DXFX_DONOTSAVE* flags). Ok, fine, but what's then? After one effect, another one will be messed up because previous one might set some exotic states! Setting all states in each effect is also not a viable option: if just one of them wanted to set some rarely used state (e.g. ShadeMode=Flat), then all other effects would need to set it back to Gouraud.
里面表达的意思是什么?我认为这个很重要 |
|