CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::VKDevice Class Referencefinal

#include <CeresEngine/RenderAPI/Vulkan/VKDevice.hpp>

Inheritance diagram for CeresEngine::VKDevice:
CeresEngine::GPUDevice CeresEngine::VKObject< VKDevice, GPUDevice > CeresEngine::GPUObject CeresEngine::VKObjectBase

Public Member Functions

 VKDevice (VKRenderAPI &renderer, const GPUDeviceDescriptor &descriptor, VkPhysicalDevice physicalDevice)
 
 ~VKDevice () final
 
 operator VkDevice () const noexcept
 The Vulkan device object.
 
GPUCommandBufferPtr createCommandBuffer (const GPUCommandBufferDescriptor &descriptor) final
 
GPURenderPassPtr createRenderPass (const GPURenderPassDescriptor &descriptor) final
 
GPUPipelineLayoutPtr createPipelineLayout (const GPUPipelineLayoutDescriptor &descriptor) final
 
GPUGraphicsPipelinePtr createGraphicsPipeline (const GPUGraphicsPipelineDescriptor &descriptor) final
 
GPUComputePipelinePtr createComputePipeline (const GPUComputePipelineDescriptor &descriptor) final
 
GPUShaderPtr createShader (const GPUShaderDescriptor &descriptor) final
 
GPUShaderProgramPtr createShaderProgram (const GPUShaderProgramDescriptor &descriptor) final
 
GPURenderTargetPtr createRenderTarget (const GPURenderTargetDescriptor &descriptor) final
 
GPUBufferPtr createBuffer (const GPUBufferDescriptor &descriptor) final
 
GPUImagePtr createImage (const GPUImageDescriptor &descriptor) final
 
GPUSamplerPtr createSampler (const GPUSamplerDescriptor &descriptor) final
 
GPUFencePtr createFence (const GPUFenceDescriptor &descriptor) final
 
GPUTimerQueryPtr createTimerQuery (const GPUTimerQueryDescriptor &descriptor) final
 
GPUOcclusionQueryPtr createOcclusionQuery (const GPUOcclusionQueryDescriptor &descriptor) final
 
GPUSwapchainPtr createSwapchain (const GPUSwapchainDescriptor &descriptor) final
 
GPUCommandQueuePtr getGraphicsQueue () final
 
GPUCommandQueuePtr getTransferQueue () final
 
GPUCommandQueuePtr getComputeQueue () final
 
void update ()
 
void wait ()
 
void didSubmitCommandBuffer (VKCommandBuffer &commandBuffer)
 
GPUBufferPtr getDummyBuffer () const
 Returns a dummy Buffer object.
 
GPUImagePtr getDummyImage () const
 Returns a dummy Image object.
 
GPUSamplerPtr getDummySampler () const
 Returns a dummy Sampler object.
 
VKMemoryAllocatorgetMemoryAllocator () const
 
VKRenderAPIgetRenderer ()
 
VkPhysicalDevice getPhysicalDevice ()
 
VkPipelineCache getPipelineCache () const
 
const VkPhysicalDevicePropertiesgetPhysicalDeviceProperties () const
 
const Vector< VkQueueFamilyProperties > & getQueueFamilyProperties () const
 
UInt32 findMemoryType (UInt32 typeFilter, VkMemoryPropertyFlags properties)
 Finds a suitable memory type.
 
- Public Member Functions inherited from CeresEngine::GPUDevice
 GPUDevice (ExecutionContext &transferExecutionContext, const GPUDeviceInfo &information, const GPURenderingCapabilities &capabilities)
 Creates a new Device instance.
 
 ~GPUDevice () override=default
 Destroys the device object.
 
 GPUDevice (const GPUDevice &)=delete
 Deleted copy constructor.
 
GPUDeviceoperator= (const GPUDevice &)=delete
 
 GPUDevice (GPUDevice &&)=delete
 Deleted move constructor.
 
GPUDeviceoperator= (GPUDevice &&)=delete
 
virtual Async< GPUBufferPtrcreateBufferAsync (const GPUBufferDescriptor &descriptor)
 Creates a new Buffer object asynchronously.
 
virtual Async< GPUImagePtrcreateImageAsync (const GPUImageDescriptor &descriptor)
 Creates a new Image object asynchronously.
 
- Public Member Functions inherited from CeresEngine::GPUObject
 GPUObject ()=default
 
virtual ~GPUObject ()=default
 
 GPUObject (const GPUObject &)=delete
 
GPUObjectoperator= (const GPUObject &)=delete
 
 GPUObject (GPUObject &&)=delete
 
GPUObjectoperator= (GPUObject &&)=delete
 
void retain () noexcept
 Retains the object by increment it's reference count by one.
 
bool release () noexcept
 Releases the object by decrementing it's reference count by one.
 

Static Public Member Functions

static VkPhysicalDevice pickPhysicalDevice (VkInstance instance, const DevicePickerFunc &picker)
 Picks a suitable physical device to be used with the renderer.
 
- Static Public Member Functions inherited from CeresEngine::VKObject< VKDevice, GPUDevice >
static RC< VKDevicecast (const RC< GPUDevice > &ptr)
 Casts a RC containing a ParentType pointer to a pointer to a pointer to a ChildTypeName.
 
static VKDevicecast (GPUDevice &object)
 Casts a object of type ParentType to a object of type ChildTypeName.
 
static const VKDevicecast (const GPUDevice &object)
 Casts a object of type ParentType to a object of type ChildTypeName.
 
static VKDevicecast (GPUDevice *object)
 Casts a object of type ParentType to a object of type ChildTypeName.
 
static const VKDevicecast (const GPUDevice *object)
 Casts a object of type ParentType to a object of type ChildTypeName.
 
- Static Public Member Functions inherited from CeresEngine::VKObjectBase
static voidoperator new (size_t size) noexcept
 
static void operator delete (void *p, std::size_t sz) noexcept
 

Public Attributes

VKDeviceObjectCache< VKRenderPassrenderPasses {*this}
 
VKDeviceObjectCache< VKPipelineLayoutpipelineLayouts {*this}
 
VKDeviceObjectCache< VKGraphicsPipelinegraphicsPipelines {*this}
 
VKDeviceObjectCache< VKComputePipelinecomputePipelines {*this}
 
VKDeviceObjectCache< VKShadershaders {*this}
 
VKDeviceObjectCache< VKShaderProgramshaderPrograms {*this}
 
VKDeviceObjectCache< VKRenderTargetrenderTargets {*this}
 
VKDeviceObjectCache< VKSamplersamplers {*this}
 
const VKDeviceExtensionSet supportedExtensions
 
VKDeviceExtensionSet enabledExtensions
 
VkAllocationCallbacksallocationCallbacks = nullptr
 
- Public Attributes inherited from CeresEngine::GPUDevice
ExecutionContexttransferExecutionContext
 
const GPUDeviceInfoinformation
 The The device information structure.
 
const GPURenderingCapabilitiescapabilities
 The device capabilities structure.
 

Private Attributes

VKRenderAPImRenderer
 The owning VKRenderer instance.
 
VkPhysicalDevice mPhysicalDevice
 The Vulkan physical device that backs the virtual device instance.
 
VkDevice mDevice
 The Vulkan device object.
 
GPUDeviceInfo mInfo
 The device information structure.
 
GPURenderingCapabilities mCapabilities
 The device capabilities.
 
ThreadPool mTransferExecutor {1}
 The thread that runs the transferQueue.
 
LockedObject< Deque< VKCommandBufferPtr > > mPendingCommandBuffers
 The set of command buffer currently in execution.
 
VkPipelineCache mPipelineCache
 
VkPhysicalDeviceProperties mPhysicalDeviceProperties
 
Vector< VkQueueFamilyPropertiesmQueueFamilyProperties
 
VKCommandQueuePtr mGraphicsQueue
 The Vulkan graphics queue.
 
VKCommandQueuePtr mTransferQueue
 The Vulkan presentation queue.
 
VKCommandQueuePtr mComputeQueue
 The Vulkan compute queue.
 
VKBufferPtr mDummyBuffer
 
VKImagePtr mDummyImage
 
VKSamplerPtr mDummySampler
 
VKSwapchainPtr mSwapchain
 The device's default swapchain object.
 
UPtr< VKMemoryAllocatormMemoryAllocator
 

Friends

class VKCommandQueue
 

Additional Inherited Members

- Protected Member Functions inherited from CeresEngine::GPUObject
virtual void destroy () noexcept
 A internal method called by the system when the object reference count reaches zero.
 

Constructor & Destructor Documentation

◆ VKDevice()

CeresEngine::VKDevice::VKDevice ( VKRenderAPI renderer,
const GPUDeviceDescriptor descriptor,
VkPhysicalDevice  physicalDevice 
)

◆ ~VKDevice()

CeresEngine::VKDevice::~VKDevice ( )
final

Member Function Documentation

◆ createBuffer()

GPUBufferPtr CeresEngine::VKDevice::createBuffer ( const GPUBufferDescriptor descriptor)
finalvirtual

◆ createCommandBuffer()

GPUCommandBufferPtr CeresEngine::VKDevice::createCommandBuffer ( const GPUCommandBufferDescriptor descriptor)
finalvirtual

◆ createComputePipeline()

GPUComputePipelinePtr CeresEngine::VKDevice::createComputePipeline ( const GPUComputePipelineDescriptor descriptor)
finalvirtual

◆ createFence()

GPUFencePtr CeresEngine::VKDevice::createFence ( const GPUFenceDescriptor descriptor)
finalvirtual

◆ createGraphicsPipeline()

GPUGraphicsPipelinePtr CeresEngine::VKDevice::createGraphicsPipeline ( const GPUGraphicsPipelineDescriptor descriptor)
finalvirtual

◆ createImage()

GPUImagePtr CeresEngine::VKDevice::createImage ( const GPUImageDescriptor descriptor)
finalvirtual

◆ createOcclusionQuery()

GPUOcclusionQueryPtr CeresEngine::VKDevice::createOcclusionQuery ( const GPUOcclusionQueryDescriptor descriptor)
finalvirtual

◆ createPipelineLayout()

GPUPipelineLayoutPtr CeresEngine::VKDevice::createPipelineLayout ( const GPUPipelineLayoutDescriptor descriptor)
finalvirtual

◆ createRenderPass()

GPURenderPassPtr CeresEngine::VKDevice::createRenderPass ( const GPURenderPassDescriptor descriptor)
finalvirtual

◆ createRenderTarget()

GPURenderTargetPtr CeresEngine::VKDevice::createRenderTarget ( const GPURenderTargetDescriptor descriptor)
finalvirtual

◆ createSampler()

GPUSamplerPtr CeresEngine::VKDevice::createSampler ( const GPUSamplerDescriptor descriptor)
finalvirtual

◆ createShader()

GPUShaderPtr CeresEngine::VKDevice::createShader ( const GPUShaderDescriptor descriptor)
finalvirtual

◆ createShaderProgram()

GPUShaderProgramPtr CeresEngine::VKDevice::createShaderProgram ( const GPUShaderProgramDescriptor descriptor)
finalvirtual

◆ createSwapchain()

GPUSwapchainPtr CeresEngine::VKDevice::createSwapchain ( const GPUSwapchainDescriptor descriptor)
finalvirtual

◆ createTimerQuery()

GPUTimerQueryPtr CeresEngine::VKDevice::createTimerQuery ( const GPUTimerQueryDescriptor descriptor)
finalvirtual

◆ didSubmitCommandBuffer()

void CeresEngine::VKDevice::didSubmitCommandBuffer ( VKCommandBuffer commandBuffer)

◆ findMemoryType()

UInt32 CeresEngine::VKDevice::findMemoryType ( UInt32  typeFilter,
VkMemoryPropertyFlags  properties 
)

Finds a suitable memory type.

Parameters
typeFilterThe type filter
propertiesThe memory properties
Returns
A suitable memory type

◆ getComputeQueue()

GPUCommandQueuePtr CeresEngine::VKDevice::getComputeQueue ( )
finalvirtual

◆ getDummyBuffer()

GPUBufferPtr CeresEngine::VKDevice::getDummyBuffer ( ) const

Returns a dummy Buffer object.

Returns
A dummy Buffer object.

◆ getDummyImage()

GPUImagePtr CeresEngine::VKDevice::getDummyImage ( ) const

Returns a dummy Image object.

Returns
A dummy Image object.

◆ getDummySampler()

GPUSamplerPtr CeresEngine::VKDevice::getDummySampler ( ) const

Returns a dummy Sampler object.

Returns
A dummy Sampler object.

◆ getGraphicsQueue()

GPUCommandQueuePtr CeresEngine::VKDevice::getGraphicsQueue ( )
finalvirtual

◆ getMemoryAllocator()

VKMemoryAllocator & CeresEngine::VKDevice::getMemoryAllocator ( ) const
inline
Returns
The Vulkan memory manager

◆ getPhysicalDevice()

VkPhysicalDevice CeresEngine::VKDevice::getPhysicalDevice ( )
inline
Returns
The owning VKRenderer instance.

◆ getPhysicalDeviceProperties()

const VkPhysicalDeviceProperties & CeresEngine::VKDevice::getPhysicalDeviceProperties ( ) const
inline

◆ getPipelineCache()

VkPipelineCache CeresEngine::VKDevice::getPipelineCache ( ) const
inline

◆ getQueueFamilyProperties()

const Vector< VkQueueFamilyProperties > & CeresEngine::VKDevice::getQueueFamilyProperties ( ) const
inline

◆ getRenderer()

VKRenderAPI & CeresEngine::VKDevice::getRenderer ( )
inline
Returns
The owning VKRenderer instance.

◆ getTransferQueue()

GPUCommandQueuePtr CeresEngine::VKDevice::getTransferQueue ( )
finalvirtual

◆ operator VkDevice()

CeresEngine::VKDevice::operator VkDevice ( ) const
inlinenoexcept

The Vulkan device object.

◆ pickPhysicalDevice()

static VkPhysicalDevice CeresEngine::VKDevice::pickPhysicalDevice ( VkInstance  instance,
const DevicePickerFunc picker 
)
static

Picks a suitable physical device to be used with the renderer.

Parameters
instanceThe Vulkan instance object
pickerA picker callable
Returns
A suitable physical device

◆ update()

void CeresEngine::VKDevice::update ( )

◆ wait()

void CeresEngine::VKDevice::wait ( )

Friends And Related Symbol Documentation

◆ VKCommandQueue

Member Data Documentation

◆ allocationCallbacks

VkAllocationCallbacks* CeresEngine::VKDevice::allocationCallbacks = nullptr

◆ computePipelines

VKDeviceObjectCache<VKComputePipeline> CeresEngine::VKDevice::computePipelines {*this}

◆ enabledExtensions

VKDeviceExtensionSet CeresEngine::VKDevice::enabledExtensions

◆ graphicsPipelines

VKDeviceObjectCache<VKGraphicsPipeline> CeresEngine::VKDevice::graphicsPipelines {*this}

◆ mCapabilities

GPURenderingCapabilities CeresEngine::VKDevice::mCapabilities
private

The device capabilities.

◆ mComputeQueue

VKCommandQueuePtr CeresEngine::VKDevice::mComputeQueue
private

The Vulkan compute queue.

◆ mDevice

VkDevice CeresEngine::VKDevice::mDevice
private

The Vulkan device object.

◆ mDummyBuffer

VKBufferPtr CeresEngine::VKDevice::mDummyBuffer
private

◆ mDummyImage

VKImagePtr CeresEngine::VKDevice::mDummyImage
private

◆ mDummySampler

VKSamplerPtr CeresEngine::VKDevice::mDummySampler
private

◆ mGraphicsQueue

VKCommandQueuePtr CeresEngine::VKDevice::mGraphicsQueue
private

The Vulkan graphics queue.

◆ mInfo

GPUDeviceInfo CeresEngine::VKDevice::mInfo
private

The device information structure.

◆ mMemoryAllocator

UPtr<VKMemoryAllocator> CeresEngine::VKDevice::mMemoryAllocator
private

◆ mPendingCommandBuffers

LockedObject<Deque<VKCommandBufferPtr> > CeresEngine::VKDevice::mPendingCommandBuffers
private

The set of command buffer currently in execution.

◆ mPhysicalDevice

VkPhysicalDevice CeresEngine::VKDevice::mPhysicalDevice
private

The Vulkan physical device that backs the virtual device instance.

◆ mPhysicalDeviceProperties

VkPhysicalDeviceProperties CeresEngine::VKDevice::mPhysicalDeviceProperties
private

◆ mPipelineCache

VkPipelineCache CeresEngine::VKDevice::mPipelineCache
private

◆ mQueueFamilyProperties

Vector<VkQueueFamilyProperties> CeresEngine::VKDevice::mQueueFamilyProperties
private

◆ mRenderer

VKRenderAPI& CeresEngine::VKDevice::mRenderer
private

The owning VKRenderer instance.

◆ mSwapchain

VKSwapchainPtr CeresEngine::VKDevice::mSwapchain
private

The device's default swapchain object.

This should eventually be removed and swapchains should be handled by the user.

◆ mTransferExecutor

ThreadPool CeresEngine::VKDevice::mTransferExecutor {1}
private

The thread that runs the transferQueue.

◆ mTransferQueue

VKCommandQueuePtr CeresEngine::VKDevice::mTransferQueue
private

The Vulkan presentation queue.

◆ pipelineLayouts

VKDeviceObjectCache<VKPipelineLayout> CeresEngine::VKDevice::pipelineLayouts {*this}

◆ renderPasses

VKDeviceObjectCache<VKRenderPass> CeresEngine::VKDevice::renderPasses {*this}

◆ renderTargets

VKDeviceObjectCache<VKRenderTarget> CeresEngine::VKDevice::renderTargets {*this}

◆ samplers

VKDeviceObjectCache<VKSampler> CeresEngine::VKDevice::samplers {*this}

◆ shaderPrograms

VKDeviceObjectCache<VKShaderProgram> CeresEngine::VKDevice::shaderPrograms {*this}

◆ shaders

VKDeviceObjectCache<VKShader> CeresEngine::VKDevice::shaders {*this}

◆ supportedExtensions

const VKDeviceExtensionSet CeresEngine::VKDevice::supportedExtensions

The documentation for this class was generated from the following file: