|This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.|
Applications can optimize what subset of a texture is copied by specifying dirty regions on textures. Only those regions marked as dirty are copied by a call to IDirect3DMobileDevice::UpdateTexture. However, the dirty regions may be expanded to optimize alignment. When a texture is created, the entire texture is considered dirty. Only the following four operations affect the dirty state of a texture:
- Adding a dirty region to a texture
- Locking some buffer in the texture. This operation adds the
locked region as a dirty region. The application can turn off this
automatic dirty region update if it has better knowledge of the
actual dirty regions.
- Using the texture as a destination in
IDirect3DMobileDevice::CopyRectsmarks the entire texture as
- Using the texture as a source in
UpdateTextureclears all the dirty regions on the source
Dirty regions are set on the top level of a mipmapped texture using IDirect3DMobileTexture::AddDirtyRect. UpdateTexturecan expand the dirty region down the mip chain in order to minimize the number of bytes copied for each sublevel. Note that the sublevel dirty region coordinates are rounded outward, that is, their fractional parts are rounded toward the nearest edge of the texture.
Passing NULL for the pDirtyRectparameters in IDirect3DMobileTexture::AddDirtyRectexpands the dirty region to cover the entire texture.
Applications should use D3DLOCK_NO_DIRTY_UPDATE when further information about the true set of regions changed during a lock operation is available. You should note that a lock or copy to only a sublevel — that is, without locking or copying to the top level — of texture does not update the dirty regions for that texture. Applications assume the same responsibility for updating dirty regions when they lock lower levels without locking the topmost level.