pub struct Usage(/* private fields */);Expand description
[docs.microsoft.com] DWORD / D3DUSAGE_*
Usage options that identify how resources are to be used.
Implementations§
Source§impl Usage
impl Usage
pub const None: Usage
Sourcepub const AutoGenMipMap: Usage
pub const AutoGenMipMap: Usage
The resource will automatically generate mipmaps. See Automatic Generation of Mipmaps (Direct3D 9). Automatic generation of mipmaps is not supported for volume textures and depth stencil surfaces/textures. This usage is not valid for a resource in system memory ([Pool::SystemMem]).
Sourcepub const DepthStencil: Usage
pub const DepthStencil: Usage
The resource will be a depth stencil buffer. Usage::DepthStencil can only be used with [Pool::Default].
Sourcepub const DoNotClip: Usage
pub const DoNotClip: Usage
Set to indicate that the vertex buffer content will never require clipping. When rendering with buffers that have this flag set, the D3DRS_CLIPPING render state must be set to false.
Sourcepub const Dynamic: Usage
pub const Dynamic: Usage
Set to indicate that the vertex buffer requires dynamic memory use. This is useful for drivers because it enables them to decide where to place the buffer. In general, static vertex buffers are placed in video memory and dynamic vertex buffers are placed in AGP memory. Note that there is no separate static use. If you do not specify Usage::Dynamic, the vertex buffer is made static. Usage::Dynamic is strictly enforced through the [Lock::Discard] and [Lock::NoOverwrite] locking flags. As a result, [Lock::Discard] and [Lock::NoOverwrite] are valid only on vertex buffers created with Usage::Dynamic. They are not valid flags on static vertex buffers. For more information, see Managing Resources (Direct3D 9).
For more information about using dynamic vertex buffers, see Performance Optimizations (Direct3D 9).
Usage::Dynamic and [Pool::Managed] are incompatible and should not be used together. See [Pool].
Textures can specify Usage::Dynamic. However, managed textures cannot use Usage::Dynamic. For more information about dynamic textures, see Using Dynamic Textures.
Sourcepub const NonSecure: Usage
pub const NonSecure: Usage
Allow a shared surface created by a secure application to be opened by a non-secure application that has the shared handle. Differences between Direct3D 9 and Direct3D 9Ex: This flag is available in Direct3D 9Ex only.
Sourcepub const NPatches: Usage
pub const NPatches: Usage
Set to indicate that the vertex buffer is to be used for drawing N-patches.
Sourcepub const Points: Usage
pub const Points: Usage
Set to indicate that the vertex or index buffer will be used for drawing point sprites. The buffer will be loaded in system memory if software vertex processing is needed to emulate point sprites.
Sourcepub const RenderTarget: Usage
pub const RenderTarget: Usage
The resource will be a render target. Usage::RenderTarget can only be used with [Pool::Default].
Sourcepub const RTPatches: Usage
pub const RTPatches: Usage
Set to indicate that the vertex buffer is to be used for drawing high-order primitives.
Sourcepub const SoftwareProcessing: Usage
pub const SoftwareProcessing: Usage
If this flag is used, vertex processing is done in software. If this flag is not used, vertex processing is done in hardware.
The Usage::SoftwareProcessing flag can be set when mixed-mode or software vertex processing (D3DCREATE_MIXED_VERTEXPROCESSING / D3DCREATE_SOFTWARE_VERTEXPROCESSING) is enabled for that device. Usage::SoftwareProcessing must be set for buffers to be used with software vertex processing in mixed mode, but it should not be set for the best possible performance when using hardware index processing in mixed mode (D3DCREATE_HARDWARE_VERTEXPROCESSING). However, setting Usage::SoftwareProcessing is the only option when a single buffer is used with both hardware and software vertex processing. Usage::SoftwareProcessing is allowed for mixed and software devices.
Usage::SoftwareProcessing is used with CheckDeviceFormat to find out if a particular texture format can be used as a vertex texture during software vertex processing. If it can, the texture must be created in [Pool::Scratch].
Sourcepub const TextAPI: Usage
pub const TextAPI: Usage
This usage flag must be specified for vertex buffers and source surfaces, used in calls to [IDirect3DDevice9ExExt::compose_rects]. Textures created with this usage flag cannot be used for texture filtering. Vertex buffers, created with this usage flag, cannot be used as input stream sources.
Differences between Direct3D 9 and Direct3D 9Ex: This flag is available in Direct3D 9Ex only.
Sourcepub const WriteOnly: Usage
pub const WriteOnly: Usage
Informs the system that the application writes only to the vertex buffer. Using this flag enables the driver to choose the best memory location for efficient write operations and rendering. Attempts to read from a vertex buffer that is created with this capability will fail. Buffers created with [Pool::Default] that do not specify Usage::WriteOnly may suffer a severe performance penalty. Usage::WriteOnly only affects the performance of [Pool::Default] buffers.
Sourcepub const RestrictedContent: Usage
pub const RestrictedContent: Usage
Setting this flag indicates that the resource might contain protected content.
Differences between Direct3D 9 and Direct3D 9Ex: This flag is available in Direct3D 9Ex only.
Setting this flag indicates that access to the shared resource should be restricted.
Differences between Direct3D 9 and Direct3D 9Ex: This flag is available in Direct3D 9Ex only.
Setting this flag indicates that the driver should restrict access to the shared resource. The caller must create an authenticated channel with the driver. The driver should then allow access to processes that attempt to open that shared resource.
Differences between Direct3D 9 and Direct3D 9Ex: This flag is available in Direct3D 9Ex only.
Trait Implementations§
Source§impl BitOrAssign for Usage
impl BitOrAssign for Usage
Source§fn bitor_assign(&mut self, other: Self)
fn bitor_assign(&mut self, other: Self)
|= operation. Read more