Bagikan melalui


ResourceUsage Enumeration

Defines options that identify the behavior of a resource.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Syntax

[FlagsAttribute]
public enum ResourceUsage

Members

  Member name Description
AutoGenerateMipMap The resource will automatically generate mipmaps. Automatic generation of mipmaps is not supported for volume textures and depth stencil surfaces/textures.
DoNotClip Indicates that the vertex buffer content will never require clipping.
Dynamic

Indicates 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 Dynamic, the vertex buffer is made static.

Textures can specify Dynamic. However, textures created with ResourceManagementMode.Automatic cannot use Dynamic.

Linear

(XBox 360 only) Linear texture memory format. Linear formats are arranged in memory using a left-to-right and top-to-bottom layout (with pixels contiguous in memory for each row, and rows contiguous except for possible alignment padding). Use a linear format when doing dynamic CPU updates to textures where you do not want the overhead of translating tile addresses using the CPU, the textures will not be referenced often during the frame, and you do not mind less efficient GPU performance.

This flag is only valid when used for texture creation on XBox 360, and will be ignored if utilized elsewhere. On XBox, most formats are created as Tiled if it is applicable.

None None.
Points Indicates 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.
ResolveTarget This texture resource will be used as the destination texture in a call to GraphicsDevice.ResolveBackBuffer.
SoftwareProcessing

If this flag is used, vertex processing is done in software. If this flag is not used, vertex processing is done in hardware.

Tiled

(XBox 360 only) Tiled texture memory format. Tiled formats are arranged using a memory layout designed to maximize the cache coherency of texture fetches and balance the access workload of the memory controllers. The exact pixel arrangement of tiled formats varies based on the bit depth of the format; however, pixels that are close to one another spatially are located close to one another in memory. For example, two pixels adjacent to one another in a vertical column would be separated in memory by an entire row of pixels for a linear format, but could be separated by only a few bytes for a tiled format.

The tiled texture format is usually more efficient than the linear texture format.

This flag is only valid when used for texture creation on XBox 360, and will be ignored if utilized elsewhere. On XBox, most formats are created as Tiled if it is applicable.

WriteOnly 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.

See Also

Reference

ResourceManagementMode Enumeration
RenderState Class
TextureFilter Enumeration
GraphicsAdapter.CheckDeviceFormat Method
GraphicsDevice.SetRenderTarget Method
GraphicsDeviceCapabilities.PrimitiveCaps.SupportsClipTransformedVertices Property
IndexBuffer Constructor
IndexBuffer.ResourceUsage Property
Texture2D Constructor
Texture2D.ResourceUsage Property
Texture3D Constructor
Texture3D.ResourceUsage Property
TextureCreationParameters Constructor
TextureCreationParameters.ResourceUsage Property
TextureCube Constructor
TextureCube.ResourceUsage Property
VertexBuffer Constructor
VertexBuffer.ResourceUsage Property
Microsoft.Xna.Framework.Graphics Namespace

Platforms

Xbox 360, Windows XP SP2, Windows Vista