Interface VulkanLogicalDeviceType
- All Superinterfaces:
AutoCloseable,VulkanHandleDispatchableType,VulkanHandleType
- All Known Implementing Classes:
VulkanLWJGLLogicalDevice
A reference to a logical Vulkan device.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumThe status of an event.static enumThe status of an event.static enumThe result of fetching data for a pipeline cache.static enumThe result of waiting. -
Method Summary
Modifier and TypeMethodDescriptionAllocate descriptor sets.Allocate device memory.voidbindBufferMemory(VulkanBufferType buffer, VulkanDeviceMemoryType device_memory, long offset) Bind device memory to a buffer object.voidbindImageMemory(VulkanImageType image, VulkanDeviceMemoryType device_memory, long offset) Bind device memory to a image object.voidclose()Destroy the object.createBuffer(VulkanBufferCreateInfo create_info) Create a buffer.Create an buffer view.default VulkanCommandBufferTypeCreate a command buffer.createCommandBuffers(VulkanCommandBufferCreateInfo create_info) Create a command buffer.createCommandPool(VulkanCommandPoolCreateInfo create_info) Create a command pool.default VulkanPipelineTypecreateComputePipeline(VulkanComputePipelineCreateInfo pipeline_info) Create a compute pipeline.default VulkanPipelineTypecreateComputePipeline(VulkanPipelineCacheType cache, VulkanComputePipelineCreateInfo pipeline_info) Create a compute pipeline.default VulkanPipelineTypecreateComputePipeline(Optional<VulkanPipelineCacheType> pipeline_cache, VulkanComputePipelineCreateInfo pipeline_info) Create a compute pipeline.default List<VulkanPipelineType> createComputePipelines(VulkanPipelineCacheType pipeline_cache, List<VulkanComputePipelineCreateInfo> pipeline_infos) Create a set of compute pipelines.default List<VulkanPipelineType> createComputePipelines(List<VulkanComputePipelineCreateInfo> pipeline_infos) Create a set of compute pipelines.createComputePipelines(Optional<VulkanPipelineCacheType> pipeline_cache, List<VulkanComputePipelineCreateInfo> pipeline_infos) Create a set of compute pipelines.Create a descriptor pool.Create a descriptor set layout.createEvent(VulkanEventCreateInfo create_info) Create an event.createFence(VulkanFenceCreateInfo create_info) Create a fence.createFramebuffer(VulkanFramebufferCreateInfo create_info) Create a framebuffer.default VulkanPipelineTypecreateGraphicsPipeline(VulkanGraphicsPipelineCreateInfo pipeline_info) Create a graphics pipeline.default VulkanPipelineTypecreateGraphicsPipeline(VulkanPipelineCacheType cache, VulkanGraphicsPipelineCreateInfo pipeline_info) Create a graphics pipeline.default VulkanPipelineTypecreateGraphicsPipeline(Optional<VulkanPipelineCacheType> pipeline_cache, VulkanGraphicsPipelineCreateInfo pipeline_info) Create a graphics pipeline.default List<VulkanPipelineType> createGraphicsPipelines(VulkanPipelineCacheType pipeline_cache, List<VulkanGraphicsPipelineCreateInfo> pipeline_infos) Create a set of graphics pipelines.default List<VulkanPipelineType> createGraphicsPipelines(List<VulkanGraphicsPipelineCreateInfo> pipeline_infos) Create a set of graphics pipelines.createGraphicsPipelines(Optional<VulkanPipelineCacheType> pipeline_cache, List<VulkanGraphicsPipelineCreateInfo> pipeline_infos) Create a set of graphics pipelines.createImage(VulkanImageCreateInfo create_info) Create an image.Create an image view.createPipelineCache(VulkanPipelineCacheCreateInfo pipeline_info) Create a pipeline cache.Create a pipeline layout.createQueryPool(VulkanQueryPoolCreateInfo create_info) Create a query pool.createRenderPass(VulkanRenderPassCreateInfo render_pass_create_info) Create a render pass.createSampler(VulkanSamplerCreateInfo create_info) Create a sampler.createSemaphore(VulkanSemaphoreCreateInfo create_info) Create a semaphore.createShaderModule(VulkanShaderModuleCreateInfo create_info) Create a shader module.default <T extends VulkanExtensionType>
Optional<T> findEnabledExtension(String name, Class<T> clazz) Find and cast an extension with a given name to the correct API type.default voidFlush mapped memory ranges.voidFlush mapped memory ranges.Retrieve the memory requirements for the given buffer.getEventStatus(VulkanEventType event) Retrieve the status of an event object.getFenceStatus(VulkanFenceType fence) Retrieve the status of a fence object.Retrieve the memory requirements for the given image.getImageSubresourceLayout(VulkanImageType image, VulkanImageSubresource image_subresource) Retrieve information about an image subresource.getPipelineCacheData(VulkanPipelineCacheType pipeline_cache, ByteBuffer data) Retrieve the data store for the pipeline cache.longgetPipelineCacheDataSize(VulkanPipelineCacheType pipeline_cache) Retrieve the size of the data store for the pipeline cache.mapMemory(VulkanDeviceMemoryType memory, long offset, long size, Set<VulkanMemoryMapFlag> flags) Map a memory object into the application address space.voidmergePipelineCaches(List<VulkanPipelineCacheType> caches, VulkanPipelineCacheType output) Combine the data stores of pipeline caches.default Optional<VulkanQueueType> queue(VulkanQueueFamilyIndex queueFamily, VulkanQueueIndex queueIndex) Find the queue with the given queue family and index.queues()default voidReset the given command pool.voidresetCommandPool(VulkanCommandPoolType pool, Set<VulkanCommandPoolResetFlag> flags) Reset the given command pool.default voidReset the given descriptor pool.voidReset the given descriptor pool.voidresetEvent(VulkanEventType event) Reset an event object to non-signaled state.voidresetFences(List<VulkanFenceType> fences) Reset the given fences.voidsetEvent(VulkanEventType event) Set an event object to signaled state.voidupdateDescriptorSets(List<VulkanWriteDescriptorSet> descriptor_writes, List<VulkanCopyDescriptorSet> descriptor_copies) Update the contents of a descriptor set object.waitForFence(VulkanFenceType fence, long timeout_nanos) Wait for a fence to become signaled.waitForFences(List<VulkanFenceType> fences, boolean wait_all, long timeout_nanos) Wait for one or more fences to become signaled.voidwaitIdle()Wait for this device to become idle.Methods inherited from interface com.io7m.jcoronado.api.VulkanHandleType
isClosed
-
Method Details
-
debugging
VulkanDebuggingType debugging()- Returns:
- A reference to a possibly no-op debugging interface
-
close
Description copied from interface:VulkanHandleTypeDestroy the object.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceVulkanHandleType- Throws:
VulkanException- On errors
-
physicalDevice
VulkanPhysicalDeviceType physicalDevice()- Returns:
- The physical device to which this logical device belongs
-
queues
- Returns:
- The queues present on the logical device
- Throws:
VulkanException- On errors
-
queue
default Optional<VulkanQueueType> queue(VulkanQueueFamilyIndex queueFamily, VulkanQueueIndex queueIndex) throws VulkanException Find the queue with the given queue family and index.- Parameters:
queueFamily- The queue familyqueueIndex- The queue index- Returns:
- The matching queue, if any
- Throws:
VulkanException- On errors
-
enabledExtensions
- Returns:
- The enabled extensions for the instance
- Throws:
VulkanException- On errors
-
createShaderModule
VulkanShaderModuleType createShaderModule(VulkanShaderModuleCreateInfo create_info) throws VulkanException Create a shader module.- Parameters:
create_info- The creation info- Returns:
- A shader module
- Throws:
VulkanException- On errors
-
createSampler
Create a sampler.- Parameters:
create_info- The creation info- Returns:
- A sampler
- Throws:
VulkanException- On errors
-
createBufferView
Create an buffer view.- Parameters:
info- The buffer view creation info- Returns:
- An buffer view
- Throws:
VulkanException- On errors
-
createImageView
Create an image view.- Parameters:
info- The image view creation info- Returns:
- An image view
- Throws:
VulkanException- On errors
-
findEnabledExtension
default <T extends VulkanExtensionType> Optional<T> findEnabledExtension(String name, Class<T> clazz) throws VulkanException Find and cast an extension with a given name to the correct API type.- Type Parameters:
T- The precise type- Parameters:
name- The extension nameclazz- The intended extension type- Returns:
- The extension with the correct type, or nothing if the extension either did not exist or did not have the right type
- Throws:
VulkanException- On errors
-
flushMappedMemoryRanges
Flush mapped memory ranges.- Parameters:
ranges- The ranges- Throws:
VulkanException- On errors
-
flushMappedMemoryRange
Flush mapped memory ranges.- Parameters:
range- The range- Throws:
VulkanException- On errors
-
createPipelineLayout
VulkanPipelineLayoutType createPipelineLayout(VulkanPipelineLayoutCreateInfo info) throws VulkanException Create a pipeline layout.- Parameters:
info- The pipeline layout creation info- Returns:
- A pipeline layout
- Throws:
VulkanException- On errors
-
createDescriptorSetLayout
VulkanDescriptorSetLayoutType createDescriptorSetLayout(VulkanDescriptorSetLayoutCreateInfo info) throws VulkanException Create a descriptor set layout.- Parameters:
info- The descriptor set layout creation info- Returns:
- A descriptor set layout
- Throws:
VulkanException- On errors
-
createDescriptorPool
VulkanDescriptorPoolType createDescriptorPool(VulkanDescriptorPoolCreateInfo info) throws VulkanException Create a descriptor pool.- Parameters:
info- The descriptor pool creation info- Returns:
- A descriptor pool
- Throws:
VulkanException- On errors
-
allocateDescriptorSets
List<VulkanDescriptorSetType> allocateDescriptorSets(VulkanDescriptorSetAllocateInfo info) throws VulkanException Allocate descriptor sets.- Parameters:
info- The descriptor set allocation info- Returns:
- A list of descriptor sets
- Throws:
VulkanException- On errors
-
updateDescriptorSets
void updateDescriptorSets(List<VulkanWriteDescriptorSet> descriptor_writes, List<VulkanCopyDescriptorSet> descriptor_copies) throws VulkanException Update the contents of a descriptor set object.- Parameters:
descriptor_writes- An array of VulkanWriteDescriptorSet structures describing the descriptor sets to write todescriptor_copies- An array of VulkanCopyDescriptorSet structures describing the descriptor sets to copy between.- Throws:
VulkanException- On errors
-
createRenderPass
VulkanRenderPassType createRenderPass(VulkanRenderPassCreateInfo render_pass_create_info) throws VulkanException Create a render pass.- Parameters:
render_pass_create_info- The render pass creation info- Returns:
- A render pass
- Throws:
VulkanException- On errors
-
createGraphicsPipeline
default VulkanPipelineType createGraphicsPipeline(VulkanGraphicsPipelineCreateInfo pipeline_info) throws VulkanException Create a graphics pipeline.- Parameters:
pipeline_info- The pipeline creation info- Returns:
- A graphics pipeline
- Throws:
VulkanException- On errors
-
createGraphicsPipeline
default VulkanPipelineType createGraphicsPipeline(VulkanPipelineCacheType cache, VulkanGraphicsPipelineCreateInfo pipeline_info) throws VulkanException Create a graphics pipeline.- Parameters:
cache- A pipeline cachepipeline_info- The pipeline creation info- Returns:
- A graphics pipeline
- Throws:
VulkanException- On errors
-
createGraphicsPipeline
default VulkanPipelineType createGraphicsPipeline(Optional<VulkanPipelineCacheType> pipeline_cache, VulkanGraphicsPipelineCreateInfo pipeline_info) throws VulkanException Create a graphics pipeline.- Parameters:
pipeline_cache- A pipeline cachepipeline_info- The pipeline creation info- Returns:
- A graphics pipeline
- Throws:
VulkanException- On errors
-
createPipelineCache
VulkanPipelineCacheType createPipelineCache(VulkanPipelineCacheCreateInfo pipeline_info) throws VulkanException Create a pipeline cache.- Parameters:
pipeline_info- The pipeline cache creation info- Returns:
- A pipeline cache
- Throws:
VulkanException- On errors
-
getPipelineCacheDataSize
Retrieve the size of the data store for the pipeline cache.- Parameters:
pipeline_cache- The pipeline cache- Returns:
- The size of the pipeline cache data
- Throws:
VulkanException- On errors
-
getImageMemoryRequirements
Retrieve the memory requirements for the given image.- Parameters:
image- The image- Returns:
- The memory requirements
- Throws:
VulkanException- On errors
-
getPipelineCacheData
VulkanLogicalDeviceType.VulkanPipelineCacheDataResult getPipelineCacheData(VulkanPipelineCacheType pipeline_cache, ByteBuffer data) throws VulkanException Retrieve the data store for the pipeline cache.- Parameters:
pipeline_cache- The pipeline cachedata- The buffer used to store the data- Returns:
- A value indicating the result of the retrieval
- Throws:
VulkanException- On errors- See Also:
-
createGraphicsPipelines
List<VulkanPipelineType> createGraphicsPipelines(Optional<VulkanPipelineCacheType> pipeline_cache, List<VulkanGraphicsPipelineCreateInfo> pipeline_infos) throws VulkanException Create a set of graphics pipelines.- Parameters:
pipeline_cache- A pipeline cachepipeline_infos- The pipeline creation infos- Returns:
- A list of graphics pipelines
- Throws:
VulkanException- On errors
-
createGraphicsPipelines
default List<VulkanPipelineType> createGraphicsPipelines(VulkanPipelineCacheType pipeline_cache, List<VulkanGraphicsPipelineCreateInfo> pipeline_infos) throws VulkanException Create a set of graphics pipelines.- Parameters:
pipeline_cache- A pipeline cachepipeline_infos- The pipeline creation infos- Returns:
- A list of graphics pipelines
- Throws:
VulkanException- On errors
-
createGraphicsPipelines
default List<VulkanPipelineType> createGraphicsPipelines(List<VulkanGraphicsPipelineCreateInfo> pipeline_infos) throws VulkanException Create a set of graphics pipelines.- Parameters:
pipeline_infos- The pipeline creation infos- Returns:
- A list of graphics pipelines
- Throws:
VulkanException- On errors
-
createQueryPool
Create a query pool.- Parameters:
create_info- The query pool creation info- Returns:
- A query pool
- Throws:
VulkanException- On errors
-
createFramebuffer
VulkanFramebufferType createFramebuffer(VulkanFramebufferCreateInfo create_info) throws VulkanException Create a framebuffer.- Parameters:
create_info- The framebuffer creation info- Returns:
- A pipeline
- Throws:
VulkanException- On errors
-
createCommandPool
VulkanCommandPoolType createCommandPool(VulkanCommandPoolCreateInfo create_info) throws VulkanException Create a command pool.- Parameters:
create_info- The pool creation info- Returns:
- A command pool
- Throws:
VulkanException- On errors
-
createCommandBuffers
List<VulkanCommandBufferType> createCommandBuffers(VulkanCommandBufferCreateInfo create_info) throws VulkanException Create a command buffer.- Parameters:
create_info- The command buffer creation info- Returns:
- A list of command buffers
- Throws:
VulkanException- On errors
-
createCommandBuffer
default VulkanCommandBufferType createCommandBuffer(VulkanCommandPoolType pool, VulkanCommandBufferLevel level) throws VulkanException Create a command buffer.- Parameters:
pool- The command buffer poollevel- The command buffer level- Returns:
- A command buffer
- Throws:
VulkanException- On errors
-
createSemaphore
Create a semaphore.- Parameters:
create_info- The semaphore creation info- Returns:
- A semaphore
- Throws:
VulkanException- On errors
-
createFence
Create a fence.- Parameters:
create_info- The fence creation info- Returns:
- A fence
- Throws:
VulkanException- On errors
-
createEvent
Create an event.- Parameters:
create_info- The event creation info- Returns:
- An event
- Throws:
VulkanException- On errors
-
resetFences
Reset the given fences.- Parameters:
fences- The fences- Throws:
VulkanException- On errors
-
resetCommandPool
void resetCommandPool(VulkanCommandPoolType pool, Set<VulkanCommandPoolResetFlag> flags) throws VulkanException Reset the given command pool.- Parameters:
pool- The command poolflags- The reset flags- Throws:
VulkanException- On errors
-
resetCommandPool
Reset the given command pool.- Parameters:
pool- The command pool- Throws:
VulkanException- On errors
-
resetDescriptorPool
void resetDescriptorPool(VulkanDescriptorPoolType pool, Set<VulkanDescriptorPoolResetFlag> flags) throws VulkanException Reset the given descriptor pool.- Parameters:
pool- The descriptor poolflags- The reset flags- Throws:
VulkanException- On errors
-
resetDescriptorPool
Reset the given descriptor pool.- Parameters:
pool- The descriptor pool- Throws:
VulkanException- On errors
-
waitIdle
Wait for this device to become idle.- Throws:
VulkanException- On errors
-
waitForFences
VulkanLogicalDeviceType.VulkanWaitStatus waitForFences(List<VulkanFenceType> fences, boolean wait_all, long timeout_nanos) throws VulkanException Wait for one or more fences to become signaled.- Parameters:
fences- The fences upon which to waitwait_all-trueif all fences must become signalled to stop waiting,falseif any fence can become signalledtimeout_nanos- The timeout period in units of nanoseconds.- Returns:
- A value indicating whether waiting succeeded or timed out
- Throws:
VulkanException- On errors
-
waitForFence
default VulkanLogicalDeviceType.VulkanWaitStatus waitForFence(VulkanFenceType fence, long timeout_nanos) throws VulkanException Wait for a fence to become signaled.- Parameters:
fence- The fences upon which to waittimeout_nanos- The timeout period in units of nanoseconds.- Returns:
- A value indicating whether waiting succeeded or timed out
- Throws:
VulkanException- On errors
-
createBuffer
Create a buffer.- Parameters:
create_info- The buffer creation info- Returns:
- A buffer
- Throws:
VulkanException- On errors
-
createImage
Create an image.- Parameters:
create_info- The image creation info- Returns:
- A image
- Throws:
VulkanException- On errors
-
getBufferMemoryRequirements
VulkanMemoryRequirements getBufferMemoryRequirements(VulkanBufferType buffer) throws VulkanException Retrieve the memory requirements for the given buffer.- Parameters:
buffer- The buffer- Returns:
- The memory requirements
- Throws:
VulkanException- On errors
-
allocateMemory
Allocate device memory.- Parameters:
info- The allocation info- Returns:
- Allocated memory
- Throws:
VulkanException- On errors
-
bindBufferMemory
void bindBufferMemory(VulkanBufferType buffer, VulkanDeviceMemoryType device_memory, long offset) throws VulkanException Bind device memory to a buffer object.- Parameters:
buffer- The logical device that owns the buffer and memorydevice_memory- The device memory to attachoffset- The start offset of the region of memory which is to be bound to the buffer. The number of bytes returned in the VkMemoryRequirements::size member in memory, starting from memoryOffset bytes, will be bound to the specified buffer.- Throws:
VulkanException- On errors
-
bindImageMemory
void bindImageMemory(VulkanImageType image, VulkanDeviceMemoryType device_memory, long offset) throws VulkanException Bind device memory to a image object.- Parameters:
image- The logical device that owns the image and memorydevice_memory- The device memory to attachoffset- The start offset of the region of memory which is to be bound to the image. The number of bytes returned in the VkMemoryRequirements::size member in memory, starting from memoryOffset bytes, will be bound to the specified image.- Throws:
VulkanException- On errors
-
mapMemory
VulkanMappedMemoryType mapMemory(VulkanDeviceMemoryType memory, long offset, long size, Set<VulkanMemoryMapFlag> flags) throws VulkanException Map a memory object into the application address space.- Parameters:
memory- The device memory object to be mappedoffset- A zero-based byte offset from the beginning of the memory objectsize- The size of the memory range to map, or VK_WHOLE_SIZE to map from offset to the end of the allocationflags- The flags- Returns:
- Mapped memory
- Throws:
VulkanException- On errors
-
mergePipelineCaches
void mergePipelineCaches(List<VulkanPipelineCacheType> caches, VulkanPipelineCacheType output) throws VulkanException Combine the data stores of pipeline caches.- Parameters:
caches- The input cachesoutput- The output cache- Throws:
VulkanException- On errors
-
setEvent
Set an event object to signaled state.- Parameters:
event- The event- Throws:
VulkanException- On errors
-
resetEvent
Reset an event object to non-signaled state.- Parameters:
event- The event- Throws:
VulkanException- On errors
-
getEventStatus
VulkanLogicalDeviceType.VulkanEventStatus getEventStatus(VulkanEventType event) throws VulkanException Retrieve the status of an event object.- Parameters:
event- The event- Returns:
- The event status
- Throws:
VulkanException- On errors
-
getFenceStatus
VulkanLogicalDeviceType.VulkanFenceStatus getFenceStatus(VulkanFenceType fence) throws VulkanException Retrieve the status of a fence object.- Parameters:
fence- The fence- Returns:
- The fence status
- Throws:
VulkanException- On errors
-
getImageSubresourceLayout
VulkanSubresourceLayout getImageSubresourceLayout(VulkanImageType image, VulkanImageSubresource image_subresource) throws VulkanException Retrieve information about an image subresource.- Parameters:
image- The imageimage_subresource- A structure selecting a specific image for the image subresource- Returns:
- The subresource layout
- Throws:
VulkanException- On errors
-
createComputePipeline
default VulkanPipelineType createComputePipeline(VulkanComputePipelineCreateInfo pipeline_info) throws VulkanException Create a compute pipeline.- Parameters:
pipeline_info- The pipeline creation info- Returns:
- A compute pipeline
- Throws:
VulkanException- On errors
-
createComputePipeline
default VulkanPipelineType createComputePipeline(VulkanPipelineCacheType cache, VulkanComputePipelineCreateInfo pipeline_info) throws VulkanException Create a compute pipeline.- Parameters:
cache- A pipeline cachepipeline_info- The pipeline creation info- Returns:
- A compute pipeline
- Throws:
VulkanException- On errors
-
createComputePipeline
default VulkanPipelineType createComputePipeline(Optional<VulkanPipelineCacheType> pipeline_cache, VulkanComputePipelineCreateInfo pipeline_info) throws VulkanException Create a compute pipeline.- Parameters:
pipeline_cache- A pipeline cachepipeline_info- The pipeline creation info- Returns:
- A compute pipeline
- Throws:
VulkanException- On errors
-
createComputePipelines
List<VulkanPipelineType> createComputePipelines(Optional<VulkanPipelineCacheType> pipeline_cache, List<VulkanComputePipelineCreateInfo> pipeline_infos) throws VulkanException Create a set of compute pipelines.- Parameters:
pipeline_cache- A pipeline cachepipeline_infos- The pipeline creation infos- Returns:
- A list of compute pipelines
- Throws:
VulkanException- On errors
-
createComputePipelines
default List<VulkanPipelineType> createComputePipelines(VulkanPipelineCacheType pipeline_cache, List<VulkanComputePipelineCreateInfo> pipeline_infos) throws VulkanException Create a set of compute pipelines.- Parameters:
pipeline_cache- A pipeline cachepipeline_infos- The pipeline creation infos- Returns:
- A list of compute pipelines
- Throws:
VulkanException- On errors
-
createComputePipelines
default List<VulkanPipelineType> createComputePipelines(List<VulkanComputePipelineCreateInfo> pipeline_infos) throws VulkanException Create a set of compute pipelines.- Parameters:
pipeline_infos- The pipeline creation infos- Returns:
- A list of compute pipelines
- Throws:
VulkanException- On errors
-