Partager via


D3DMUSAGE Values

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

The following table shows values that are flags that indicate how an application intends to use a surface. These flags are primarily designed to allow drivers to optimize the usage of that surface.

Value Description

D3DMUSAGE_DONOTCLIP

Indicates that the application intends to load the vertex buffer with data that will never require clipping. When rendering vertex buffers with this flag the application is required to set the D3DMRS_CLIPPING render state to FALSE.

This flag is only valid for vertex buffers.

D3DMUSAGE_DYNAMIC

Indicates that the application intends to frequently lock the surface. The driver can use this information to decide how to allocate the given surface. It may, for example, not keep the given surface in a swizzled format to speed up the lock routines.

This usage flag can be used on a surface regardless of which memory pool the surface is in. Specifically, you can use D3DMUSAGE_DYNAMIC on surfaces in the D3DMPOOL_MANAGED (see D3DMPOOL) memory pool.

The usage flag is valid on vertex buffers, index buffers, and texture maps, if the driver allows locking texture maps.

The lock flags D3DMLOCK_DISCARD and D3DMLOCK_NOOVERWRITE are only valid on surfaces created as D3DMUSAGE_DYNAMIC.

D3DMUSAGE_LOCKABLE

Used by an application to indicate that it will be locking the given resource.

This flag is valid on all surface types so long as the driver reports that it supports locking that surface type. Even if the driver does support locking, it may be advantageous to not specify this flag for certain resources, such as texture maps, if you plan on loading them with IDirect3DMobileDevice::CopyRects or IDirect3DMobileDevice::UpdateTexture. This indicates to the driver that the resource will never be locked, and it can optimize appropriately, if it chooses.

D3DMUSAGE_RENDERTARGET

This flag is used for two separate purposes:

  • The middleware uses it in conjunction with a regular surface creation, as specified by the D3DMRESOURCETYPE value D3DMRTYPE_SURFACE, to indicate the creation of a back buffer.
  • This flag may also be used when creating a texture map. The application sets this flag to indicate that the application will be sending the texture drawing command by means of IDirect3DMobileDevice::SetRenderTarget.

D3DMUSAGE_TEXTURE

This flag is used internally when creating texture map levels. The application should not specify it when creating any other surfaces.

D3DMUSAGE_VALID

Used as a mask to validate combinations of the other flags.

D3DMUSAGE_WRITEONLY

This flag is set to inform the system that the application intends only to write to the surface. When the application locks the surface, the results of reading through the given pointer are undefined.

This flag is valid for vertex buffers, index buffers, texture maps, and image surfaces.

Requirements

Header d3dmtypes.h
Windows Embedded CE Windows CE 5.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

Direct3D Mobile Macros