Diligent Engine
 
Loading...
Searching...
No Matches
Diligent::SparseTextureMemoryBindRange Struct Reference

Defines the sparse texture memory binding range. More...

#include <DeviceContext.h>

Public Attributes

Uint32 MipLevel = 0
 Mip level that contains the region to bind.
 
Uint32 ArraySlice = 0
 Texture array slice index.
 
Box Region = {}
 Region in pixels where to bind/unbind memory.
 
Uint64 OffsetInMipTail = 0
 Offset in mip tail in bytes.
 
Uint64 MemorySize = 0
 Size of the memory that will be bound/unbound to this Region.
 
Uint64 MemoryOffset = 0
 Memory range offset in the pMemory.
 
IDeviceMemorypMemory = nullptr
 Pointer to the memory object.
 

Detailed Description

Defines the sparse texture memory binding range.

This structure is used by SparseTextureMemoryBind.

Member Data Documentation

◆ MemoryOffset

Uint64 Diligent::SparseTextureMemoryBindRange::MemoryOffset = 0

Memory range offset in the pMemory.

Must be a multiple of the SparseTextureProperties::BlockSize.

Remarks
Ignored in Metal.

◆ MemorySize

Uint64 Diligent::SparseTextureMemoryBindRange::MemorySize = 0

Size of the memory that will be bound/unbound to this Region.

Memory size must be equal to the number of tiles in Region multiplied by the sparse memory block size. It must be a multiple of the SparseTextureProperties::BlockSize.

Remarks
Ignored in Metal.

◆ MipLevel

Uint32 Diligent::SparseTextureMemoryBindRange::MipLevel = 0

Mip level that contains the region to bind.

Note
If this level is equal to SparseTextureProperties::FirstMipInTail, all subsequent mip levels will also be affected.

◆ OffsetInMipTail

Uint64 Diligent::SparseTextureMemoryBindRange::OffsetInMipTail = 0

Offset in mip tail in bytes.

When mip tail consists of multiple memory blocks, this member defines the starting offset to bind/unbind memory in the tail. If MipLevel is less than SparseTextureProperties::FirstMipInTail, this field is ignored and Region is used.

◆ pMemory

IDeviceMemory* Diligent::SparseTextureMemoryBindRange::pMemory = nullptr

Pointer to the memory object.

If non-null, the memory will be bound to Region; otherwise the memory will be unbound.

Remarks
  • Direct3D11: the entire texture must use a single memory object; when a resource is bound to a new memory object, all previous bindings are invalidated.
  • Vulkan & Direct3D12: different resource regions may be bound to different memory objects.
  • Metal: must be the same memory object that was used to create the sparse texture, see IRenderDeviceMtl::CreateSparseTexture().
  • Vulkan: memory object must be compatible with the resource, use IDeviceMemory::IsCompatible() to ensure that.
Note

◆ Region

Box Diligent::SparseTextureMemoryBindRange::Region = {}

Region in pixels where to bind/unbind memory.

Must be a multiple of SparseTextureProperties::TileSize.

If MipLevel is equal to SparseTextureProperties::FirstMipInTail, this field is ignored and OffsetInMipTail is used instead.

If Region contains multiple tiles, they are bound in the row-major order.