![]() |
XII Release 0.1.0
|
Copyright (c) Theophilus Eriata. All Rights Reserved. More...
#include <Device.h>
Public Member Functions | |
| xiiResult | Initialize () |
| Initialize device. | |
| void | BeginFrame () |
| Begins a render frame. | |
| void | EndFrame () |
| Ends a render frame. | |
| void | WaitIdle () |
| const xiiGALDeviceCreationDescription & | GetDescription () const |
| Returns the creation description for this device. | |
| XII_ALWAYS_INLINE xiiAllocator * | GetAllocator () |
| virtual xiiGALCommandQueue * | GetCommandQueue (xiiBitflags< xiiGALCommandQueueFlags > queueFlags=xiiGALCommandQueueFlags::Graphics) const =0 |
| const xiiGALGraphicsDeviceAdapterDescription & | GetGraphicsDeviceAdapterProperties () const |
| This retrieves the device properties. See xiiGraphicsDeviceAdapterDescription. | |
| const xiiGALDeviceFeatures & | GetFeatures () const |
| This retrieves the device feature states. See xiiGALDeviceFeatures. | |
| const xiiGALDeviceLimits & | GetLimits () const |
| This retrieves the device limits. See xiiGALDeviceLimits. | |
| xiiEnum< xiiGALGraphicsDeviceType > | GetGraphicsDeviceType () const |
| This retrieves the device graphics API type. See xiiGALGraphicsDeviceType. | |
| xiiMutex & | GetMutex () const |
| This returns critical section lock. | |
Factory Methods. | |
| xiiSharedPtr< xiiGALSwapChain > | CreateSwapChain (const xiiGALSwapChainCreationDescription &description) |
| xiiSharedPtr< xiiGALCommandList > | CreateCommandList (const xiiGALCommandListCreationDescription &description) |
| xiiSharedPtr< xiiGALBlendState > | CreateBlendState (const xiiGALBlendStateCreationDescription &description) |
| xiiSharedPtr< xiiGALDepthStencilState > | CreateDepthStencilState (const xiiGALDepthStencilStateCreationDescription &description) |
| xiiSharedPtr< xiiGALRasterizerState > | CreateRasterizerState (const xiiGALRasterizerStateCreationDescription &description) |
| xiiSharedPtr< xiiGALShader > | CreateShader (const xiiGALShaderCreationDescription &description) |
| xiiSharedPtr< xiiGALBuffer > | CreateBuffer (const xiiGALBufferCreationDescription &description, const xiiGALBufferData *pInitialData=nullptr, xiiBitflags< xiiGALExternalMemoryKind > externalMemoryKind=xiiGALExternalMemoryKind::None) |
| xiiSharedPtr< xiiGALTexture > | CreateTexture (const xiiGALTextureCreationDescription &description, const xiiGALTextureData *pInitialData=nullptr, xiiBitflags< xiiGALExternalMemoryKind > externalMemoryKind=xiiGALExternalMemoryKind::None) |
| xiiSharedPtr< xiiGALSampler > | CreateSampler (const xiiGALSamplerCreationDescription &description) |
| xiiSharedPtr< xiiGALQuery > | CreateQuery (const xiiGALQueryCreationDescription &description) |
| xiiSharedPtr< xiiGALFence > | CreateFence (const xiiGALFenceCreationDescription &description) |
| xiiSharedPtr< xiiGALRenderPass > | CreateRenderPass (const xiiGALRenderPassCreationDescription &description) |
| xiiSharedPtr< xiiGALFramebuffer > | CreateFramebuffer (const xiiGALFramebufferCreationDescription &description) |
| xiiSharedPtr< xiiGALBottomLevelAS > | CreateBottomLevelAS (const xiiGALBottomLevelASCreationDescription &description) |
| xiiSharedPtr< xiiGALTopLevelAS > | CreateTopLevelAS (const xiiGALTopLevelASCreationDescription &description) |
| xiiSharedPtr< xiiGALPipelineResourceSignature > | CreatePipelineResourceSignature (xiiGALPipelineResourceSignatureCreationDescription &description) |
| xiiSharedPtr< xiiGALGraphicsPipelineState > | CreateGraphicsPipelineState (const xiiGALGraphicsPipelineStateCreationDescription &description) |
| xiiSharedPtr< xiiGALComputePipelineState > | CreateComputePipelineState (const xiiGALComputePipelineStateCreationDescription &description) |
| xiiSharedPtr< xiiGALRayTracingPipelineState > | CreateRayTracingPipelineState (const xiiGALRayTracingPipelineStateCreationDescription &description) |
| xiiSharedPtr< xiiGALTilePipelineState > | CreateTilePipelineState (const xiiGALTilePipelineStateCreationDescription &description) |
| Public Member Functions inherited from xiiGALObject | |
| XII_ALWAYS_INLINE xiiStringView | GetDebugName () const |
| Returns the debug name of this resource. | |
| void | SetDebugName (xiiStringView sDebugName) const |
| Sets the debug name for this resource. | |
| Public Member Functions inherited from xiiReflectedClass | |
| virtual const xiiRTTI * | GetDynamicRTTI () const |
| bool | IsInstanceOf (const xiiRTTI *pType) const |
| Returns whether the type of this instance is of the given type or derived from it. | |
| template<typename T> | |
| XII_ALWAYS_INLINE bool | IsInstanceOf () const |
| Returns whether the type of this instance is of the given type or derived from it. | |
| Public Member Functions inherited from xiiRefCounted | |
| virtual | ~xiiRefCounted ()=default |
| Adds a virtual destructor. | |
| Public Member Functions inherited from xiiRefCountingImpl | |
| xiiRefCountingImpl ()=default | |
| Constructor. | |
| xiiRefCountingImpl (const xiiRefCountingImpl &rhs) | |
| void | operator= (const xiiRefCountingImpl &rhs) |
| xiiUInt32 | AddRef () const |
| Increments the reference counter. Returns the new reference count. | |
| bool | TryAddRef () const |
| xiiUInt32 | ReleaseRef () const |
| Decrements the reference counter. Returns the new reference count.ywat. | |
| bool | IsReferenced () const |
| Returns true if the reference count is greater than 0, false otherwise. | |
| xiiUInt32 | GetRefCount () const |
| Returns the current reference count. | |
Static Public Member Functions | |
| static xiiEvent< const xiiGALDeviceEvent &, xiiMutex > & | GetEvents () |
| Registers event handlers. | |
| static bool | IsRegistryInitialized () |
| Returns whether the process-wide device registry is owned by a running subsystem. | |
| static void | SetDefaultDevice (xiiSharedPtr< xiiGALDevice > pDefaultDevice) |
| Sets a default graphics device. | |
| static xiiSharedPtr< xiiGALDevice > | GetDefaultDevice () |
| Retrieves the default device. This will be nullptr if none is set. | |
| static bool | HasDefaultDevice () |
| This returns true if there is a set default device. | |
| Static Public Member Functions inherited from xiiNoBase | |
| static const xiiRTTI * | GetStaticRTTI () |
Protected Member Functions | |
| xiiGALDevice (xiiAllocator *pAllocator, const xiiGALDeviceCreationDescription &creationDescription) | |
| xiiResult | PostInitialize () |
| Initialization after device capabilities are known. | |
| void | VerifyMultithreadedAccess () const |
| Asserts that either this device supports multi-threaded resource creation, or that this function is executed on the main thread. | |
| Protected Member Functions inherited from xiiGALObject | |
| xiiGALObject () | |
| Copyright (c) Theophilus Eriata. All Rights Reserved. | |
| virtual XII_ALWAYS_INLINE void | SetDebugNamePlatform (xiiStringView sName) const |
Protected Attributes | |
| xiiGALDeviceCreationDescription | m_Description |
| xiiProxyAllocator | m_Allocator |
| xiiLocalAllocatorWrapper | m_AllocatorWrapper |
| xiiMutex | m_Mutex |
| xiiGALGraphicsDeviceAdapterDescription | m_AdapterDescription |
Copyright (c) Theophilus Eriata. All Rights Reserved.
The xiiGALDevice class is the primary interface for interactions with rendering APIs. It contains a set of (non-virtual) functions to set state, create resources etc. which rely on API specific implementations provided by protected virtual functions. Redundant state changes are prevented at the platform independent level in the non-virtual functions.
|
nodiscard |
This creates a new blend state object.
| description | - The blend state description. See xiiGALBlendStateCreationDescription. |
|
nodiscard |
This creates a new bottom-level acceleration structure object.
| description | - The bottom-level acceleration structure description. See xiiGALBottomLevelASCreationDescription. |
|
nodiscard |
This creates a new buffer object.
| description | - The buffer description. See xiiGALBufferCreationDescription. |
| pInitialData | - The pointer to the xiiGALBufferData structure that describes the initial buffer data or nullptr if no data is provided. Immutable buffers (xiiGALResourceUsage::Immutable) must be initialized during creation. |
| externalMemoryKind | - The kind of external memory, if the buffer is to be created with externally allocated memory. |
|
nodiscard |
This creates a command list object.
| description | - The command list description. See xiiGALCommandListCreationDescription. |
|
nodiscard |
This creates a new compute pipeline state object.
| description | - The compute pipeline state description. See xiiGALComputePipelineStateCreationDescription. |
|
nodiscard |
This creates a new depth stencil state object.
| description | - The depth stencil state description. See xiiGALDepthStencilStateCreationDescription. |
|
nodiscard |
This creates a new fence object.
| description | - The fence description. See xiiGALFenceCreationDescription. |
|
nodiscard |
This creates a new frame buffer object.
| description | - The frame buffer description. See xiiGALFramebufferCreationDescription. |
|
nodiscard |
This creates a new graphics pipeline state object.
| description | - The graphics pipeline state description. See xiiGALGraphicsPipelineStateCreationDescription. |
|
nodiscard |
This creates a new pipeline resource signature object.
| description | - The pipeline resource signature description. See xiiGALPipelineResourceSignatureCreationDescription. |
|
nodiscard |
This creates a new query object.
| description | - The query description. See xiiGALQueryCreationDescription. |
|
nodiscard |
This creates a new rasterizer state object.
| description | - The rasterizer state description. See xiiGALRasterizerStateCreationDescription. |
|
nodiscard |
This creates a new ray tracing pipeline state object.
| description | - The ray tracing pipeline state description. See xiiGALRayTracingPipelineStateCreationDescription. |
|
nodiscard |
This creates a new render pass object.
| description | - The render pass description. See xiiGALRenderPassCreationDescription. |
|
nodiscard |
This creates a new sampler object.
| description | - The sampler description. See xiiGALSamplerCreationDescription. |
|
nodiscard |
This creates a new shader object.
| description | - The shader description. See xiiGALShaderCreationDescription. |
|
nodiscard |
This creates a swap chain object.
| description | - The swap chain description. See xiiGALSwapChainCreationDescription. |
|
nodiscard |
This creates a new texture object.
| description | - The texture description. See xiiGALTextureCreationDescription. |
| pInitialData | - The pointer to the xiiGALTextureData structure that describes the initial texture data or nullptr if no data is provided. Immutable textures (xiiGALResourceUsage::Immutable) must be initialized during creation. |
| externalMemoryKind | - The kind of external memory, if the texture is to be created with externally allocated memory. |
For example, for a 15 x 6 x 2 2D texture array, the following array of sub-resources should be provided:
15x6, 7x3, 3x1, 1x1, 15x6, 7x3, 3x1, 1x1.
For a 15 x 6 x 4 3D texture, the following array of sub-resources should be provided:
15x6x4, 7x3x2, 3x1x1, 1x1x1
|
nodiscard |
This creates a new tile pipeline state object.
| description | - The tile pipeline state description. See xiiGALTilePipelineStateCreationDescription. |
|
nodiscard |
This creates a new top-level acceleration structure object.
| description | - The top-level acceleration structure description. See xiiGALTopLevelASCreationDescription. |
|
inlinenodiscard |
Allocator used for independently reference-counted GAL objects. It must outlive this device. Device-owned helpers use the internal tracking allocator instead.
|
nodiscardpure virtual |
Retrieves a pointer to the compute queue if available, null otherwise.
| queueType | - The queue type that has the required feature. |
Implemented in xiiGALDeviceD3D12, and xiiGALDeviceVulkan.
| void xiiGALDevice::WaitIdle | ( | ) |
Waits until all outstanding operations on the GPU are complete and destroys any pending resources and GPU objects.