Package club.doki7.vulkan.handle
Opaque handle types of Vulkan API.
Quick start
An opaque handle is usually defined in native languages like such:
typedef struct OpaqueStruct *OpaqueHandle;
In vulkan4j
ecosystem, opaque handles are represented with a Java record type containing
a single MemorySegment
field. That segment is basically
the opaque handle itself You may think that it is pointing to a hypothetical
OpaqueStruct
structure.
Handles themselves cannot be allocated, because the layout of the memory block it points to is completely unknown: C APIs use opaque handles intentionally to hide these details. There are two common C API designs:
OpaqueHandle obtainOpaqueHandle(void);
and
void obtainOpaqueHandles(OpaqueHandle *pHandle, int capacity);
In order to handle the second case, and to handle the cases you need to pass an array of handles to C APIs:
void useOpaqueHandles(OpaqueHandle const* pHandles, int count);
All the handle types defined have a Ptr
subclass, which is a pointer to the handle
type.
NULL
handles
vulkan4j
ecosystem represents a NULL
handle with a null
Java reference
of that handle type, instead of a handle instance containing a null
or
MemorySegment.NULL
. We made this choice because it is always easier to analyse whether
a Java reference is null
or not: there have been many tools (JSR305 for example) to
help you with that. See the documentation of
IPointer#segment()
for more details.
-
Record ClassesClassDescriptionRepresents an opaque handle type
VkAccelerationStructureKHR
.Represents a pointer toVkAccelerationStructureKHR
handle(s) in native memory.Represents an opaque handle typeVkAccelerationStructureNV
.Represents a pointer toVkAccelerationStructureNV
handle(s) in native memory.Represents an opaque handle typeVkBuffer
.Represents a pointer toVkBuffer
handle(s) in native memory.Represents an opaque handle typeVkBufferCollectionFUCHSIA
.Represents a pointer toVkBufferCollectionFUCHSIA
handle(s) in native memory.Represents an opaque handle typeVkBufferView
.Represents a pointer toVkBufferView
handle(s) in native memory.Represents an opaque handle typeVkCommandBuffer
.Represents a pointer toVkCommandBuffer
handle(s) in native memory.Represents an opaque handle typeVkCommandPool
.Represents a pointer toVkCommandPool
handle(s) in native memory.Represents an opaque handle typeVkCudaFunctionNV
.Represents a pointer toVkCudaFunctionNV
handle(s) in native memory.Represents an opaque handle typeVkCudaModuleNV
.Represents a pointer toVkCudaModuleNV
handle(s) in native memory.Represents an opaque handle typeVkCuFunctionNVX
.Represents a pointer toVkCuFunctionNVX
handle(s) in native memory.Represents an opaque handle typeVkCuModuleNVX
.Represents a pointer toVkCuModuleNVX
handle(s) in native memory.Represents an opaque handle typeVkDebugReportCallbackEXT
.Represents a pointer toVkDebugReportCallbackEXT
handle(s) in native memory.Represents an opaque handle typeVkDebugUtilsMessengerEXT
.Represents a pointer toVkDebugUtilsMessengerEXT
handle(s) in native memory.Represents an opaque handle typeVkDeferredOperationKHR
.Represents a pointer toVkDeferredOperationKHR
handle(s) in native memory.Represents an opaque handle typeVkDescriptorPool
.Represents a pointer toVkDescriptorPool
handle(s) in native memory.Represents an opaque handle typeVkDescriptorSet
.Represents a pointer toVkDescriptorSet
handle(s) in native memory.Represents an opaque handle typeVkDescriptorSetLayout
.Represents a pointer toVkDescriptorSetLayout
handle(s) in native memory.Represents an opaque handle typeVkDescriptorUpdateTemplate
.Represents a pointer toVkDescriptorUpdateTemplate
handle(s) in native memory.Represents an opaque handle typeVkDevice
.Represents a pointer toVkDevice
handle(s) in native memory.Represents an opaque handle typeVkDeviceMemory
.Represents a pointer toVkDeviceMemory
handle(s) in native memory.Represents an opaque handle typeVkDisplayKHR
.Represents a pointer toVkDisplayKHR
handle(s) in native memory.Represents an opaque handle typeVkDisplayModeKHR
.Represents a pointer toVkDisplayModeKHR
handle(s) in native memory.Represents an opaque handle typeVkEvent
.Represents a pointer toVkEvent
handle(s) in native memory.Represents an opaque handle typeVkExternalComputeQueueNV
.Represents a pointer toVkExternalComputeQueueNV
handle(s) in native memory.Represents an opaque handle typeVkFence
.Represents a pointer toVkFence
handle(s) in native memory.Represents an opaque handle typeVkFramebuffer
.Represents a pointer toVkFramebuffer
handle(s) in native memory.Represents an opaque handle typeVkImage
.Represents a pointer toVkImage
handle(s) in native memory.Represents an opaque handle typeVkImageView
.Represents a pointer toVkImageView
handle(s) in native memory.Represents an opaque handle typeVkIndirectCommandsLayoutEXT
.Represents a pointer toVkIndirectCommandsLayoutEXT
handle(s) in native memory.Represents an opaque handle typeVkIndirectCommandsLayoutNV
.Represents a pointer toVkIndirectCommandsLayoutNV
handle(s) in native memory.Represents an opaque handle typeVkIndirectExecutionSetEXT
.Represents a pointer toVkIndirectExecutionSetEXT
handle(s) in native memory.Represents an opaque handle typeVkInstance
.Represents a pointer toVkInstance
handle(s) in native memory.Represents an opaque handle typeVkMicromapEXT
.Represents a pointer toVkMicromapEXT
handle(s) in native memory.Represents an opaque handle typeVkOpticalFlowSessionNV
.Represents a pointer toVkOpticalFlowSessionNV
handle(s) in native memory.Represents an opaque handle typeVkPerformanceConfigurationINTEL
.Represents a pointer toVkPerformanceConfigurationINTEL
handle(s) in native memory.Represents an opaque handle typeVkPhysicalDevice
.Represents a pointer toVkPhysicalDevice
handle(s) in native memory.Represents an opaque handle typeVkPipeline
.Represents a pointer toVkPipeline
handle(s) in native memory.Represents an opaque handle typeVkPipelineBinaryKHR
.Represents a pointer toVkPipelineBinaryKHR
handle(s) in native memory.Represents an opaque handle typeVkPipelineCache
.Represents a pointer toVkPipelineCache
handle(s) in native memory.Represents an opaque handle typeVkPipelineLayout
.Represents a pointer toVkPipelineLayout
handle(s) in native memory.Represents an opaque handle typeVkPrivateDataSlot
.Represents a pointer toVkPrivateDataSlot
handle(s) in native memory.Represents an opaque handle typeVkQueryPool
.Represents a pointer toVkQueryPool
handle(s) in native memory.Represents an opaque handle typeVkQueue
.Represents a pointer toVkQueue
handle(s) in native memory.Represents an opaque handle typeVkRenderPass
.Represents a pointer toVkRenderPass
handle(s) in native memory.Represents an opaque handle typeVkSampler
.Represents a pointer toVkSampler
handle(s) in native memory.Represents an opaque handle typeVkSamplerYcbcrConversion
.Represents a pointer toVkSamplerYcbcrConversion
handle(s) in native memory.Represents an opaque handle typeVkSemaphore
.Represents a pointer toVkSemaphore
handle(s) in native memory.Represents an opaque handle typeVkSemaphoreSciSyncPoolNV
.Represents a pointer toVkSemaphoreSciSyncPoolNV
handle(s) in native memory.Represents an opaque handle typeVkShaderEXT
.Represents a pointer toVkShaderEXT
handle(s) in native memory.Represents an opaque handle typeVkShaderModule
.Represents a pointer toVkShaderModule
handle(s) in native memory.Represents an opaque handle typeVkSurfaceKHR
.Represents a pointer toVkSurfaceKHR
handle(s) in native memory.Represents an opaque handle typeVkSwapchainKHR
.Represents a pointer toVkSwapchainKHR
handle(s) in native memory.Represents an opaque handle typeVkValidationCacheEXT
.Represents a pointer toVkValidationCacheEXT
handle(s) in native memory.Represents an opaque handle typeVkVideoSessionKHR
.Represents a pointer toVkVideoSessionKHR
handle(s) in native memory.Represents an opaque handle typeVkVideoSessionParametersKHR
.Represents a pointer toVkVideoSessionParametersKHR
handle(s) in native memory.