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.StatsNested 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, mStatsFields 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
ConstructorsConstructorDescriptionVulkanDevice(ContextOptions options, VulkanCaps caps, VulkanBackendContext backendContext, VulkanMemoryAllocator memoryAllocator) -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleancheckFence(long fence) Checks a fence on client side to see if signalled.voidbooleancheckResult(int result) voiddeleteFence(long fence) Deletes an existing fence that previously returned byDevice.insertFence().intlongCreates a new fence and inserts it into the graphics queue.booleanstatic @Nullable VulkanDevicemake(@NonNull VulkanBackendContext context, ContextOptions options) makeResourceProvider(Context context, long maxResourceBudget) protected @Nullable GpuRenderTargetonCreateRenderTarget(int width, int height, int sampleCount, int numColorTargets, Image @Nullable [] colorTargets, Image @Nullable [] resolveTargets, int @Nullable [] mipLevels, @Nullable Image depthStencilTarget, int surfaceFlags) protected OpsRenderPassonGetOpsRenderPass(ImageProxyView writeView, Rect2i contentBounds, byte colorOps, byte stencilOps, float[] clearColor, Set<SurfaceProxy> sampledTextures, int pipelineFlags) protected voidonResolveRenderTarget(GpuRenderTarget renderTarget, int resolveLeft, int resolveTop, int resolveRight, int resolveBottom) @Nullable GpuRenderTargetonWrapBackendRenderTarget(BackendRenderTarget backendRenderTarget) protected @Nullable GpuRenderTargetonWrapRenderableBackendTexture(BackendImage texture, int sampleCount, boolean ownership) org.lwjgl.vulkan.VkDevicevkDevice()org.lwjgl.vulkan.VkPhysicalDevicevoidBlocks 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, getGlobalResourceCache, getIndexPool, getInstancePool, getLogger, getMaxSurfaceSampleCount, getOpsRenderPass, getOptions, getRendererProvider, getShaderCodeSource, getShaderCompiler, getStats, getVertexPool, handleDirtyContext, hashCode, isDeviceLost, isDiscarded, 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
public static @Nullable 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:
makeResourceProviderin classDevice
-
onCreateRenderTarget
protected @Nullable GpuRenderTarget onCreateRenderTarget(int width, int height, int sampleCount, int numColorTargets, Image @Nullable [] colorTargets, Image @Nullable [] resolveTargets, int @Nullable [] mipLevels, @Nullable Image depthStencilTarget, int surfaceFlags) - Specified by:
onCreateRenderTargetin classDevice
-
onWrapRenderableBackendTexture
protected @Nullable GpuRenderTarget onWrapRenderableBackendTexture(BackendImage texture, int sampleCount, boolean ownership) - Specified by:
onWrapRenderableBackendTexturein classDevice
-
onWrapBackendRenderTarget
- Specified by:
onWrapBackendRenderTargetin classDevice
-
onGetOpsRenderPass
protected OpsRenderPass onGetOpsRenderPass(ImageProxyView writeView, Rect2i contentBounds, byte colorOps, byte stencilOps, float[] clearColor, Set<SurfaceProxy> sampledTextures, int pipelineFlags) - Specified by:
onGetOpsRenderPassin classDevice
-
onResolveRenderTarget
protected void onResolveRenderTarget(GpuRenderTarget renderTarget, int resolveLeft, int resolveTop, int resolveRight, int resolveBottom) - Specified by:
onResolveRenderTargetin classDevice
-
insertFence
public long insertFence()Description copied from class:DeviceCreates a new fence and inserts it into the graphics queue. CallsDevice.deleteFence(long)if the fence is no longer used.- Specified by:
insertFencein classDevice- Returns:
- the handle to the fence, or null if failed
-
checkFence
public boolean checkFence(long fence) Description copied from class:DeviceChecks a fence on client side to see if signalled. This method returns immediately.- Specified by:
checkFencein classDevice- Parameters:
fence- the handle to the fence- Returns:
- true if signalled, false otherwise
-
deleteFence
public void deleteFence(long fence) Description copied from class:DeviceDeletes an existing fence that previously returned byDevice.insertFence().- Specified by:
deleteFencein classDevice- Parameters:
fence- the handle to the fence, cannot be null
-
addFinishedCallback
- Specified by:
addFinishedCallbackin classDevice
-
checkFinishedCallbacks
public void checkFinishedCallbacks()- Specified by:
checkFinishedCallbacksin classDevice
-
waitForQueue
public void waitForQueue()Description copied from class:DeviceBlocks the current thread and waits for GPU to finish outstanding works.- Specified by:
waitForQueuein classDevice
-