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 toVkAccelerationStructureKHRhandle(s) in native memory.Represents an opaque handle typeVkAccelerationStructureNV.Represents a pointer toVkAccelerationStructureNVhandle(s) in native memory.Represents an opaque handle typeVkBuffer.Represents a pointer toVkBufferhandle(s) in native memory.Represents an opaque handle typeVkBufferCollectionFUCHSIA.Represents a pointer toVkBufferCollectionFUCHSIAhandle(s) in native memory.Represents an opaque handle typeVkBufferView.Represents a pointer toVkBufferViewhandle(s) in native memory.Represents an opaque handle typeVkCommandBuffer.Represents a pointer toVkCommandBufferhandle(s) in native memory.Represents an opaque handle typeVkCommandPool.Represents a pointer toVkCommandPoolhandle(s) in native memory.Represents an opaque handle typeVkCudaFunctionNV.Represents a pointer toVkCudaFunctionNVhandle(s) in native memory.Represents an opaque handle typeVkCudaModuleNV.Represents a pointer toVkCudaModuleNVhandle(s) in native memory.Represents an opaque handle typeVkCuFunctionNVX.Represents a pointer toVkCuFunctionNVXhandle(s) in native memory.Represents an opaque handle typeVkCuModuleNVX.Represents a pointer toVkCuModuleNVXhandle(s) in native memory.Represents an opaque handle typeVkDebugReportCallbackEXT.Represents a pointer toVkDebugReportCallbackEXThandle(s) in native memory.Represents an opaque handle typeVkDebugUtilsMessengerEXT.Represents a pointer toVkDebugUtilsMessengerEXThandle(s) in native memory.Represents an opaque handle typeVkDeferredOperationKHR.Represents a pointer toVkDeferredOperationKHRhandle(s) in native memory.Represents an opaque handle typeVkDescriptorPool.Represents a pointer toVkDescriptorPoolhandle(s) in native memory.Represents an opaque handle typeVkDescriptorSet.Represents a pointer toVkDescriptorSethandle(s) in native memory.Represents an opaque handle typeVkDescriptorSetLayout.Represents a pointer toVkDescriptorSetLayouthandle(s) in native memory.Represents an opaque handle typeVkDescriptorUpdateTemplate.Represents a pointer toVkDescriptorUpdateTemplatehandle(s) in native memory.Represents an opaque handle typeVkDevice.Represents a pointer toVkDevicehandle(s) in native memory.Represents an opaque handle typeVkDeviceMemory.Represents a pointer toVkDeviceMemoryhandle(s) in native memory.Represents an opaque handle typeVkDisplayKHR.Represents a pointer toVkDisplayKHRhandle(s) in native memory.Represents an opaque handle typeVkDisplayModeKHR.Represents a pointer toVkDisplayModeKHRhandle(s) in native memory.Represents an opaque handle typeVkEvent.Represents a pointer toVkEventhandle(s) in native memory.Represents an opaque handle typeVkExternalComputeQueueNV.Represents a pointer toVkExternalComputeQueueNVhandle(s) in native memory.Represents an opaque handle typeVkFence.Represents a pointer toVkFencehandle(s) in native memory.Represents an opaque handle typeVkFramebuffer.Represents a pointer toVkFramebufferhandle(s) in native memory.Represents an opaque handle typeVkImage.Represents a pointer toVkImagehandle(s) in native memory.Represents an opaque handle typeVkImageView.Represents a pointer toVkImageViewhandle(s) in native memory.Represents an opaque handle typeVkIndirectCommandsLayoutEXT.Represents a pointer toVkIndirectCommandsLayoutEXThandle(s) in native memory.Represents an opaque handle typeVkIndirectCommandsLayoutNV.Represents a pointer toVkIndirectCommandsLayoutNVhandle(s) in native memory.Represents an opaque handle typeVkIndirectExecutionSetEXT.Represents a pointer toVkIndirectExecutionSetEXThandle(s) in native memory.Represents an opaque handle typeVkInstance.Represents a pointer toVkInstancehandle(s) in native memory.Represents an opaque handle typeVkMicromapEXT.Represents a pointer toVkMicromapEXThandle(s) in native memory.Represents an opaque handle typeVkOpticalFlowSessionNV.Represents a pointer toVkOpticalFlowSessionNVhandle(s) in native memory.Represents an opaque handle typeVkPerformanceConfigurationINTEL.Represents a pointer toVkPerformanceConfigurationINTELhandle(s) in native memory.Represents an opaque handle typeVkPhysicalDevice.Represents a pointer toVkPhysicalDevicehandle(s) in native memory.Represents an opaque handle typeVkPipeline.Represents a pointer toVkPipelinehandle(s) in native memory.Represents an opaque handle typeVkPipelineBinaryKHR.Represents a pointer toVkPipelineBinaryKHRhandle(s) in native memory.Represents an opaque handle typeVkPipelineCache.Represents a pointer toVkPipelineCachehandle(s) in native memory.Represents an opaque handle typeVkPipelineLayout.Represents a pointer toVkPipelineLayouthandle(s) in native memory.Represents an opaque handle typeVkPrivateDataSlot.Represents a pointer toVkPrivateDataSlothandle(s) in native memory.Represents an opaque handle typeVkQueryPool.Represents a pointer toVkQueryPoolhandle(s) in native memory.Represents an opaque handle typeVkQueue.Represents a pointer toVkQueuehandle(s) in native memory.Represents an opaque handle typeVkRenderPass.Represents a pointer toVkRenderPasshandle(s) in native memory.Represents an opaque handle typeVkSampler.Represents a pointer toVkSamplerhandle(s) in native memory.Represents an opaque handle typeVkSamplerYcbcrConversion.Represents a pointer toVkSamplerYcbcrConversionhandle(s) in native memory.Represents an opaque handle typeVkSemaphore.Represents a pointer toVkSemaphorehandle(s) in native memory.Represents an opaque handle typeVkSemaphoreSciSyncPoolNV.Represents a pointer toVkSemaphoreSciSyncPoolNVhandle(s) in native memory.Represents an opaque handle typeVkShaderEXT.Represents a pointer toVkShaderEXThandle(s) in native memory.Represents an opaque handle typeVkShaderModule.Represents a pointer toVkShaderModulehandle(s) in native memory.Represents an opaque handle typeVkSurfaceKHR.Represents a pointer toVkSurfaceKHRhandle(s) in native memory.Represents an opaque handle typeVkSwapchainKHR.Represents a pointer toVkSwapchainKHRhandle(s) in native memory.Represents an opaque handle typeVkValidationCacheEXT.Represents a pointer toVkValidationCacheEXThandle(s) in native memory.Represents an opaque handle typeVkVideoSessionKHR.Represents a pointer toVkVideoSessionKHRhandle(s) in native memory.Represents an opaque handle typeVkVideoSessionParametersKHR.Represents a pointer toVkVideoSessionParametersKHRhandle(s) in native memory.