Class VkImportMemoryHostPointerInfoEXT
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.vulkan.VkImportMemoryHostPointerInfoEXT
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,org.lwjgl.system.NativeResource
,org.lwjgl.system.Pointer
public class VkImportMemoryHostPointerInfoEXT extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResource
import memory from a host pointer.Description
Importing memory from a host pointer shares ownership of the memory between the host and the Vulkan implementation. The application can continue to access the memory through the host pointer but it is the application's responsibility to synchronize device and non-device access to the underlying memory as defined in Host Access to Device Memory Objects.
Applications can import the same underlying memory into multiple instances of Vulkan and multiple times into a given Vulkan instance. However, implementations may fail to import the same underlying memory multiple times into a given physical device due to platform constraints.
Importing memory from a particular host pointer may not be possible due to additional platform-specific restrictions beyond the scope of this specification in which case the implementation must fail the memory import operation with the error code
ERROR_INVALID_EXTERNAL_HANDLE_KHR
.The application must ensure that the imported memory range remains valid and accessible for the lifetime of the imported memory object.
Valid Usage
- If
handleType
is not 0, it must be supported for import, as reported inVkExternalMemoryProperties
- If
handleType
is not 0, it must beEXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT
orEXTERNAL_MEMORY_HANDLE_TYPE_HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT
pHostPointer
must be a pointer aligned to an integer multiple ofVkPhysicalDeviceExternalMemoryHostPropertiesEXT
::minImportedHostPointerAlignment
- If
handleType
isEXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT
,pHostPointer
must be a pointer toallocationSize
number of bytes of host memory, whereallocationSize
is the member of theVkMemoryAllocateInfo
structure this structure is chained to - If
handleType
isEXTERNAL_MEMORY_HANDLE_TYPE_HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT
,pHostPointer
must be a pointer toallocationSize
number of bytes of host mapped foreign memory, whereallocationSize
is the member of theVkMemoryAllocateInfo
structure this structure is chained to
Valid Usage (Implicit)
sType
must beSTRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT
handleType
must be a validVkExternalMemoryHandleTypeFlagBits
value
Member documentation
sType
– the type of this structure.pNext
–NULL
or a pointer to an extension-specific structure.handleType
– specifies the handle type.pHostPointer
– the host pointer to import from.
Layout
struct VkImportMemoryHostPointerInfoEXT { VkStructureType sType; void const * pNext; VkExternalMemoryHandleTypeFlagBits handleType; void * pHostPointer; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VkImportMemoryHostPointerInfoEXT.Buffer
An array ofVkImportMemoryHostPointerInfoEXT
structs.
-
Field Summary
Fields Modifier and Type Field Description static int
ALIGNOF
The struct alignment in bytes.static int
HANDLETYPE
PHOSTPOINTER
PNEXTThe struct member offsets.static int
SIZEOF
The struct size in bytes.static int
STYPE
The struct member offsets.
-
Constructor Summary
Constructors Constructor Description VkImportMemoryHostPointerInfoEXT(java.nio.ByteBuffer container)
Creates aVkImportMemoryHostPointerInfoEXT
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 VkImportMemoryHostPointerInfoEXT
calloc()
Returns a newVkImportMemoryHostPointerInfoEXT
instance allocated withmemCalloc
.static VkImportMemoryHostPointerInfoEXT.Buffer
calloc(int capacity)
Returns a newVkImportMemoryHostPointerInfoEXT.Buffer
instance allocated withmemCalloc
.static VkImportMemoryHostPointerInfoEXT
callocStack()
Returns a newVkImportMemoryHostPointerInfoEXT
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VkImportMemoryHostPointerInfoEXT.Buffer
callocStack(int capacity)
Returns a newVkImportMemoryHostPointerInfoEXT.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VkImportMemoryHostPointerInfoEXT.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkImportMemoryHostPointerInfoEXT.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VkImportMemoryHostPointerInfoEXT
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkImportMemoryHostPointerInfoEXT
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VkImportMemoryHostPointerInfoEXT
create()
Returns a newVkImportMemoryHostPointerInfoEXT
instance allocated withBufferUtils
.static VkImportMemoryHostPointerInfoEXT.Buffer
create(int capacity)
Returns a newVkImportMemoryHostPointerInfoEXT.Buffer
instance allocated withBufferUtils
.static VkImportMemoryHostPointerInfoEXT
create(long address)
Returns a newVkImportMemoryHostPointerInfoEXT
instance for the specified memory address.static VkImportMemoryHostPointerInfoEXT.Buffer
create(long address, int capacity)
Create aVkImportMemoryHostPointerInfoEXT.Buffer
instance at the specified memory.static VkImportMemoryHostPointerInfoEXT
createSafe(long address)
static VkImportMemoryHostPointerInfoEXT.Buffer
createSafe(long address, int capacity)
int
handleType()
Returns the value of thehandleType
field.VkImportMemoryHostPointerInfoEXT
handleType(int value)
Sets the specified value to thehandleType
field.static VkImportMemoryHostPointerInfoEXT
malloc()
Returns a newVkImportMemoryHostPointerInfoEXT
instance allocated withmemAlloc
.static VkImportMemoryHostPointerInfoEXT.Buffer
malloc(int capacity)
Returns a newVkImportMemoryHostPointerInfoEXT.Buffer
instance allocated withmemAlloc
.static VkImportMemoryHostPointerInfoEXT
mallocStack()
Returns a newVkImportMemoryHostPointerInfoEXT
instance allocated on the thread-localMemoryStack
.static VkImportMemoryHostPointerInfoEXT.Buffer
mallocStack(int capacity)
Returns a newVkImportMemoryHostPointerInfoEXT.Buffer
instance allocated on the thread-localMemoryStack
.static VkImportMemoryHostPointerInfoEXT.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkImportMemoryHostPointerInfoEXT.Buffer
instance allocated on the specifiedMemoryStack
.static VkImportMemoryHostPointerInfoEXT
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkImportMemoryHostPointerInfoEXT
instance allocated on the specifiedMemoryStack
.static int
nhandleType(long struct)
Unsafe version ofhandleType()
.static void
nhandleType(long struct, int value)
Unsafe version ofhandleType
.static long
npHostPointer(long struct)
Unsafe version ofpHostPointer()
.static void
npHostPointer(long struct, long value)
Unsafe version ofpHostPointer
.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
pHostPointer()
Returns the value of thepHostPointer
field.VkImportMemoryHostPointerInfoEXT
pHostPointer(long value)
Sets the specified value to thepHostPointer
field.long
pNext()
Returns the value of thepNext
field.VkImportMemoryHostPointerInfoEXT
pNext(long value)
Sets the specified value to thepNext
field.VkImportMemoryHostPointerInfoEXT
set(int sType, long pNext, int handleType, long pHostPointer)
Initializes this struct with the specified values.VkImportMemoryHostPointerInfoEXT
set(VkImportMemoryHostPointerInfoEXT src)
Copies the specified struct data to this struct.int
sizeof()
int
sType()
Returns the value of thesType
field.VkImportMemoryHostPointerInfoEXT
sType(int value)
Sets the specified value to thesType
field.
-
-
-
Constructor Detail
-
VkImportMemoryHostPointerInfoEXT
public VkImportMemoryHostPointerInfoEXT(java.nio.ByteBuffer container)
Creates aVkImportMemoryHostPointerInfoEXT
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.
-
handleType
public int handleType()
Returns the value of thehandleType
field.
-
pHostPointer
public long pHostPointer()
Returns the value of thepHostPointer
field.
-
sType
public VkImportMemoryHostPointerInfoEXT sType(int value)
Sets the specified value to thesType
field.
-
pNext
public VkImportMemoryHostPointerInfoEXT pNext(long value)
Sets the specified value to thepNext
field.
-
handleType
public VkImportMemoryHostPointerInfoEXT handleType(int value)
Sets the specified value to thehandleType
field.
-
pHostPointer
public VkImportMemoryHostPointerInfoEXT pHostPointer(long value)
Sets the specified value to thepHostPointer
field.
-
set
public VkImportMemoryHostPointerInfoEXT set(int sType, long pNext, int handleType, long pHostPointer)
Initializes this struct with the specified values.
-
set
public VkImportMemoryHostPointerInfoEXT set(VkImportMemoryHostPointerInfoEXT src)
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
public static VkImportMemoryHostPointerInfoEXT malloc()
Returns a newVkImportMemoryHostPointerInfoEXT
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static VkImportMemoryHostPointerInfoEXT calloc()
Returns a newVkImportMemoryHostPointerInfoEXT
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static VkImportMemoryHostPointerInfoEXT create()
Returns a newVkImportMemoryHostPointerInfoEXT
instance allocated withBufferUtils
.
-
create
public static VkImportMemoryHostPointerInfoEXT create(long address)
Returns a newVkImportMemoryHostPointerInfoEXT
instance for the specified memory address.
-
createSafe
@Nullable public static VkImportMemoryHostPointerInfoEXT createSafe(long address)
-
malloc
public static VkImportMemoryHostPointerInfoEXT.Buffer malloc(int capacity)
Returns a newVkImportMemoryHostPointerInfoEXT.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static VkImportMemoryHostPointerInfoEXT.Buffer calloc(int capacity)
Returns a newVkImportMemoryHostPointerInfoEXT.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static VkImportMemoryHostPointerInfoEXT.Buffer create(int capacity)
Returns a newVkImportMemoryHostPointerInfoEXT.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static VkImportMemoryHostPointerInfoEXT.Buffer create(long address, int capacity)
Create aVkImportMemoryHostPointerInfoEXT.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
@Nullable public static VkImportMemoryHostPointerInfoEXT.Buffer createSafe(long address, int capacity)
-
mallocStack
public static VkImportMemoryHostPointerInfoEXT mallocStack()
Returns a newVkImportMemoryHostPointerInfoEXT
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static VkImportMemoryHostPointerInfoEXT callocStack()
Returns a newVkImportMemoryHostPointerInfoEXT
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static VkImportMemoryHostPointerInfoEXT mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkImportMemoryHostPointerInfoEXT
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static VkImportMemoryHostPointerInfoEXT callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkImportMemoryHostPointerInfoEXT
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static VkImportMemoryHostPointerInfoEXT.Buffer mallocStack(int capacity)
Returns a newVkImportMemoryHostPointerInfoEXT.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static VkImportMemoryHostPointerInfoEXT.Buffer callocStack(int capacity)
Returns a newVkImportMemoryHostPointerInfoEXT.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static VkImportMemoryHostPointerInfoEXT.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkImportMemoryHostPointerInfoEXT.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static VkImportMemoryHostPointerInfoEXT.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkImportMemoryHostPointerInfoEXT.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()
.
-
nhandleType
public static int nhandleType(long struct)
Unsafe version ofhandleType()
.
-
npHostPointer
public static long npHostPointer(long struct)
Unsafe version ofpHostPointer()
.
-
nsType
public static void nsType(long struct, int value)
Unsafe version ofsType
.
-
npNext
public static void npNext(long struct, long value)
Unsafe version ofpNext
.
-
nhandleType
public static void nhandleType(long struct, int value)
Unsafe version ofhandleType
.
-
npHostPointer
public static void npHostPointer(long struct, long value)
Unsafe version ofpHostPointer
.
-
-