Skip to content

SnapshotVulkanHost

final class SnapshotVulkanHost
Implements: IVulkanHost
Package: dev.joid.backend.vulkan.snapshot · Module: backend-vulkan · Source: SnapshotVulkanHost.java
Backends: Vulkan

The Vulkan host of the snapshot tests: no surface, one offscreen target image and one frame in flight.

It ships in the dev and demo jars of the backend.

ReturnsSignatureSummary
SnapshotVulkanHostcreate(int width, int height) factoryCreates an instance, a device and a B8G8R8A8_UNORM target image of that size in pixels.

ReturnsSignatureSummary
intgetFrameIndex()Returns 0.
intgetFramesInFlight()Returns 1.
longgetTargetView()Returns the view of the target image.
longgetTargetImage()Returns the target image.
VkQueuegetQueue()Returns the graphics queue.
VkDevicegetDevice()Returns the logical device.
intgetTargetWidth()Returns the width of the target image, in pixels.
intgetTargetHeight()Returns the height of the target image, in pixels.
intgetQueueFamilyIndex()Returns the family of the queue.
VkCommandBuffergetCommandBuffer()Returns the command buffer of the frame.
VkPhysicalDevicegetPhysicalDevice()Returns the physical device.
longgetFrameNumber()Returns the number of frames begun since the host was created.
booleanisFrameActive()If true, a frame is begun and not ended.
intgetColorFormat()Returns B8G8R8A8_UNORM.
ReturnsSignatureSummary
thisbeginFrame() fluentWaits for the previous frame, starts the command buffer and clears the target image to black.
thisendFrame() fluentEnds the command buffer and submits it; the next beginFrame() waits for it.
voiddestroy()Waits for the device and destroys the target, the device and the instance.

SnapshotVulkanHost create(int width, int height) factory

Creates an instance, a device and a B8G8R8A8_UNORM target image of that size in pixels. Throws an IllegalStateException when no Vulkan 1.3 device can draw.

int getFrameIndex()

Returns 0.

int getFramesInFlight()

Returns 1.

long getTargetView()

Returns the view of the target image.

long getTargetImage()

Returns the target image.

VkQueue getQueue()

Returns the graphics queue.

VkDevice getDevice()

Returns the logical device.

int getTargetWidth()

Returns the width of the target image, in pixels.

int getTargetHeight()

Returns the height of the target image, in pixels.

int getQueueFamilyIndex()

Returns the family of the queue.

VkCommandBuffer getCommandBuffer()

Returns the command buffer of the frame.

VkPhysicalDevice getPhysicalDevice()

Returns the physical device.

long getFrameNumber()

Returns the number of frames begun since the host was created.

boolean isFrameActive()

If true, a frame is begun and not ended.

int getColorFormat()

Returns B8G8R8A8_UNORM.

this beginFrame() fluent

Waits for the previous frame, starts the command buffer and clears the target image to black.

this endFrame() fluent

Ends the command buffer and submits it; the next beginFrame() waits for it.

void destroy()

Waits for the device and destroys the target, the device and the instance.


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