Resource Properties |
All resources share the following properties, which are specified in enumerations by the same or similar name.
Property | Enumeration | Description |
---|---|---|
Usage | Usage | The way a resource is used, for example, as a texture or a render target. |
Format | Format | The format of the data, for example, the pixel format of a 2-D surface. |
Pool | Pool | The type of memory where the resource is allocated. |
Type | ResourceType | The type of resource, for example, a vertex buffer or render target. |
Resource uses are enforced. An application that will use a resource in a certain operation must specify that operation at resource-creation time.
The RTPatches, NPatches, and Points constants of the Usage enumeration indicate to the driver that the data in these buffers is likely to be used for triangular or grid patches, N-patches, or point sprites, respectively. These flags are provided in case the hardware cannot perform these operations without host processing. Therefore, the driver should typically allocate these surfaces in system memory so that the CPU can access them. If the driver can perform these operations entirely in hardware, it can allocate these surfaces in video or accelerated graphics port (AGP) memory to avoid a host copy and improve performance at least twofold. Note that the information provided by these flags is not absolutely required. A driver can detect that such operations are being performed on the data, and it will move the buffer back to system memory for subsequent frames.
A pool cannot be mixed for different objects contained in a single resource, that is, mip levels in a mipmap, and when a pool is chosen for a resource, the pool cannot be changed.
The resource types are set implicitly at run time when the application calls a resource constructor such as CubeTexture. Applications can query these types at run time; however, it is expected that most scenarios will not require run-time type checking.
Send comments about this topic to Microsoft. © Microsoft Corporation. All rights reserved.
Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center