Package icyllis.arc3d.vulkan
Class VulkanDevice
java.lang.Object
icyllis.arc3d.engine.Device
icyllis.arc3d.vulkan.VulkanDevice
- All Implemented Interfaces:
Engine
-
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
ConstructorDescriptionVulkanDevice
(ContextOptions options, VulkanCaps caps, VulkanBackendContext backendContext, VulkanMemoryAllocator memoryAllocator) -
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
checkFence
(long fence) Checks a fence on client side to see if signalled.void
boolean
checkResult
(int result) void
deleteFence
(long fence) Deletes an existing fence that previously returned byDevice.insertFence()
.int
long
Creates a new fence and inserts it into the graphics queue.boolean
static VulkanDevice
make
(VulkanBackendContext context, ContextOptions options) 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) onWrapBackendRenderTarget
(BackendRenderTarget backendRenderTarget) protected GpuRenderTarget
onWrapRenderableBackendTexture
(BackendImage texture, int sampleCount, boolean ownership) org.lwjgl.vulkan.VkDevice
vkDevice()
org.lwjgl.vulkan.VkPhysicalDevice
void
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
-
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
-
checkResult
public boolean checkResult(int result) -
isProtectedContext
public boolean isProtectedContext() -
makeResourceProvider
- Specified by:
makeResourceProvider
in classDevice
-
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 classDevice
-
onWrapRenderableBackendTexture
@Nullable protected GpuRenderTarget onWrapRenderableBackendTexture(BackendImage texture, int sampleCount, boolean ownership) - Specified by:
onWrapRenderableBackendTexture
in classDevice
-
onWrapBackendRenderTarget
- Specified by:
onWrapBackendRenderTarget
in classDevice
-
onGetOpsRenderPass
protected OpsRenderPass onGetOpsRenderPass(ImageProxyView writeView, Rect2i contentBounds, byte colorOps, byte stencilOps, float[] clearColor, Set<SurfaceProxy> sampledTextures, int pipelineFlags) - Specified by:
onGetOpsRenderPass
in classDevice
-
onResolveRenderTarget
protected void onResolveRenderTarget(GpuRenderTarget renderTarget, int resolveLeft, int resolveTop, int resolveRight, int resolveBottom) - Specified by:
onResolveRenderTarget
in classDevice
-
insertFence
public long insertFence()Description copied from class:Device
Creates a new fence and inserts it into the graphics queue. CallsDevice.deleteFence(long)
if the fence is no longer used.- Specified by:
insertFence
in classDevice
- 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 classDevice
- 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 byDevice.insertFence()
.- Specified by:
deleteFence
in classDevice
- Parameters:
fence
- the handle to the fence, cannot be null
-
addFinishedCallback
- Specified by:
addFinishedCallback
in classDevice
-
checkFinishedCallbacks
public void checkFinishedCallbacks()- Specified by:
checkFinishedCallbacks
in classDevice
-
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 classDevice
-