Skip to content

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.

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.

ReturnsSignatureSummary
VulkanRenderBridge(IVulkanHost host)Creates the renderer for the host.

ReturnsSignatureSummary
voiddestroy()Waits for the device and releases every resource of the renderer; VulkanBackend.destroy calls it.
voiddispose(Runnable destroyer)Runs the destruction once the frames in flight that may still use the resource are over.
ReturnsSignatureSummary
IVulkanHostgetHost()Returns the Vulkan host.
VulkanContextgetContext()Returns the device context of the renderer.
VulkanPipelineCachegetPipelineCache()Returns the pipelines of the renderer.
VulkanDescriptorCachegetDescriptorCache()Returns the descriptor sets of the renderer.
ReturnsSignatureSummary
voidrecord(Consumer 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.
ITexturecreateTexture()Returns an empty VulkanTexture.
IFrameBuffercreateFrameBuffer(int width, int height)Returns a VulkanFrameBuffer of that size in pixels.
IShadercreateShader(ShaderSource vertex, ShaderSource fragment, BlendState blend)Returns a VulkanShader, translated to GLSL 4.50 and compiled to SPIR-V.
voidsuspend(Runnable draw)Ends the current render pass and runs the drawing, which can record its own commands into the command buffer of the host.
voidraster(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.
voidreleaseHandle(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)

canWrap · withState

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.

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.

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.

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.

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.


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

Report a problem with this page