游戏开发论坛

 找回密码
 立即注册
搜索
查看: 1257|回复: 0

FAQ-5 我很少使用RTT或者只渲染很少量的几何体到纹理缓存

[复制链接]

41

主题

184

帖子

184

积分

注册会员

Rank: 2

积分
184
发表于 2006-12-14 02:44:00 | 显示全部楼层 |阅读模式
"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.
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

作品发布|文章投稿|广告合作|关于本站|游戏开发论坛 ( 闽ICP备17032699号-3 )

GMT+8, 2026-1-26 01:59

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表