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.
Description
Section titled “Description”It ships in the dev and demo jars of the backend.
Learn more
Section titled “Learn more”Creation
Section titled “Creation”| Returns | Signature | Summary |
|---|---|---|
SnapshotVulkanHost | create(int width, int height) factory | Creates an instance, a device and a B8G8R8A8_UNORM target image of that size in pixels. |
Methods
Section titled “Methods”Queries
Section titled “Queries”| Returns | Signature | Summary |
|---|---|---|
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. |
Actions
Section titled “Actions”| Returns | Signature | Summary |
|---|---|---|
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. |
Creation details
Section titled “Creation details”create
Section titled “create”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.
Method details
Section titled “Method details”getFrameIndex
Section titled “getFrameIndex”int getFrameIndex()
Returns 0.
getFramesInFlight
Section titled “getFramesInFlight”int getFramesInFlight()
Returns 1.
getTargetView
Section titled “getTargetView”long getTargetView()
Returns the view of the target image.
getTargetImage
Section titled “getTargetImage”long getTargetImage()
Returns the target image.
getQueue
Section titled “getQueue”VkQueue getQueue()
Returns the graphics queue.
getDevice
Section titled “getDevice”VkDevice getDevice()
Returns the logical device.
getTargetWidth
Section titled “getTargetWidth”int getTargetWidth()
Returns the width of the target image, in pixels.
getTargetHeight
Section titled “getTargetHeight”int getTargetHeight()
Returns the height of the target image, in pixels.
getQueueFamilyIndex
Section titled “getQueueFamilyIndex”int getQueueFamilyIndex()
Returns the family of the queue.
getCommandBuffer
Section titled “getCommandBuffer”VkCommandBuffer getCommandBuffer()
Returns the command buffer of the frame.
getPhysicalDevice
Section titled “getPhysicalDevice”VkPhysicalDevice getPhysicalDevice()
Returns the physical device.
getFrameNumber
Section titled “getFrameNumber”long getFrameNumber()
Returns the number of frames begun since the host was created.
isFrameActive
Section titled “isFrameActive”boolean isFrameActive()
If true, a frame is begun and not ended.
getColorFormat
Section titled “getColorFormat”int getColorFormat()
Returns B8G8R8A8_UNORM.
beginFrame
Section titled “beginFrame”this beginFrame() fluent
Waits for the previous frame, starts the command buffer and clears the target image to black.
endFrame
Section titled “endFrame”this endFrame() fluent
Ends the command buffer and submits it; the next beginFrame() waits for it.
destroy
Section titled “destroy”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
