Struct AllocOptions
Structure controlling an allocation of memory
struct AllocOptions
;
Fields
Name | Type | Description |
---|---|---|
flags
|
AllocFlags | Control flags |
memTypeIndexMask
|
uint | mask of memory type indices (0b0101 means indices 0 and 2) that, if not zero, will constrain MemoryRequirement.memTypeMask |
preferredProps
|
MemProps | MemProps bits that are optional but are preferred to be present. Allocation will favor memory types with these bits if available, but may fallback to other memory types. |
requiredProps
|
MemProps | MemProps bits that must be set. Allocation will fail if it can't allocate a memory type satisfies all bits. |
usage
|
MemoryUsage | Intended usage. Will affect preferredBits and requiredBits; |
Properties
Name | Type | Description |
---|---|---|
forUsage [set]
|
AllocOptions | Initializes an AllocOptions with usage |
Methods
Name | Description |
---|---|
withFlags
(flags)
|
set flags to options |
withPreferredProps
(props)
|
set preferredProps to options |
withRequiredBits
(props)
|
set requiredProps to options |
withTypeIndexMask
(indexMask)
|
set type index mask to options |