Package org.lwjgl.vulkan
Class VkBindImageMemoryInfo
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.vulkan.VkBindImageMemoryInfo
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,org.lwjgl.system.NativeResource
,org.lwjgl.system.Pointer
- Direct Known Subclasses:
VkBindImageMemoryInfoKHR
public class VkBindImageMemoryInfo extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResource
Structure specifying how to bind an image to memory.Valid Usage
image
must not already be backed by a memory objectimage
must not have been created with any sparse memory binding flagsmemoryOffset
must be less than the size ofmemory
- If the
pNext
chain does not include an instance of theVkBindImagePlaneMemoryInfo
structure,memory
must have been allocated using one of the memory types allowed in thememoryTypeBits
member of theVkMemoryRequirements
structure returned from a call toGetImageMemoryRequirements2
withimage
- If the
pNext
chain does not include an instance of theVkBindImagePlaneMemoryInfo
structure,memoryOffset
must be an integer multiple of thealignment
member of theVkMemoryRequirements
structure returned from a call toGetImageMemoryRequirements2
withimage
- If the
pNext
chain does not include an instance of theVkBindImagePlaneMemoryInfo
structure, the difference of the size ofmemory
andmemoryOffset
must be greater than or equal to thesize
member of theVkMemoryRequirements
structure returned from a call toGetImageMemoryRequirements2
with the sameimage
- If the
pNext
chain includes an instance of theVkBindImagePlaneMemoryInfo
structure,image
must have been created with theIMAGE_CREATE_DISJOINT_BIT
bit set. - If the
pNext
chain includes an instance of theVkBindImagePlaneMemoryInfo
structure,memory
must have been allocated using one of the memory types allowed in thememoryTypeBits
member of theVkMemoryRequirements
structure returned from a call toGetImageMemoryRequirements2
withimage
and the correctplaneAspect
for this plane in theVkImagePlaneMemoryRequirementsInfo
structure attached to theVkImageMemoryRequirementsInfo2
’spNext
chain - If the
pNext
chain includes an instance of theVkBindImagePlaneMemoryInfo
structure,memoryOffset
must be an integer multiple of thealignment
member of theVkMemoryRequirements
structure returned from a call toGetImageMemoryRequirements2
withimage
and the correctplaneAspect
for this plane in theVkImagePlaneMemoryRequirementsInfo
structure attached to theVkImageMemoryRequirementsInfo2
’spNext
chain - If the
pNext
chain includes an instance of theVkBindImagePlaneMemoryInfo
structure, the difference of the size ofmemory
andmemoryOffset
must be greater than or equal to thesize
member of theVkMemoryRequirements
structure returned from a call toGetImageMemoryRequirements2
with the sameimage
and the correctplaneAspect
for this plane in theVkImagePlaneMemoryRequirementsInfo
structure attached to theVkImageMemoryRequirementsInfo2
’spNext
chain - If
image
requires a dedicated allocation (as reported byGetImageMemoryRequirements2
inVkMemoryDedicatedRequirements
::requiresDedicatedAllocation forimage
),memory
must have been created withVkMemoryDedicatedAllocateInfo
::image
equal toimage
andmemoryOffset
must be zero - If the dedicated allocation image aliasing feature is not enabled, and the
VkMemoryAllocateInfo
provided whenmemory
was allocated included an instance ofVkMemoryDedicatedAllocateInfo
in itspNext
chain, andVkMemoryDedicatedAllocateInfo
::image
was notNULL_HANDLE
, thenimage
must equalVkMemoryDedicatedAllocateInfo
::image
andmemoryOffset
must be zero. - If the dedicated allocation image aliasing feature is enabled, and the
VkMemoryAllocateInfo
provided whenmemory
was allocated included an instance ofVkMemoryDedicatedAllocateInfo
in itspNext
chain, andVkMemoryDedicatedAllocateInfo
::image
was notNULL_HANDLE
, thenmemoryOffset
must be zero, andimage
must be either equal toVkMemoryDedicatedAllocateInfo
::image
or an image that was created using the same parameters inVkImageCreateInfo
, with the exception thatextent
andarrayLayers
may differ subject to the following restrictions: every dimension in theextent
parameter of the image being bound must be equal to or smaller than the original image for which the allocation was created; and thearrayLayers
parameter of the image being bound must be equal to or smaller than the original image for which the allocation was created. - If
image
was created withVkDedicatedAllocationImageCreateInfoNV
::dedicatedAllocation
equal toTRUE
,memory
must have been created withVkDedicatedAllocationMemoryAllocateInfoNV
::image
equal toimage
andmemoryOffset
must be zero - If the
pNext
chain includesVkBindImageMemoryDeviceGroupInfo
, all instances ofmemory
specified byVkBindImageMemoryDeviceGroupInfo
::pDeviceIndices
must have been allocated - If the
pNext
chain includesVkBindImageMemoryDeviceGroupInfo
, andVkBindImageMemoryDeviceGroupInfo
::splitInstanceBindRegionCount
is not zero, thenimage
must have been created with theIMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT
bit set - If the
pNext
chain includesVkBindImageMemoryDeviceGroupInfo
, all elements ofVkBindImageMemoryDeviceGroupInfo
::pSplitInstanceBindRegions
must be valid rectangles contained within the dimensions ofimage
- If the
pNext
chain includesVkBindImageMemoryDeviceGroupInfo
, the union of the areas of all elements ofVkBindImageMemoryDeviceGroupInfo
::pSplitInstanceBindRegions
that correspond to the same instance ofimage
must cover the entire image. - If
image
was created with a valid swapchain handle inVkImageSwapchainCreateInfoKHR
::swapchain
, then thepNext
chain must include a valid instance ofVkBindImageMemorySwapchainInfoKHR
containing the same swapchain handle. - If the
pNext
chain includes an instance ofVkBindImageMemorySwapchainInfoKHR
,memory
must beNULL_HANDLE
- If the
pNext
chain does not include an instance ofVkBindImageMemorySwapchainInfoKHR
,memory
must be a validVkDeviceMemory
handle - If the value of
VkExportMemoryAllocateInfo
::handleTypes
used to allocatememory
is not 0, it must include at least one of the handles set inVkExternalMemoryImageCreateInfo
::handleTypes
whenimage
was created - If
memory
was created by a memory import operation, the external handle type of the imported memory must also have been set inVkExternalMemoryImageCreateInfo
::handleTypes
whenimage
was created
Valid Usage (Implicit)
sType
must beSTRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO
- Each
pNext
member of any structure (including this one) in thepNext
chain must be eitherNULL
or a pointer to a valid instance ofVkBindImageMemoryDeviceGroupInfo
,VkBindImageMemorySwapchainInfoKHR
, orVkBindImagePlaneMemoryInfo
- Each
sType
member in thepNext
chain must be unique image
must be a validVkImage
handle- Both of
image
, andmemory
that are valid handles must have been created, allocated, or retrieved from the sameVkDevice
See Also
BindImageMemory2
,BindImageMemory2KHR
Member documentation
sType
– the type of this structure.pNext
–NULL
or a pointer to an extension-specific structure.image
– the image to be attached to memory.memory
– aVkDeviceMemory
object describing the device memory to attach.memoryOffset
– the start offset of the region ofmemory
which is to be bound to the image. The number of bytes returned in theVkMemoryRequirements
::size
member inmemory
, starting frommemoryOffset
bytes, will be bound to the specified image.
Layout
struct VkBindImageMemoryInfo { VkStructureType sType; void const * pNext; VkImage image; VkDeviceMemory memory; VkDeviceSize memoryOffset; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VkBindImageMemoryInfo.Buffer
An array ofVkBindImageMemoryInfo
structs.
-
Constructor Summary
Constructors Constructor Description VkBindImageMemoryInfo(java.nio.ByteBuffer container)
Creates aVkBindImageMemoryInfo
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static VkBindImageMemoryInfo
calloc()
Returns a newVkBindImageMemoryInfo
instance allocated withmemCalloc
.static VkBindImageMemoryInfo.Buffer
calloc(int capacity)
Returns a newVkBindImageMemoryInfo.Buffer
instance allocated withmemCalloc
.static VkBindImageMemoryInfo
callocStack()
Returns a newVkBindImageMemoryInfo
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VkBindImageMemoryInfo.Buffer
callocStack(int capacity)
Returns a newVkBindImageMemoryInfo.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VkBindImageMemoryInfo.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkBindImageMemoryInfo.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VkBindImageMemoryInfo
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkBindImageMemoryInfo
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VkBindImageMemoryInfo
create()
Returns a newVkBindImageMemoryInfo
instance allocated withBufferUtils
.static VkBindImageMemoryInfo.Buffer
create(int capacity)
Returns a newVkBindImageMemoryInfo.Buffer
instance allocated withBufferUtils
.static VkBindImageMemoryInfo
create(long address)
Returns a newVkBindImageMemoryInfo
instance for the specified memory address.static VkBindImageMemoryInfo.Buffer
create(long address, int capacity)
Create aVkBindImageMemoryInfo.Buffer
instance at the specified memory.static VkBindImageMemoryInfo
createSafe(long address)
static VkBindImageMemoryInfo.Buffer
createSafe(long address, int capacity)
long
image()
Returns the value of theimage
field.VkBindImageMemoryInfo
image(long value)
Sets the specified value to theimage
field.static VkBindImageMemoryInfo
malloc()
Returns a newVkBindImageMemoryInfo
instance allocated withmemAlloc
.static VkBindImageMemoryInfo.Buffer
malloc(int capacity)
Returns a newVkBindImageMemoryInfo.Buffer
instance allocated withmemAlloc
.static VkBindImageMemoryInfo
mallocStack()
Returns a newVkBindImageMemoryInfo
instance allocated on the thread-localMemoryStack
.static VkBindImageMemoryInfo.Buffer
mallocStack(int capacity)
Returns a newVkBindImageMemoryInfo.Buffer
instance allocated on the thread-localMemoryStack
.static VkBindImageMemoryInfo.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkBindImageMemoryInfo.Buffer
instance allocated on the specifiedMemoryStack
.static VkBindImageMemoryInfo
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkBindImageMemoryInfo
instance allocated on the specifiedMemoryStack
.long
memory()
Returns the value of thememory
field.VkBindImageMemoryInfo
memory(long value)
Sets the specified value to thememory
field.long
memoryOffset()
Returns the value of thememoryOffset
field.VkBindImageMemoryInfo
memoryOffset(long value)
Sets the specified value to thememoryOffset
field.static long
nimage(long struct)
Unsafe version ofimage()
.static void
nimage(long struct, long value)
Unsafe version ofimage
.static long
nmemory(long struct)
Unsafe version ofmemory()
.static void
nmemory(long struct, long value)
Unsafe version ofmemory
.static long
nmemoryOffset(long struct)
Unsafe version ofmemoryOffset()
.static void
nmemoryOffset(long struct, long value)
Unsafe version ofmemoryOffset
.static long
npNext(long struct)
Unsafe version ofpNext()
.static void
npNext(long struct, long value)
Unsafe version ofpNext
.static int
nsType(long struct)
Unsafe version ofsType()
.static void
nsType(long struct, int value)
Unsafe version ofsType
.long
pNext()
Returns the value of thepNext
field.VkBindImageMemoryInfo
pNext(long value)
Sets the specified value to thepNext
field.VkBindImageMemoryInfo
set(int sType, long pNext, long image, long memory, long memoryOffset)
Initializes this struct with the specified values.VkBindImageMemoryInfo
set(VkBindImageMemoryInfo src)
Copies the specified struct data to this struct.int
sizeof()
int
sType()
Returns the value of thesType
field.VkBindImageMemoryInfo
sType(int value)
Sets the specified value to thesType
field.
-
-
-
Constructor Detail
-
VkBindImageMemoryInfo
public VkBindImageMemoryInfo(java.nio.ByteBuffer container)
Creates aVkBindImageMemoryInfo
instance at the current position of the specifiedByteBuffer
container. 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:
sizeof
in classorg.lwjgl.system.Struct
-
sType
public int sType()
Returns the value of thesType
field.
-
pNext
public long pNext()
Returns the value of thepNext
field.
-
image
public long image()
Returns the value of theimage
field.
-
memory
public long memory()
Returns the value of thememory
field.
-
memoryOffset
public long memoryOffset()
Returns the value of thememoryOffset
field.
-
sType
public VkBindImageMemoryInfo sType(int value)
Sets the specified value to thesType
field.
-
pNext
public VkBindImageMemoryInfo pNext(long value)
Sets the specified value to thepNext
field.
-
image
public VkBindImageMemoryInfo image(long value)
Sets the specified value to theimage
field.
-
memory
public VkBindImageMemoryInfo memory(long value)
Sets the specified value to thememory
field.
-
memoryOffset
public VkBindImageMemoryInfo memoryOffset(long value)
Sets the specified value to thememoryOffset
field.
-
set
public VkBindImageMemoryInfo set(int sType, long pNext, long image, long memory, long memoryOffset)
Initializes this struct with the specified values.
-
set
public VkBindImageMemoryInfo set(VkBindImageMemoryInfo src)
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
public static VkBindImageMemoryInfo malloc()
Returns a newVkBindImageMemoryInfo
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static VkBindImageMemoryInfo calloc()
Returns a newVkBindImageMemoryInfo
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static VkBindImageMemoryInfo create()
Returns a newVkBindImageMemoryInfo
instance allocated withBufferUtils
.
-
create
public static VkBindImageMemoryInfo create(long address)
Returns a newVkBindImageMemoryInfo
instance for the specified memory address.
-
createSafe
@Nullable public static VkBindImageMemoryInfo createSafe(long address)
-
malloc
public static VkBindImageMemoryInfo.Buffer malloc(int capacity)
Returns a newVkBindImageMemoryInfo.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static VkBindImageMemoryInfo.Buffer calloc(int capacity)
Returns a newVkBindImageMemoryInfo.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static VkBindImageMemoryInfo.Buffer create(int capacity)
Returns a newVkBindImageMemoryInfo.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static VkBindImageMemoryInfo.Buffer create(long address, int capacity)
Create aVkBindImageMemoryInfo.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
@Nullable public static VkBindImageMemoryInfo.Buffer createSafe(long address, int capacity)
-
mallocStack
public static VkBindImageMemoryInfo mallocStack()
Returns a newVkBindImageMemoryInfo
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static VkBindImageMemoryInfo callocStack()
Returns a newVkBindImageMemoryInfo
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static VkBindImageMemoryInfo mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkBindImageMemoryInfo
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static VkBindImageMemoryInfo callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkBindImageMemoryInfo
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static VkBindImageMemoryInfo.Buffer mallocStack(int capacity)
Returns a newVkBindImageMemoryInfo.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static VkBindImageMemoryInfo.Buffer callocStack(int capacity)
Returns a newVkBindImageMemoryInfo.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static VkBindImageMemoryInfo.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkBindImageMemoryInfo.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static VkBindImageMemoryInfo.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkBindImageMemoryInfo.Buffer
instance allocated on the specifiedMemoryStack
and 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()
.
-
nimage
public static long nimage(long struct)
Unsafe version ofimage()
.
-
nmemory
public static long nmemory(long struct)
Unsafe version ofmemory()
.
-
nmemoryOffset
public static long nmemoryOffset(long struct)
Unsafe version ofmemoryOffset()
.
-
nsType
public static void nsType(long struct, int value)
Unsafe version ofsType
.
-
npNext
public static void npNext(long struct, long value)
Unsafe version ofpNext
.
-
nimage
public static void nimage(long struct, long value)
Unsafe version ofimage
.
-
nmemory
public static void nmemory(long struct, long value)
Unsafe version ofmemory
.
-
nmemoryOffset
public static void nmemoryOffset(long struct, long value)
Unsafe version ofmemoryOffset
.
-
-