- java.lang.Object
-
- com.io7m.jcoronado.lwjgl.VulkanLWJGLLogicalDevice
-
- All Implemented Interfaces:
VulkanHandleDispatchableType
,VulkanHandleType
,VulkanLogicalDeviceType
,java.lang.AutoCloseable
public final class VulkanLWJGLLogicalDevice extends java.lang.Object implements VulkanLogicalDeviceType
LWJGLVkDevice
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.io7m.jcoronado.api.VulkanLogicalDeviceType
VulkanLogicalDeviceType.VulkanEventStatus, VulkanLogicalDeviceType.VulkanFenceStatus, VulkanLogicalDeviceType.VulkanPipelineCacheDataResult, VulkanLogicalDeviceType.VulkanWaitStatus
-
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.io7m.jcoronado.api.VulkanHandleType
isClosed
-
Methods inherited from interface com.io7m.jcoronado.api.VulkanLogicalDeviceType
close, createCommandBuffer, createComputePipeline, createComputePipeline, createComputePipeline, createComputePipelines, createComputePipelines, createGraphicsPipeline, createGraphicsPipeline, createGraphicsPipeline, createGraphicsPipelines, createGraphicsPipelines, findEnabledExtension, flushMappedMemoryRange, queue, resetCommandPool, resetDescriptorPool, waitForFence
-
-
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
physicalDevice
public VulkanPhysicalDeviceType physicalDevice()
- Specified by:
physicalDevice
in interfaceVulkanLogicalDeviceType
- Returns:
- The physical device to which this logical device belongs
-
queues
public java.util.List<VulkanQueueType> queues() throws VulkanDestroyedException
- Specified by:
queues
in interfaceVulkanLogicalDeviceType
- Returns:
- The queues present on the logical device
- Throws:
VulkanDestroyedException
-
enabledExtensions
public java.util.Map<java.lang.String,VulkanExtensionType> enabledExtensions() throws VulkanDestroyedException
- Specified by:
enabledExtensions
in interfaceVulkanLogicalDeviceType
- Returns:
- The enabled extensions for the instance
- Throws:
VulkanDestroyedException
-
createShaderModule
public VulkanShaderModuleType createShaderModule(VulkanShaderModuleCreateInfo create_info) throws VulkanException
Description copied from interface:VulkanLogicalDeviceType
Create a shader module.- Specified by:
createShaderModule
in interfaceVulkanLogicalDeviceType
- Parameters:
create_info
- The creation info- Returns:
- A shader module
- Throws:
VulkanException
- On errors
-
createSampler
public VulkanSamplerType createSampler(VulkanSamplerCreateInfo create_info) throws VulkanException
Description copied from interface:VulkanLogicalDeviceType
Create a sampler.- Specified by:
createSampler
in interfaceVulkanLogicalDeviceType
- Parameters:
create_info
- The creation info- Returns:
- A sampler
- Throws:
VulkanException
- On errors
-
createBufferView
public VulkanBufferViewType createBufferView(VulkanBufferViewCreateInfo info) throws VulkanException
Description copied from interface:VulkanLogicalDeviceType
Create an buffer view.- Specified by:
createBufferView
in interfaceVulkanLogicalDeviceType
- Parameters:
info
- The buffer view creation info- Returns:
- An buffer view
- Throws:
VulkanException
- On errors
-
createImageView
public VulkanImageViewType createImageView(VulkanImageViewCreateInfo info) throws VulkanException
Description copied from interface:VulkanLogicalDeviceType
Create an image view.- Specified by:
createImageView
in interfaceVulkanLogicalDeviceType
- Parameters:
info
- The image view creation info- Returns:
- An image view
- Throws:
VulkanException
- On errors
-
flushMappedMemoryRanges
public void flushMappedMemoryRanges(java.util.List<VulkanMappedMemoryRange> ranges) throws VulkanException
Description copied from interface:VulkanLogicalDeviceType
Flush mapped memory ranges.- Specified by:
flushMappedMemoryRanges
in interfaceVulkanLogicalDeviceType
- Parameters:
ranges
- The ranges- Throws:
VulkanException
- On errors
-
createPipelineLayout
public VulkanPipelineLayoutType createPipelineLayout(VulkanPipelineLayoutCreateInfo info) throws VulkanException
Description copied from interface:VulkanLogicalDeviceType
Create a pipeline layout.- Specified by:
createPipelineLayout
in interfaceVulkanLogicalDeviceType
- Parameters:
info
- The pipeline layout creation info- Returns:
- A pipeline layout
- Throws:
VulkanException
- On errors
-
createDescriptorSetLayout
public VulkanDescriptorSetLayoutType createDescriptorSetLayout(VulkanDescriptorSetLayoutCreateInfo info) throws VulkanException
Description copied from interface:VulkanLogicalDeviceType
Create a descriptor set layout.- Specified by:
createDescriptorSetLayout
in interfaceVulkanLogicalDeviceType
- Parameters:
info
- The descriptor set layout creation info- Returns:
- A descriptor set layout
- Throws:
VulkanException
- On errors
-
createDescriptorPool
public VulkanDescriptorPoolType createDescriptorPool(VulkanDescriptorPoolCreateInfo info) throws VulkanException
Description copied from interface:VulkanLogicalDeviceType
Create a descriptor pool.- Specified by:
createDescriptorPool
in interfaceVulkanLogicalDeviceType
- Parameters:
info
- The descriptor pool creation info- Returns:
- A descriptor pool
- Throws:
VulkanException
- On errors
-
allocateDescriptorSets
public java.util.List<VulkanDescriptorSetType> allocateDescriptorSets(VulkanDescriptorSetAllocateInfo info) throws VulkanException
Description copied from interface:VulkanLogicalDeviceType
Allocate descriptor sets.- Specified by:
allocateDescriptorSets
in interfaceVulkanLogicalDeviceType
- Parameters:
info
- The descriptor set allocation info- Returns:
- A list of descriptor sets
- Throws:
VulkanException
- On errors
-
updateDescriptorSets
public void updateDescriptorSets(java.util.List<VulkanWriteDescriptorSet> descriptor_writes, java.util.List<VulkanCopyDescriptorSet> descriptor_copies) throws VulkanException
Description copied from interface:VulkanLogicalDeviceType
Update the contents of a descriptor set object.- Specified by:
updateDescriptorSets
in interfaceVulkanLogicalDeviceType
- 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
public VulkanRenderPassType createRenderPass(VulkanRenderPassCreateInfo render_pass_create_info) throws VulkanException
Description copied from interface:VulkanLogicalDeviceType
Create a render pass.- Specified by:
createRenderPass
in interfaceVulkanLogicalDeviceType
- Parameters:
render_pass_create_info
- The render pass creation info- Returns:
- A render pass
- Throws:
VulkanException
- On errors
-
createPipelineCache
public VulkanPipelineCacheType createPipelineCache(VulkanPipelineCacheCreateInfo create_info) throws VulkanException
Description copied from interface:VulkanLogicalDeviceType
Create a pipeline cache.- Specified by:
createPipelineCache
in interfaceVulkanLogicalDeviceType
- Parameters:
create_info
- The pipeline cache creation info- Returns:
- A pipeline cache
- Throws:
VulkanException
- On errors
-
getPipelineCacheDataSize
public long getPipelineCacheDataSize(VulkanPipelineCacheType pipeline_cache) throws VulkanException
Description copied from interface:VulkanLogicalDeviceType
Retrieve the size of the data store for the pipeline cache.- Specified by:
getPipelineCacheDataSize
in interfaceVulkanLogicalDeviceType
- Parameters:
pipeline_cache
- The pipeline cache- Returns:
- The size of the pipeline cache data
- Throws:
VulkanException
- On errors
-
getImageMemoryRequirements
public VulkanMemoryRequirements getImageMemoryRequirements(VulkanImageType image) throws VulkanException
Description copied from interface:VulkanLogicalDeviceType
Retrieve the memory requirements for the given image.- Specified by:
getImageMemoryRequirements
in interfaceVulkanLogicalDeviceType
- Parameters:
image
- The image- Returns:
- The memory requirements
- Throws:
VulkanException
- On errors
-
getPipelineCacheData
public VulkanLogicalDeviceType.VulkanPipelineCacheDataResult getPipelineCacheData(VulkanPipelineCacheType pipeline_cache, java.nio.ByteBuffer data) throws VulkanException
Description copied from interface:VulkanLogicalDeviceType
Retrieve the data store for the pipeline cache.- Specified by:
getPipelineCacheData
in interfaceVulkanLogicalDeviceType
- 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:
VulkanLogicalDeviceType.getPipelineCacheDataSize(VulkanPipelineCacheType)
-
createGraphicsPipelines
public java.util.List<VulkanPipelineType> createGraphicsPipelines(java.util.Optional<VulkanPipelineCacheType> pipeline_cache, java.util.List<VulkanGraphicsPipelineCreateInfo> pipeline_infos) throws VulkanException
Description copied from interface:VulkanLogicalDeviceType
Create a set of graphics pipelines.- Specified by:
createGraphicsPipelines
in interfaceVulkanLogicalDeviceType
- Parameters:
pipeline_cache
- A pipeline cachepipeline_infos
- The pipeline creation infos- Returns:
- A list of graphics pipelines
- Throws:
VulkanException
- On errors
-
createQueryPool
public VulkanQueryPoolType createQueryPool(VulkanQueryPoolCreateInfo create_info) throws VulkanException
Description copied from interface:VulkanLogicalDeviceType
Create a query pool.- Specified by:
createQueryPool
in interfaceVulkanLogicalDeviceType
- Parameters:
create_info
- The query pool creation info- Returns:
- A query pool
- Throws:
VulkanException
- On errors
-
createFramebuffer
public VulkanFramebufferType createFramebuffer(VulkanFramebufferCreateInfo create_info) throws VulkanException
Description copied from interface:VulkanLogicalDeviceType
Create a framebuffer.- Specified by:
createFramebuffer
in interfaceVulkanLogicalDeviceType
- Parameters:
create_info
- The framebuffer creation info- Returns:
- A pipeline
- Throws:
VulkanException
- On errors
-
createCommandPool
public VulkanCommandPoolType createCommandPool(VulkanCommandPoolCreateInfo create_info) throws VulkanException
Description copied from interface:VulkanLogicalDeviceType
Create a command pool.- Specified by:
createCommandPool
in interfaceVulkanLogicalDeviceType
- Parameters:
create_info
- The pool creation info- Returns:
- A command pool
- Throws:
VulkanException
- On errors
-
createCommandBuffers
public java.util.List<VulkanCommandBufferType> createCommandBuffers(VulkanCommandBufferCreateInfo create_info) throws VulkanException
Description copied from interface:VulkanLogicalDeviceType
Create a command buffer.- Specified by:
createCommandBuffers
in interfaceVulkanLogicalDeviceType
- Parameters:
create_info
- The command buffer creation info- Returns:
- A list of command buffers
- Throws:
VulkanException
- On errors
-
createSemaphore
public VulkanSemaphoreType createSemaphore(VulkanSemaphoreCreateInfo create_info) throws VulkanException
Description copied from interface:VulkanLogicalDeviceType
Create a semaphore.- Specified by:
createSemaphore
in interfaceVulkanLogicalDeviceType
- Parameters:
create_info
- The semaphore creation info- Returns:
- A semaphore
- Throws:
VulkanException
- On errors
-
createFence
public VulkanFenceType createFence(VulkanFenceCreateInfo create_info) throws VulkanException
Description copied from interface:VulkanLogicalDeviceType
Create a fence.- Specified by:
createFence
in interfaceVulkanLogicalDeviceType
- Parameters:
create_info
- The fence creation info- Returns:
- A fence
- Throws:
VulkanException
- On errors
-
createEvent
public VulkanEventType createEvent(VulkanEventCreateInfo create_info) throws VulkanException
Description copied from interface:VulkanLogicalDeviceType
Create an event.- Specified by:
createEvent
in interfaceVulkanLogicalDeviceType
- Parameters:
create_info
- The event creation info- Returns:
- An event
- Throws:
VulkanException
- On errors
-
resetFences
public void resetFences(java.util.List<VulkanFenceType> fences) throws VulkanException
Description copied from interface:VulkanLogicalDeviceType
Reset the given fences.- Specified by:
resetFences
in interfaceVulkanLogicalDeviceType
- Parameters:
fences
- The fences- Throws:
VulkanException
- On errors
-
resetCommandPool
public void resetCommandPool(VulkanCommandPoolType pool, java.util.Set<VulkanCommandPoolResetFlag> flags) throws VulkanException
Description copied from interface:VulkanLogicalDeviceType
Reset the given command pool.- Specified by:
resetCommandPool
in interfaceVulkanLogicalDeviceType
- Parameters:
pool
- The command poolflags
- The reset flags- Throws:
VulkanException
- On errors
-
resetDescriptorPool
public void resetDescriptorPool(VulkanDescriptorPoolType pool, java.util.Set<VulkanDescriptorPoolResetFlag> flags) throws VulkanException
Description copied from interface:VulkanLogicalDeviceType
Reset the given descriptor pool.- Specified by:
resetDescriptorPool
in interfaceVulkanLogicalDeviceType
- Parameters:
pool
- The descriptor poolflags
- The reset flags- Throws:
VulkanException
- On errors
-
waitIdle
public void waitIdle() throws VulkanException
Description copied from interface:VulkanLogicalDeviceType
Wait for this device to become idle.- Specified by:
waitIdle
in interfaceVulkanLogicalDeviceType
- Throws:
VulkanException
- On errors
-
waitForFences
public VulkanLogicalDeviceType.VulkanWaitStatus waitForFences(java.util.List<VulkanFenceType> fences, boolean wait_all, long timeout_nanos) throws VulkanException
Description copied from interface:VulkanLogicalDeviceType
Wait for one or more fences to become signaled.- Specified by:
waitForFences
in interfaceVulkanLogicalDeviceType
- Parameters:
fences
- The fences upon which to waitwait_all
-true
if all fences must become signalled to stop waiting,false
if 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
-
createBuffer
public VulkanBufferType createBuffer(VulkanBufferCreateInfo create_info) throws VulkanException
Description copied from interface:VulkanLogicalDeviceType
Create a buffer.- Specified by:
createBuffer
in interfaceVulkanLogicalDeviceType
- Parameters:
create_info
- The buffer creation info- Returns:
- A buffer
- Throws:
VulkanException
- On errors
-
createImage
public VulkanImageType createImage(VulkanImageCreateInfo create_info) throws VulkanException
Description copied from interface:VulkanLogicalDeviceType
Create an image.- Specified by:
createImage
in interfaceVulkanLogicalDeviceType
- Parameters:
create_info
- The image creation info- Returns:
- A image
- Throws:
VulkanException
- On errors
-
getBufferMemoryRequirements
public VulkanMemoryRequirements getBufferMemoryRequirements(VulkanBufferType buffer) throws VulkanException
Description copied from interface:VulkanLogicalDeviceType
Retrieve the memory requirements for the given buffer.- Specified by:
getBufferMemoryRequirements
in interfaceVulkanLogicalDeviceType
- Parameters:
buffer
- The buffer- Returns:
- The memory requirements
- Throws:
VulkanException
- On errors
-
allocateMemory
public VulkanDeviceMemoryType allocateMemory(VulkanMemoryAllocateInfo info) throws VulkanException
Description copied from interface:VulkanLogicalDeviceType
Allocate device memory.- Specified by:
allocateMemory
in interfaceVulkanLogicalDeviceType
- Parameters:
info
- The allocation info- Returns:
- Allocated memory
- Throws:
VulkanException
- On errors
-
bindBufferMemory
public void bindBufferMemory(VulkanBufferType buffer, VulkanDeviceMemoryType device_memory, long offset) throws VulkanException
Description copied from interface:VulkanLogicalDeviceType
Bind device memory to a buffer object.- Specified by:
bindBufferMemory
in interfaceVulkanLogicalDeviceType
- 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
public void bindImageMemory(VulkanImageType image, VulkanDeviceMemoryType device_memory, long offset) throws VulkanException
Description copied from interface:VulkanLogicalDeviceType
Bind device memory to a image object.- Specified by:
bindImageMemory
in interfaceVulkanLogicalDeviceType
- 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
public VulkanMappedMemoryType mapMemory(VulkanDeviceMemoryType memory, long offset, long size, java.util.Set<VulkanMemoryMapFlag> flags) throws VulkanException
Description copied from interface:VulkanLogicalDeviceType
Map a memory object into the application address space.- Specified by:
mapMemory
in interfaceVulkanLogicalDeviceType
- 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
public void mergePipelineCaches(java.util.List<VulkanPipelineCacheType> caches, VulkanPipelineCacheType output) throws VulkanException
Description copied from interface:VulkanLogicalDeviceType
Combine the data stores of pipeline caches.- Specified by:
mergePipelineCaches
in interfaceVulkanLogicalDeviceType
- Parameters:
caches
- The input cachesoutput
- The output cache- Throws:
VulkanException
- On errors
-
setEvent
public void setEvent(VulkanEventType event) throws VulkanException
Description copied from interface:VulkanLogicalDeviceType
Set an event object to signaled state.- Specified by:
setEvent
in interfaceVulkanLogicalDeviceType
- Parameters:
event
- The event- Throws:
VulkanException
- On errors
-
resetEvent
public void resetEvent(VulkanEventType event) throws VulkanException
Description copied from interface:VulkanLogicalDeviceType
Reset an event object to non-signaled state.- Specified by:
resetEvent
in interfaceVulkanLogicalDeviceType
- Parameters:
event
- The event- Throws:
VulkanException
- On errors
-
getEventStatus
public VulkanLogicalDeviceType.VulkanEventStatus getEventStatus(VulkanEventType event) throws VulkanException
Description copied from interface:VulkanLogicalDeviceType
Retrieve the status of an event object.- Specified by:
getEventStatus
in interfaceVulkanLogicalDeviceType
- Parameters:
event
- The event- Returns:
- The event status
- Throws:
VulkanException
- On errors
-
getFenceStatus
public VulkanLogicalDeviceType.VulkanFenceStatus getFenceStatus(VulkanFenceType fence) throws VulkanException
Description copied from interface:VulkanLogicalDeviceType
Retrieve the status of a fence object.- Specified by:
getFenceStatus
in interfaceVulkanLogicalDeviceType
- Parameters:
fence
- The fence- Returns:
- The fence status
- Throws:
VulkanException
- On errors
-
getImageSubresourceLayout
public VulkanSubresourceLayout getImageSubresourceLayout(VulkanImageType image, VulkanImageSubresource image_subresource) throws VulkanException
Description copied from interface:VulkanLogicalDeviceType
Retrieve information about an image subresource.- Specified by:
getImageSubresourceLayout
in interfaceVulkanLogicalDeviceType
- Parameters:
image
- The imageimage_subresource
- A structure selecting a specific image for the image subresource- Returns:
- The subresource layout
- Throws:
VulkanException
- On errors
-
createComputePipelines
public java.util.List<VulkanPipelineType> createComputePipelines(java.util.Optional<VulkanPipelineCacheType> pipeline_cache, java.util.List<VulkanComputePipelineCreateInfo> pipeline_infos) throws VulkanException
Description copied from interface:VulkanLogicalDeviceType
Create a set of compute pipelines.- Specified by:
createComputePipelines
in interfaceVulkanLogicalDeviceType
- Parameters:
pipeline_cache
- A pipeline cachepipeline_infos
- The pipeline creation infos- Returns:
- A list of compute pipelines
- Throws:
VulkanException
- On errors
-
logger
protected org.slf4j.Logger logger()
-
closeActual
protected void closeActual()
-
hostAllocatorProxy
protected final VulkanLWJGLHostAllocatorProxy hostAllocatorProxy()
-
isClosed
public final boolean isClosed()
- Specified by:
isClosed
in interfaceVulkanHandleType
- Returns:
true
iff the handle has been destroyed withVulkanHandleType.close()
- See Also:
VulkanHandleType.close()
-
close
public final void close()
Description copied from interface:VulkanHandleType
Destroy the object.- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfaceVulkanHandleType
-
checkNotClosed
protected final void checkNotClosed() throws VulkanDestroyedException
- Throws:
VulkanDestroyedException
-
-