转自:http://blog.csdn.net/blues1021/article/details/41408033
翻译自:http://msdn.microsoft.com/en-us/library/windows/desktop/bb172625(v=vs.85).aspx
Usage options that identify how resources are to be used.
Usages are either specified when a resource is created, orspecified with CheckDeviceType to test the capability of an existing resource.
D3DUSAGE是指定资源被使用的方式;使用方式是在资源创建,或测试资源的像素形式中被指定(用上)。
使用方式包括了怎样去用:会受到资源类型(textures and depth stencil surfaces/textures),存取(存储D3DPOOL_和锁定D3DUSAGE_),渲染状态D3DRS_的限定。
常用的使用方式:
D3DUSAGE_AUTOGENMIPMAP:
The resource willautomatically generate mipmaps.
Automatic generation ofmipmaps is not supported for volume textures and depth stencilsurfaces/textures.
This usage is not valid fora resource in system memory (D3DPOOL_SYSTEMMEM).
资源类型是多级纹理使用,体积纹理,深度模板缓存表面或纹理的不能使用;在存储类型是D3DPOOL_SYSTEMMEM的不能使用。
D3DUSAGE_DEPTHSTENCIL:
只能在D3DPOOL_DEFAULT的深度模板缓存中使用。
The resource willbe a depth stencil buffer. D3DUSAGE_DEPTHSTENCIL canonly be used with D3DPOOL_DEFAULT.
将会被使用到深度模板缓存中,只能在默认的存储类型D3DPOOL_DEFAULT中使用。
D3DUSAGE_DONOTCLIP:
Set to indicate that thevertex buffer content will never require clipping.
When rendering with buffersthat have this flag set, the D3DRS_CLIPPING render state must be set to false.
设置顶点缓存不能用于裁剪,使用了该标记,渲染状态不能使用D3DRS_CLIPPING。
D3DUSAGE_DYNAMIC:
不能在存储类型为D3DPOOL_MANAGED的资源中使用,可以在D3DPOOL_DEFAULT,D3DPOOL_SYSTEMMEM中使用。
D3DLOCK_DISCARD(锁定可放弃),D3DLOCK_NOOVERWRITE(锁定不能重写)只能D3DUSAGE_DYNAMIC中。
Ingeneral, static vertex buffers are placed in video memory and dynamic vertexbuffers are placed in AGP memory.
If you do not specifyD3DUSAGE_DYNAMIC, the vertex buffer is made static.
通常静态的顶点缓存是在video memory中,动态的顶点缓存是在AGP memory中,默认顶点是静态的放置在video memory中。
D3DUSAGE_DYNAMICis strictly enforced through the D3DLOCK_DISCARD and D3DLOCK_NOOVERWRITE lockingflags.
在锁定模式为D3DLOCK_DISCARD(锁定可放弃),D3DLOCK_NOOVERWRITE(锁定不能重写)的时候,顶点缓存会被强制设置为
D3DUSAGE_DYNAMIC(动态内存)管理,也就是说这两种锁定模式只能为D3DUSAGE_DYNAMIC的资源管理。
D3DUSAGE_DYNAMIC和D3DPOOL_MANAGED是不兼容的,所以D3DPOOL_MANAGED类型的纹理不能指定为D3DUSAGE_DYNAMIC使用方式。
D3DUSAGE_RENDERTARGET:
The resource will be arender target. D3DUSAGE_RENDERTARGET can only be used with D3DPOOL_DEFAULT.
D3DUSAGE_RTPATCHES:
Set to indicate that thevertex buffer is to be used for drawing high-order primitives.
顶点缓存用于高级几何体,高级几何体包括动画,人物模型,地形和水等复杂物体。
D3DUSAGE_WRITEONLY:
D3DPOOL_DEFAULT中必须使用D3DUSAGE_WRITEONLY,不然会影响性能。
可以是各种D3DPOOL类型,写和渲染性能更高,尝试读取该标识的资源将失败。
Informs the system that the application writes only to the vertex buffer.Using this flag enables the driver to choose the best memory location forefficient write operations and rendering.
Buffers created with D3DPOOL_DEFAULT that do not specifyD3DUSAGE_WRITEONLY may suffer a severe performance penalty.
D3DUSAGE_WRITEONLY only affects the performance of D3DPOOL_DEFAULT buffers.
D3DUSAGE_WRITEONLY可以获得较高的写操作和渲染性能,D3DPOOL_DEFAULT不指定为只写,会丢失很多性能,只能在D3DPOOL_DEFAULT存储类型中起作用。