Package icyllis.arc3d.vulkan

# Class VulkanDevice

java.lang.Object
icyllis.arc3d.engine.Device
icyllis.arc3d.vulkan.VulkanDevice

All Implemented Interfaces:
  `Engine`

public class VulkanDevice extends Device

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class icyllis.arc3d.engine.Device

  `Device.Stats`

  ## Nested classes/interfaces inherited from interface icyllis.arc3d.engine.Engine

  `Engine.BackendApi, Engine.BudgetType, Engine.BufferUsageFlags, Engine.DepthStencilFlags, Engine.GLBackendState, Engine.ImageCreateFlags, Engine.ImageType, Engine.IndexType, Engine.IOType, Engine.LoadOp, Engine.LoadStoreOps, Engine.PrimitiveType, Engine.ShaderFlags, Engine.StoreOp, Engine.SurfaceOrigin, Engine.VertexAttribType`

- ## Field Summary

  ### Fields inherited from class icyllis.arc3d.engine.Device

  `mCaps, mCompiler, mDeviceIsLost, mOutOfMemoryEncountered, mStats`

  ### Fields inherited from interface icyllis.arc3d.engine.Engine

  `CLAMP_TYPE_AUTO, CLAMP_TYPE_MANUAL, CLAMP_TYPE_NONE, COLOR_ENCODING_FLOAT, COLOR_ENCODING_UNORM, COLOR_ENCODING_UNORM_PACK16, COLOR_ENCODING_UNORM_PACK32, COLOR_ENCODING_UNORM_SRGB, INVALID_RESOURCE_HANDLE, LAST_MASK_FORMAT, MASK_FORMAT_A565, MASK_FORMAT_A8, MASK_FORMAT_ARGB, MASK_FORMAT_COUNT, Ownership_Borrowed, Ownership_Owned`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `VulkanDevice(ContextOptions options, VulkanCaps caps, VulkanBackendContext backendContext, VulkanMemoryAllocator memoryAllocator)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addFinishedCallback(FlushInfo.FinishedCallback callback)`
  `boolean`
  `checkFence(long fence)`
  Checks a fence on client side to see if signalled.
  `void`
  `checkFinishedCallbacks()`
  `boolean`
  `checkResult(int result)`
  `void`
  `deleteFence(long fence)`
  Deletes an existing fence that previously returned by `Device.insertFence()`.
  `VulkanMemoryAllocator`
  `getMemoryAllocator()`
  `int`
  `getQueueIndex()`
  `long`
  `insertFence()`
  Creates a new fence and inserts it into the graphics queue.
  `boolean`
  `isProtectedContext()`
  `static VulkanDevice`
  `make(VulkanBackendContext context, ContextOptions options)`
  `ResourceProvider`
  `makeResourceProvider(Context context, long maxResourceBudget)`
  `protected GpuRenderTarget`
  `onCreateRenderTarget(int width, int height, int sampleCount, int numColorTargets, Image[] colorTargets, Image[] resolveTargets, int[] mipLevels, Image depthStencilTarget, int surfaceFlags)`
  `protected OpsRenderPass`
  `onGetOpsRenderPass(ImageProxyView writeView, Rect2i contentBounds, byte colorOps, byte stencilOps, float[] clearColor, Set<SurfaceProxy> sampledTextures, int pipelineFlags)`
  `protected void`
  `onResolveRenderTarget(GpuRenderTarget renderTarget, int resolveLeft, int resolveTop, int resolveRight, int resolveBottom)`
  `GpuRenderTarget`
  `onWrapBackendRenderTarget(BackendRenderTarget backendRenderTarget)`
  `protected GpuRenderTarget`
  `onWrapRenderableBackendTexture(BackendImage texture, int sampleCount, boolean ownership)`
  `org.lwjgl.vulkan.VkDevice`
  `vkDevice()`
  `org.lwjgl.vulkan.VkPhysicalDevice`
  `vkPhysicalDevice()`
  `void`
  `waitForQueue()`
  Blocks the current thread and waits for GPU to finish outstanding works.

  ### Methods inherited from class icyllis.arc3d.engine.Device

  `checkOutOfMemory, createRenderTarget, disconnect, freeGpuResources, getBackend, getCaps, getCompressedBackendFormat, getContextID, getDefaultBackendFormat, getExecutingThread, getIndexPool, getInstancePool, getLogger, getMaxSurfaceSampleCount, getOpsRenderPass, getOptions, getRendererProvider, getShaderCodeSource, getShaderCompiler, getSharedResourceCache, getStats, getVertexPool, handleDirtyContext, hashCode, isDeviceLost, isOnExecutingThread, isValid, markContextDirty, onResetContext, onWrapGLDefaultFramebuffer, purgeResourcesNotUsedSince, resolveRenderTarget, wrapBackendRenderTarget, wrapGLDefaultFramebuffer, wrapRenderableBackendTexture`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### VulkanDevice

    public VulkanDevice(ContextOptions options, VulkanCaps caps, VulkanBackendContext backendContext, VulkanMemoryAllocator memoryAllocator)

- ## Method Details

  - ### make

    @Nullable public static VulkanDevice make(@Nonnull VulkanBackendContext context, ContextOptions options)

  - ### vkDevice

    public org.lwjgl.vulkan.VkDevice vkDevice()

  - ### vkPhysicalDevice

    public org.lwjgl.vulkan.VkPhysicalDevice vkPhysicalDevice()

  - ### getQueueIndex

    public int getQueueIndex()

  - ### getMemoryAllocator

    public VulkanMemoryAllocator getMemoryAllocator()

  - ### checkResult

    public boolean checkResult(int result)

  - ### isProtectedContext

    public boolean isProtectedContext()

  - ### makeResourceProvider

    public ResourceProvider makeResourceProvider(Context context, long maxResourceBudget)
    Specified by:
      `makeResourceProvider` in class `Device`

  - ### onCreateRenderTarget

    @Nullable protected GpuRenderTarget onCreateRenderTarget(int width, int height, int sampleCount, int numColorTargets, @Nullable Image[] colorTargets, @Nullable Image[] resolveTargets, @Nullable int[] mipLevels, @Nullable Image depthStencilTarget, int surfaceFlags)
    Specified by:
      `onCreateRenderTarget` in class `Device`

  - ### onWrapRenderableBackendTexture

    @Nullable protected GpuRenderTarget onWrapRenderableBackendTexture(BackendImage texture, int sampleCount, boolean ownership)
    Specified by:
      `onWrapRenderableBackendTexture` in class `Device`

  - ### onWrapBackendRenderTarget

    @Nullable public GpuRenderTarget onWrapBackendRenderTarget(BackendRenderTarget backendRenderTarget)
    Specified by:
      `onWrapBackendRenderTarget` in class `Device`

  - ### onGetOpsRenderPass

    protected OpsRenderPass onGetOpsRenderPass(ImageProxyView writeView, Rect2i contentBounds, byte colorOps, byte stencilOps, float[] clearColor, Set<SurfaceProxy> sampledTextures, int pipelineFlags)
    Specified by:
      `onGetOpsRenderPass` in class `Device`

  - ### onResolveRenderTarget

    protected void onResolveRenderTarget(GpuRenderTarget renderTarget, int resolveLeft, int resolveTop, int resolveRight, int resolveBottom)
    Specified by:
      `onResolveRenderTarget` in class `Device`

  - ### insertFence

    public long insertFence()
    Description copied from class: `Device`
    Creates a new fence and inserts it into the graphics queue. Calls `Device.deleteFence(long)` if the fence is no longer used.
    Specified by:
      `insertFence` in class `Device`
    Returns:
      the handle to the fence, or null if failed

  - ### checkFence

    public boolean checkFence(long fence)
    Description copied from class: `Device`
    Checks a fence on client side to see if signalled. This method returns immediately.
    Specified by:
      `checkFence` in class `Device`
    Parameters:
      `fence` - the handle to the fence
    Returns:
      true if signalled, false otherwise

  - ### deleteFence

    public void deleteFence(long fence)
    Description copied from class: `Device`
    Deletes an existing fence that previously returned by `Device.insertFence()`.
    Specified by:
      `deleteFence` in class `Device`
    Parameters:
      `fence` - the handle to the fence, cannot be null

  - ### addFinishedCallback

    public void addFinishedCallback(FlushInfo.FinishedCallback callback)
    Specified by:
      `addFinishedCallback` in class `Device`

  - ### checkFinishedCallbacks

    public void checkFinishedCallbacks()
    Specified by:
      `checkFinishedCallbacks` in class `Device`

  - ### waitForQueue

    public void waitForQueue()
    Description copied from class: `Device`
    Blocks the current thread and waits for GPU to finish outstanding works.
    Specified by:
      `waitForQueue` in class `Device`