|
|
"Render_to_texture_渲染到纹理(RTT)"似乎成为了我的D3D程序的性能瓶颈,甚至在我很少使用RTT或者只渲染很少量的几何体到纹理缓存时,程序也非常慢。这种状况正常吗?
首先确定你不是在D3DPOOL_MANAGED内存管理池中创建纹理的。如果使用这种内存管理模式,D3D运行时在会对所有的纹理做本地拷贝以便于管理纹理,并在模式改变时重新载入纹理到显存。因此当程序使用RTT时便意味着从本地显存回读到系统内存的发生,从而引起显著的性能下降。对于用于渲染目标的纹理,应该使用D3DPOOL_DEFAULT 方式申请内存池。
/*****************************************/
Render-to-texture seems to really slow down my Direct3D application, even when I do it infrequently and render very little geometry to a small surface. Is this normal?
Make sure you're not creating your texture in the D3DPOOL_MANAGED pool. The Direct3D runtime needs a local copy of all MANAGED textures to restore them on mode switch or for texture management, so rendering to these implies that a readback from local video memory to system memory will occur, dramatically hurting performance. For render targets, use D3DPOOL_DEFAULT instead.
|
|