Package org.lwjgl.vulkan
Class VkImportMemoryFdInfoKHR
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.vulkan.VkImportMemoryFdInfoKHR
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,org.lwjgl.system.NativeResource
,org.lwjgl.system.Pointer
public class VkImportMemoryFdInfoKHR extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResource
import memory created on the same physical device from a file descriptor.Description
Importing memory from a file descriptor transfers ownership of the file descriptor from the application to the Vulkan implementation. The application must not perform any operations on the file descriptor after a successful import.
Applications can import the same underlying memory into multiple instances of Vulkan, into the same instance from which it was exported, and multiple times into a given Vulkan instance. In all cases, each import operation must create a distinct
VkDeviceMemory
object.Valid Usage
- If
handleType
is not 0, it must be supported for import, as reported byVkExternalImageFormatProperties
orVkExternalBufferProperties
. - The memory from which
fd
was exported must have been created on the same underlying physical device asdevice
. - If
handleType
is not 0, it must be defined as a POSIX file descriptor handle. - If
handleType
is not 0,fd
must be a valid handle of the type specified byhandleType
. - The memory represented by
fd
must have been created from a physical device and driver that is compatible withdevice
andhandleType
, as described in External memory handle types compatibility. fd
must obey any requirements listed forhandleType
in external memory handle types compatibility.
Valid Usage (Implicit)
sType
must beSTRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR
- If
handleType
is not 0,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 offd
.fd
– the external handle to import.
Layout
struct VkImportMemoryFdInfoKHR { VkStructureType sType; void const * pNext; VkExternalMemoryHandleTypeFlagBits handleType; int fd; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VkImportMemoryFdInfoKHR.Buffer
An array ofVkImportMemoryFdInfoKHR
structs.
-
Constructor Summary
Constructors Constructor Description VkImportMemoryFdInfoKHR(java.nio.ByteBuffer container)
Creates aVkImportMemoryFdInfoKHR
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 VkImportMemoryFdInfoKHR
calloc()
Returns a newVkImportMemoryFdInfoKHR
instance allocated withmemCalloc
.static VkImportMemoryFdInfoKHR.Buffer
calloc(int capacity)
Returns a newVkImportMemoryFdInfoKHR.Buffer
instance allocated withmemCalloc
.static VkImportMemoryFdInfoKHR
callocStack()
Returns a newVkImportMemoryFdInfoKHR
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VkImportMemoryFdInfoKHR.Buffer
callocStack(int capacity)
Returns a newVkImportMemoryFdInfoKHR.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VkImportMemoryFdInfoKHR.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkImportMemoryFdInfoKHR.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VkImportMemoryFdInfoKHR
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkImportMemoryFdInfoKHR
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VkImportMemoryFdInfoKHR
create()
Returns a newVkImportMemoryFdInfoKHR
instance allocated withBufferUtils
.static VkImportMemoryFdInfoKHR.Buffer
create(int capacity)
Returns a newVkImportMemoryFdInfoKHR.Buffer
instance allocated withBufferUtils
.static VkImportMemoryFdInfoKHR
create(long address)
Returns a newVkImportMemoryFdInfoKHR
instance for the specified memory address.static VkImportMemoryFdInfoKHR.Buffer
create(long address, int capacity)
Create aVkImportMemoryFdInfoKHR.Buffer
instance at the specified memory.static VkImportMemoryFdInfoKHR
createSafe(long address)
static VkImportMemoryFdInfoKHR.Buffer
createSafe(long address, int capacity)
int
fd()
Returns the value of thefd
field.VkImportMemoryFdInfoKHR
fd(int value)
Sets the specified value to thefd
field.int
handleType()
Returns the value of thehandleType
field.VkImportMemoryFdInfoKHR
handleType(int value)
Sets the specified value to thehandleType
field.static VkImportMemoryFdInfoKHR
malloc()
Returns a newVkImportMemoryFdInfoKHR
instance allocated withmemAlloc
.static VkImportMemoryFdInfoKHR.Buffer
malloc(int capacity)
Returns a newVkImportMemoryFdInfoKHR.Buffer
instance allocated withmemAlloc
.static VkImportMemoryFdInfoKHR
mallocStack()
Returns a newVkImportMemoryFdInfoKHR
instance allocated on the thread-localMemoryStack
.static VkImportMemoryFdInfoKHR.Buffer
mallocStack(int capacity)
Returns a newVkImportMemoryFdInfoKHR.Buffer
instance allocated on the thread-localMemoryStack
.static VkImportMemoryFdInfoKHR.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkImportMemoryFdInfoKHR.Buffer
instance allocated on the specifiedMemoryStack
.static VkImportMemoryFdInfoKHR
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkImportMemoryFdInfoKHR
instance allocated on the specifiedMemoryStack
.static int
nfd(long struct)
Unsafe version offd()
.static void
nfd(long struct, int value)
Unsafe version offd
.static int
nhandleType(long struct)
Unsafe version ofhandleType()
.static void
nhandleType(long struct, int value)
Unsafe version ofhandleType
.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.VkImportMemoryFdInfoKHR
pNext(long value)
Sets the specified value to thepNext
field.VkImportMemoryFdInfoKHR
set(int sType, long pNext, int handleType, int fd)
Initializes this struct with the specified values.VkImportMemoryFdInfoKHR
set(VkImportMemoryFdInfoKHR src)
Copies the specified struct data to this struct.int
sizeof()
int
sType()
Returns the value of thesType
field.VkImportMemoryFdInfoKHR
sType(int value)
Sets the specified value to thesType
field.
-
-
-
Constructor Detail
-
VkImportMemoryFdInfoKHR
public VkImportMemoryFdInfoKHR(java.nio.ByteBuffer container)
Creates aVkImportMemoryFdInfoKHR
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.
-
fd
public int fd()
Returns the value of thefd
field.
-
sType
public VkImportMemoryFdInfoKHR sType(int value)
Sets the specified value to thesType
field.
-
pNext
public VkImportMemoryFdInfoKHR pNext(long value)
Sets the specified value to thepNext
field.
-
handleType
public VkImportMemoryFdInfoKHR handleType(int value)
Sets the specified value to thehandleType
field.
-
fd
public VkImportMemoryFdInfoKHR fd(int value)
Sets the specified value to thefd
field.
-
set
public VkImportMemoryFdInfoKHR set(int sType, long pNext, int handleType, int fd)
Initializes this struct with the specified values.
-
set
public VkImportMemoryFdInfoKHR set(VkImportMemoryFdInfoKHR src)
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
public static VkImportMemoryFdInfoKHR malloc()
Returns a newVkImportMemoryFdInfoKHR
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static VkImportMemoryFdInfoKHR calloc()
Returns a newVkImportMemoryFdInfoKHR
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static VkImportMemoryFdInfoKHR create()
Returns a newVkImportMemoryFdInfoKHR
instance allocated withBufferUtils
.
-
create
public static VkImportMemoryFdInfoKHR create(long address)
Returns a newVkImportMemoryFdInfoKHR
instance for the specified memory address.
-
createSafe
@Nullable public static VkImportMemoryFdInfoKHR createSafe(long address)
-
malloc
public static VkImportMemoryFdInfoKHR.Buffer malloc(int capacity)
Returns a newVkImportMemoryFdInfoKHR.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static VkImportMemoryFdInfoKHR.Buffer calloc(int capacity)
Returns a newVkImportMemoryFdInfoKHR.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static VkImportMemoryFdInfoKHR.Buffer create(int capacity)
Returns a newVkImportMemoryFdInfoKHR.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static VkImportMemoryFdInfoKHR.Buffer create(long address, int capacity)
Create aVkImportMemoryFdInfoKHR.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
@Nullable public static VkImportMemoryFdInfoKHR.Buffer createSafe(long address, int capacity)
-
mallocStack
public static VkImportMemoryFdInfoKHR mallocStack()
Returns a newVkImportMemoryFdInfoKHR
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static VkImportMemoryFdInfoKHR callocStack()
Returns a newVkImportMemoryFdInfoKHR
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static VkImportMemoryFdInfoKHR mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkImportMemoryFdInfoKHR
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static VkImportMemoryFdInfoKHR callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkImportMemoryFdInfoKHR
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static VkImportMemoryFdInfoKHR.Buffer mallocStack(int capacity)
Returns a newVkImportMemoryFdInfoKHR.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static VkImportMemoryFdInfoKHR.Buffer callocStack(int capacity)
Returns a newVkImportMemoryFdInfoKHR.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static VkImportMemoryFdInfoKHR.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkImportMemoryFdInfoKHR.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static VkImportMemoryFdInfoKHR.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkImportMemoryFdInfoKHR.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()
.
-
nfd
public static int nfd(long struct)
Unsafe version offd()
.
-
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
.
-
nfd
public static void nfd(long struct, int value)
Unsafe version offd
.
-
-