Class VkMemoryDedicatedRequirements
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.vulkan.VkMemoryDedicatedRequirements
-
- All Implemented Interfaces:
java.lang.AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
- Direct Known Subclasses:
VkMemoryDedicatedRequirementsKHR
public class VkMemoryDedicatedRequirements extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResourceStructure describing dedicated allocation requirements of buffer and image resources.Description
When the implementation sets
requiresDedicatedAllocationtoTRUE, it must also setprefersDedicatedAllocationtoTRUE.If the
VkMemoryDedicatedRequirementsstructure is included in thepNextchain of theVkMemoryRequirements2structure passed as thepMemoryRequirementsparameter of avkGetBufferMemoryRequirements2call,requiresDedicatedAllocationmay beTRUEunder one of the following conditions:- The
pNextchain ofVkBufferCreateInfofor the call tovkCreateBufferused to create the buffer being queried contained an instance ofVkExternalMemoryBufferCreateInfo, and any of the handle types specified inVkExternalMemoryBufferCreateInfo::handleTypesrequires dedicated allocation, as reported byGetPhysicalDeviceExternalBufferPropertiesinVkExternalBufferProperties::externalMemoryProperties::externalMemoryFeatures, therequiresDedicatedAllocationfield will be set toTRUE.
In all other cases,
requiresDedicatedAllocationmust be set toFALSEby the implementation whenever aVkMemoryDedicatedRequirementsstructure is included in thepNextchain of theVkMemoryRequirements2structure passed to a call tovkGetBufferMemoryRequirements2.If the
VkMemoryDedicatedRequirementsstructure is included in thepNextchain of theVkMemoryRequirements2structure passed as thepMemoryRequirementsparameter of avkGetBufferMemoryRequirements2call andBUFFER_CREATE_SPARSE_BINDING_BITwas set inVkBufferCreateInfo::flagswhenbufferwas created then the implementation must set bothprefersDedicatedAllocationandrequiresDedicatedAllocationtoFALSE.If the
VkMemoryDedicatedRequirementsstructure is included in thepNextchain of theVkMemoryRequirements2structure passed as thepMemoryRequirementsparameter of avkGetImageMemoryRequirements2call,requiresDedicatedAllocationmay beTRUEunder one of the following conditions:- The
pNextchain ofVkImageCreateInfofor the call tovkCreateImageused to create the image being queried contained an instance ofVkExternalMemoryImageCreateInfo, and any of the handle types specified inVkExternalMemoryImageCreateInfo::handleTypesrequires dedicated allocation, as reported byGetPhysicalDeviceImageFormatProperties2inVkExternalImageFormatProperties::externalMemoryProperties::externalMemoryFeatures, therequiresDedicatedAllocationfield will be set toTRUE.
In all other cases,
requiresDedicatedAllocationmust be set toFALSEby the implementation whenever aVkMemoryDedicatedRequirementsstructure is included in thepNextchain of theVkMemoryRequirements2structure passed to a call tovkGetImageMemoryRequirements2.If the
VkMemoryDedicatedRequirementsstructure is included in thepNextchain of theVkMemoryRequirements2structure passed as thepMemoryRequirementsparameter of avkGetImageMemoryRequirements2call andIMAGE_CREATE_SPARSE_BINDING_BITwas set inVkImageCreateInfo::flagswhenimagewas created then the implementation must set bothprefersDedicatedAllocationandrequiresDedicatedAllocationtoFALSE.Valid Usage (Implicit)
sTypemust beSTRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS
Member documentation
sType– the type of this structure.pNext–NULLor a pointer to an extension-specific structure.prefersDedicatedAllocation– specifies that the implementation would prefer a dedicated allocation for this resource. The application is still free to suballocate the resource but it may get better performance if a dedicated allocation is used.requiresDedicatedAllocation– specifies that a dedicated allocation is required for this resource.
Layout
struct VkMemoryDedicatedRequirements { VkStructureType sType; void * pNext; VkBool32 prefersDedicatedAllocation; VkBool32 requiresDedicatedAllocation; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classVkMemoryDedicatedRequirements.BufferAn array ofVkMemoryDedicatedRequirementsstructs.
-
Field Summary
Fields Modifier and Type Field Description static intALIGNOFThe struct alignment in bytes.static intPNEXT
PREFERSDEDICATEDALLOCATION
REQUIRESDEDICATEDALLOCATIONThe struct member offsets.static intSIZEOFThe struct size in bytes.static intSTYPEThe struct member offsets.
-
Constructor Summary
Constructors Constructor Description VkMemoryDedicatedRequirements(java.nio.ByteBuffer container)Creates aVkMemoryDedicatedRequirementsinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static VkMemoryDedicatedRequirementscalloc()Returns a newVkMemoryDedicatedRequirementsinstance allocated withmemCalloc.static VkMemoryDedicatedRequirements.Buffercalloc(int capacity)Returns a newVkMemoryDedicatedRequirements.Bufferinstance allocated withmemCalloc.static VkMemoryDedicatedRequirementscallocStack()Returns a newVkMemoryDedicatedRequirementsinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static VkMemoryDedicatedRequirements.BuffercallocStack(int capacity)Returns a newVkMemoryDedicatedRequirements.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static VkMemoryDedicatedRequirements.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newVkMemoryDedicatedRequirements.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VkMemoryDedicatedRequirementscallocStack(org.lwjgl.system.MemoryStack stack)Returns a newVkMemoryDedicatedRequirementsinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VkMemoryDedicatedRequirementscreate()Returns a newVkMemoryDedicatedRequirementsinstance allocated withBufferUtils.static VkMemoryDedicatedRequirements.Buffercreate(int capacity)Returns a newVkMemoryDedicatedRequirements.Bufferinstance allocated withBufferUtils.static VkMemoryDedicatedRequirementscreate(long address)Returns a newVkMemoryDedicatedRequirementsinstance for the specified memory address.static VkMemoryDedicatedRequirements.Buffercreate(long address, int capacity)Create aVkMemoryDedicatedRequirements.Bufferinstance at the specified memory.static VkMemoryDedicatedRequirementscreateSafe(long address)static VkMemoryDedicatedRequirements.BuffercreateSafe(long address, int capacity)static VkMemoryDedicatedRequirementsmalloc()Returns a newVkMemoryDedicatedRequirementsinstance allocated withmemAlloc.static VkMemoryDedicatedRequirements.Buffermalloc(int capacity)Returns a newVkMemoryDedicatedRequirements.Bufferinstance allocated withmemAlloc.static VkMemoryDedicatedRequirementsmallocStack()Returns a newVkMemoryDedicatedRequirementsinstance allocated on the thread-localMemoryStack.static VkMemoryDedicatedRequirements.BuffermallocStack(int capacity)Returns a newVkMemoryDedicatedRequirements.Bufferinstance allocated on the thread-localMemoryStack.static VkMemoryDedicatedRequirements.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newVkMemoryDedicatedRequirements.Bufferinstance allocated on the specifiedMemoryStack.static VkMemoryDedicatedRequirementsmallocStack(org.lwjgl.system.MemoryStack stack)Returns a newVkMemoryDedicatedRequirementsinstance allocated on the specifiedMemoryStack.static longnpNext(long struct)Unsafe version ofpNext().static voidnpNext(long struct, long value)Unsafe version ofpNext.static intnprefersDedicatedAllocation(long struct)Unsafe version ofprefersDedicatedAllocation().static intnrequiresDedicatedAllocation(long struct)Unsafe version ofrequiresDedicatedAllocation().static intnsType(long struct)Unsafe version ofsType().static voidnsType(long struct, int value)Unsafe version ofsType.longpNext()Returns the value of thepNextfield.VkMemoryDedicatedRequirementspNext(long value)Sets the specified value to thepNextfield.booleanprefersDedicatedAllocation()Returns the value of theprefersDedicatedAllocationfield.booleanrequiresDedicatedAllocation()Returns the value of therequiresDedicatedAllocationfield.VkMemoryDedicatedRequirementsset(int sType, long pNext)Initializes this struct with the specified values.VkMemoryDedicatedRequirementsset(VkMemoryDedicatedRequirements src)Copies the specified struct data to this struct.intsizeof()intsType()Returns the value of thesTypefield.VkMemoryDedicatedRequirementssType(int value)Sets the specified value to thesTypefield.
-
-
-
Constructor Detail
-
VkMemoryDedicatedRequirements
public VkMemoryDedicatedRequirements(java.nio.ByteBuffer container)
Creates aVkMemoryDedicatedRequirementsinstance at the current position of the specifiedByteBuffercontainer. Changes to the buffer's content will be visible to the struct instance and vice versa.The created instance holds a strong reference to the container object.
-
-
Method Detail
-
sizeof
public int sizeof()
- Specified by:
sizeofin classorg.lwjgl.system.Struct
-
sType
public int sType()
Returns the value of thesTypefield.
-
pNext
public long pNext()
Returns the value of thepNextfield.
-
prefersDedicatedAllocation
public boolean prefersDedicatedAllocation()
Returns the value of theprefersDedicatedAllocationfield.
-
requiresDedicatedAllocation
public boolean requiresDedicatedAllocation()
Returns the value of therequiresDedicatedAllocationfield.
-
sType
public VkMemoryDedicatedRequirements sType(int value)
Sets the specified value to thesTypefield.
-
pNext
public VkMemoryDedicatedRequirements pNext(long value)
Sets the specified value to thepNextfield.
-
set
public VkMemoryDedicatedRequirements set(int sType, long pNext)
Initializes this struct with the specified values.
-
set
public VkMemoryDedicatedRequirements set(VkMemoryDedicatedRequirements src)
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
public static VkMemoryDedicatedRequirements malloc()
Returns a newVkMemoryDedicatedRequirementsinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static VkMemoryDedicatedRequirements calloc()
Returns a newVkMemoryDedicatedRequirementsinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static VkMemoryDedicatedRequirements create()
Returns a newVkMemoryDedicatedRequirementsinstance allocated withBufferUtils.
-
create
public static VkMemoryDedicatedRequirements create(long address)
Returns a newVkMemoryDedicatedRequirementsinstance for the specified memory address.
-
createSafe
@Nullable public static VkMemoryDedicatedRequirements createSafe(long address)
-
malloc
public static VkMemoryDedicatedRequirements.Buffer malloc(int capacity)
Returns a newVkMemoryDedicatedRequirements.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static VkMemoryDedicatedRequirements.Buffer calloc(int capacity)
Returns a newVkMemoryDedicatedRequirements.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static VkMemoryDedicatedRequirements.Buffer create(int capacity)
Returns a newVkMemoryDedicatedRequirements.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static VkMemoryDedicatedRequirements.Buffer create(long address, int capacity)
Create aVkMemoryDedicatedRequirements.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static VkMemoryDedicatedRequirements.Buffer createSafe(long address, int capacity)
-
mallocStack
public static VkMemoryDedicatedRequirements mallocStack()
Returns a newVkMemoryDedicatedRequirementsinstance allocated on the thread-localMemoryStack.
-
callocStack
public static VkMemoryDedicatedRequirements callocStack()
Returns a newVkMemoryDedicatedRequirementsinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.
-
mallocStack
public static VkMemoryDedicatedRequirements mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkMemoryDedicatedRequirementsinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
callocStack
public static VkMemoryDedicatedRequirements callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkMemoryDedicatedRequirementsinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
mallocStack
public static VkMemoryDedicatedRequirements.Buffer mallocStack(int capacity)
Returns a newVkMemoryDedicatedRequirements.Bufferinstance allocated on the thread-localMemoryStack.- Parameters:
capacity- the buffer capacity
-
callocStack
public static VkMemoryDedicatedRequirements.Buffer callocStack(int capacity)
Returns a newVkMemoryDedicatedRequirements.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacity
-
mallocStack
public static VkMemoryDedicatedRequirements.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkMemoryDedicatedRequirements.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
callocStack
public static VkMemoryDedicatedRequirements.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkMemoryDedicatedRequirements.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
nsType
public static int nsType(long struct)
Unsafe version ofsType().
-
npNext
public static long npNext(long struct)
Unsafe version ofpNext().
-
nprefersDedicatedAllocation
public static int nprefersDedicatedAllocation(long struct)
Unsafe version ofprefersDedicatedAllocation().
-
nrequiresDedicatedAllocation
public static int nrequiresDedicatedAllocation(long struct)
Unsafe version ofrequiresDedicatedAllocation().
-
nsType
public static void nsType(long struct, int value)Unsafe version ofsType.
-
npNext
public static void npNext(long struct, long value)Unsafe version ofpNext.
-
-