VulkanRenderBridge
final class VulkanRenderBridge
Extends: RenderBridge
Package: dev.joid.backend.vulkan.render · Module: backend-vulkan · Source: VulkanRenderBridge.java
Backends: Vulkan
The render bridge of Vulkan, which records each JOID frame into the command buffer of the host with the conventions of OpenGL.
Description
Section titled “Description”It needs a device with Vulkan 1.3. A resource deleted during a frame is destroyed once the frames in flight that may still read it are over.
Learn more
Section titled “Learn more”Creation
Section titled “Creation”| Returns | Signature | Summary |
|---|---|---|
| VulkanRenderBridge(IVulkanHost host) | Creates the renderer for the host. |
Methods
Section titled “Methods”Lifecycle
Section titled “Lifecycle”| Returns | Signature | Summary |
|---|---|---|
void | destroy() | Waits for the device and releases every resource of the renderer; VulkanBackend.destroy calls it. |
void | dispose(Runnable destroyer) | Runs the destruction once the frames in flight that may still use the resource are over. |
Queries
Section titled “Queries”| Returns | Signature | Summary |
|---|---|---|
IVulkanHost | getHost() | Returns the Vulkan host. |
VulkanContext | getContext() | Returns the device context of the renderer. |
VulkanPipelineCache | getPipelineCache() | Returns the pipelines of the renderer. |
VulkanDescriptorCache | getDescriptorCache() | Returns the descriptor sets of the renderer. |
Actions
Section titled “Actions”| Returns | Signature | Summary |
|---|---|---|
void | record(Consumer | Records commands into the command buffer of the frame, after ending the current render pass; outside a frame, submits them at once and waits. |
ITexture | createTexture() | Returns an empty VulkanTexture. |
IFrameBuffer | createFrameBuffer(int width, int height) | Returns a VulkanFrameBuffer of that size in pixels. |
IShader | createShader(ShaderSource vertex, ShaderSource fragment, BlendState blend) | Returns a VulkanShader, translated to GLSL 4.50 and compiled to SPIR-V. |
void | suspend(Runnable draw) | Ends the current render pass and runs the drawing, which can record its own commands into the command buffer of the host. |
void | raster(IFrameBuffer target, int width, int height, Runnable draw) | Begins a render pass on the framebuffer with a viewport and a scissor of that size in pixels, and runs the drawing inside it. |
void | releaseHandle(long handle) | Forgets the descriptor sets that use that image view; call it before you destroy a view that a VulkanBorrowedTexture lent. |
Inherited from RenderBridge (14)
getStateDepth · getPixelGrid · getModelView · getProjection · getState · isFrameActive · screen · quantize · pushState · popState · clearDepth · clearStencil · clearColor · draw
Inherited from IRenderBridge (2)
Creation details
Section titled “Creation details”VulkanRenderBridge
Section titled “VulkanRenderBridge”VulkanRenderBridge(IVulkanHost host)
Creates the renderer for the host.
Throws an IllegalArgumentException when the host has no frame in flight, and an IllegalStateException when its device lacks Vulkan 1.3.
Method details
Section titled “Method details”destroy
Section titled “destroy”void destroy()
Waits for the device and releases every resource of the renderer; VulkanBackend.destroy calls it.
dispose
Section titled “dispose”void dispose(Runnable destroyer)
Runs the destruction once the frames in flight that may still use the resource are over.
getHost
Section titled “getHost”IVulkanHost getHost()
Returns the Vulkan host.
getContext
Section titled “getContext”VulkanContext getContext()
Returns the device context of the renderer.
getPipelineCache
Section titled “getPipelineCache”VulkanPipelineCache getPipelineCache()
Returns the pipelines of the renderer.
getDescriptorCache
Section titled “getDescriptorCache”VulkanDescriptorCache getDescriptorCache()
Returns the descriptor sets of the renderer.
record
Section titled “record”void record(Consumer<VkCommandBuffer> recorder)
Records commands into the command buffer of the frame, after ending the current render pass; outside a frame, submits them at once and waits.
createTexture
Section titled “createTexture”ITexture createTexture()
Returns an empty VulkanTexture.
createFrameBuffer
Section titled “createFrameBuffer”IFrameBuffer createFrameBuffer(int width, int height)
Returns a VulkanFrameBuffer of that size in pixels.
createShader
Section titled “createShader”IShader createShader(ShaderSource vertex, ShaderSource fragment, BlendState blend)
Returns a VulkanShader, translated to GLSL 4.50 and compiled to SPIR-V.
suspend
Section titled “suspend”void suspend(Runnable draw)
Ends the current render pass and runs the drawing, which can record its own commands into the command buffer of the host.
raster
Section titled “raster”void raster(IFrameBuffer target, int width, int height, Runnable draw)
Begins a render pass on the framebuffer with a viewport and a scissor of that size in pixels, and runs the drawing inside it.
releaseHandle
Section titled “releaseHandle”void releaseHandle(long handle)
Forgets the descriptor sets that use that image view; call it before you destroy a view that a VulkanBorrowedTexture lent.
fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses
