Cogs.Core
Public Member Functions | Public Attributes | Private Attributes | List of all members
Cogs::RenderTargetsD3D12 Struct Reference
Inheritance diagram for Cogs::RenderTargetsD3D12:
Cogs::IRenderTargets

Public Member Functions

HRESULT initialize (struct GraphicsDeviceD3D12 *graphicsDevice)
 
RenderTargetHandle createRenderTarget (ID3D12Resource *resource)
 
RenderTargetHandle createRenderTarget (const RenderTargetViewDescription *renderTargetViews, const size_t numViews) override
 Create a render target using the given view descriptions.
 
void releaseRenderTarget (RenderTargetHandle handle)
 Release the render target with the given renderTargetHandle.
 
DepthStencilHandle createDepthStencilTarget (const RenderTargetHandle handle)
 Creates a depth/stencil target to back the render target with the given handle.
 
DepthStencilHandle createDepthStencilTarget (const RenderTargetHandle handle, const TextureHandle textureHandle)
 Creates a depth/stencil target to back the render target with the given handle.
 
DepthStencilHandle createDepthStencilTarget (const RenderTargetHandle handle, const DepthStencilViewDescription &depthStencilView) override
 Creates a depth stencil view using the given description.
 
void releaseDepthStencilTarget (DepthStencilHandle handle)
 Release the depth target with the given depthStencilHandle.
 
DepthStencilStateHandle loadDepthStencilState (const DepthStencilState &depthStencilState)
 Load a depth stencil state object.
 
void releaseDepthStencilState (DepthStencilStateHandle handle)
 Release the depth stencil state with the given handle.
 
RasterizerStateHandle loadRasterizerState (const RasterizerState &rasterizerState)
 Load a rasterizer state object.
 
void releaseRasterizerState (RasterizerStateHandle handle)
 Release the rasterizer state with the given handle.
 
BlendStateHandle loadBlendState (const BlendState &blendState)
 Load a blend state object.
 
BlendStateHandle loadBlendState (const BlendState &blendStateColor, const BlendState &blendStateAlpha) override
 Load a blend state object with separate blending for alpha channel.
 
BlendStateHandle loadBlendState (const BlendState &blendStateColor, const BlendState &blendStateAlpha, const uint32_t flags) override
 
BlendStateHandle loadBlendState (const BlendState *blendStateColor, const BlendState *blendStateAlpha, const uint32_t numBlendState, const uint32_t flags) override
 
void releaseBlendState (BlendStateHandle handle)
 Release the blend state with the given handle.
 
void releaseResources ()
 Release all allocated render target resources.
 
- Public Member Functions inherited from Cogs::IRenderTargets
virtual void annotate (RenderTargetHandle handle, const StringView &name)
 Associate a name with an object for use in graphics debugging.
 
virtual void annotate (DepthStencilHandle handle, const StringView &name)
 Associate a name with an object for use in graphics debugging.
 
virtual RenderTargetHandle createRenderTarget (TextureHandle textureHandle)
 Create a render target using the given texture to render into.
 
virtual RenderTargetHandle createRenderTarget (TextureHandle *textureHandles, const size_t numTextureHandles)
 Create a multi render target (MRT) with using the given textures to render into.
 
virtual RenderTargetHandle createRenderTarget (const RenderTargetViewDescription *renderTargetViews, const size_t numViews)=0
 Create a render target using the given view descriptions.
 
virtual RenderTargetHandle createRenderTarget (const RenderTargetViewDescription *, const size_t, const MultiViewDescription &)
 
virtual void releaseRenderTarget (RenderTargetHandle renderTargetHandle)=0
 Release the render target with the given renderTargetHandle.
 
virtual DepthStencilHandle createDepthStencilTarget (const RenderTargetHandle handle)=0
 Creates a depth/stencil target to back the render target with the given handle.
 
virtual DepthStencilHandle createDepthStencilTarget (const RenderTargetHandle handle, const TextureHandle textureHandle)=0
 Creates a depth/stencil target to back the render target with the given handle.
 
virtual DepthStencilHandle createDepthStencilTarget (const RenderTargetHandle handle, const DepthStencilViewDescription &depthStencilView)=0
 Creates a depth stencil view using the given description.
 
virtual DepthStencilHandle createDepthStencilTarget (const RenderTargetHandle, const DepthStencilViewDescription &, const MultiViewDescription &)
 
virtual void releaseDepthStencilTarget (DepthStencilHandle depthStencilHandle)=0
 Release the depth target with the given depthStencilHandle.
 
virtual DepthStencilStateHandle loadDepthStencilState (const DepthStencilState &depthStencilState)=0
 Load a depth stencil state object.
 
virtual void releaseDepthStencilState (DepthStencilStateHandle handle)=0
 Release the depth stencil state with the given handle.
 
virtual RasterizerStateHandle loadRasterizerState (const RasterizerState &rasterizerState)=0
 Load a rasterizer state object.
 
virtual void releaseRasterizerState (RasterizerStateHandle handle)=0
 Release the rasterizer state with the given handle.
 
virtual BlendStateHandle loadBlendState (const BlendState &blendState)=0
 Load a blend state object.
 
virtual BlendStateHandle loadBlendState (const BlendState &blendStateColor, const BlendState &blendStateAlpha)
 Load a blend state object with separate blending for alpha channel.
 
virtual BlendStateHandle loadBlendState (const BlendState &blendStateColor, const BlendState &blendStateAlpha, const uint32_t flags)
 
virtual BlendStateHandle loadBlendState (const BlendState *blendStateColor, const BlendState *blendStateAlpha, const uint32_t numBlendStates, const uint32_t flags)
 
virtual void releaseBlendState (BlendStateHandle handle)=0
 Release the blend state with the given handle.
 
virtual void releaseResources ()=0
 Release all allocated render target resources.
 

Public Attributes

TexturesD3D12textures
 
ResourceMap< RenderTargetHandle, RenderTargetD3D12renderTargets
 
ResourceMap< DepthStencilHandle, DepthStencilTargetD3D12depthStencilTargets
 
ResourceMap< BlendStateHandle, BlendStateD3D12blendStates
 
ResourceMap< RasterizerStateHandle, RasterizerStateD3D12rasterizerStates
 
ResourceMap< DepthStencilStateHandle, DepthStencilStateD3D12depthStencilStates
 
DescriptorPool rtvPool
 
DescriptorPool dsvPool
 

Private Attributes

ResourcePointer< ID3D12Device > device
 
GraphicsDeviceD3D12graphicsDevice
 

Detailed Description

Definition at line 111 of file RenderTargetsD3D12.h.

Member Function Documentation

◆ createDepthStencilTarget() [1/3]

Cogs::DepthStencilHandle Cogs::RenderTargetsD3D12::createDepthStencilTarget ( const RenderTargetHandle  handle)
virtual

Creates a depth/stencil target to back the render target with the given handle.

The dimensions of the render target are matched and a suitable depth format for the graphics device is chosen.

Parameters
handleValid handle to a render target to create depth target backing for.
Returns
Handle to the newly created depth target, InvalidHandle if the operation failed.

Implements Cogs::IRenderTargets.

Definition at line 124 of file RenderTargetsD3D12.cpp.

References Cogs::TextureFlags::DepthBuffer.

◆ createDepthStencilTarget() [2/3]

Cogs::DepthStencilHandle Cogs::RenderTargetsD3D12::createDepthStencilTarget ( const RenderTargetHandle  handle,
const DepthStencilViewDescription depthStencilView 
)
overridevirtual

Creates a depth stencil view using the given description.

Parameters
handleValid handle to a render target to create depth target backing for.
depthStencilViewDepth stencil view description.
Returns
Handle to the newly created depth stencil target, InvalidHandle if the operation failed.

Implements Cogs::IRenderTargets.

Definition at line 143 of file RenderTargetsD3D12.cpp.

References Cogs::DepthStencilViewDescription::layerIndex, Cogs::DepthStencilViewDescription::levelIndex, and Cogs::DepthStencilViewDescription::texture.

◆ createDepthStencilTarget() [3/3]

Cogs::DepthStencilHandle Cogs::RenderTargetsD3D12::createDepthStencilTarget ( const RenderTargetHandle  handle,
const TextureHandle  textureHandle 
)
virtual

Creates a depth/stencil target to back the render target with the given handle.

The texture with the given textureHandle is used as backing for the depth target. The texture must be of a format that supports depth values, and be flagged for use as a depth texture.

Parameters
handleValid handle to a render target to create depth target backing for.
textureHandleValid handle to a texture to use as backing to render depth values to.
Returns
Handle to the newly created depth stencil target, InvalidHandle if the operation failed.

Implements Cogs::IRenderTargets.

Definition at line 134 of file RenderTargetsD3D12.cpp.

◆ createRenderTarget() [1/2]

Cogs::RenderTargetHandle Cogs::RenderTargetsD3D12::createRenderTarget ( const RenderTargetViewDescription renderTargetViews,
const size_t  numViews 
)
overridevirtual

Create a render target using the given view descriptions.

Parameters
renderTargetViewsPointer to an array of render target view descriptions.
numViewsNumber of views in the array pointed to by renderTargetViews.
Returns
Handle to a render target, InvalidHandle if the operation failed.

Implements Cogs::IRenderTargets.

Definition at line 81 of file RenderTargetsD3D12.cpp.

References Cogs::Direct3D12::Formats, Cogs::RenderTargetViewDescription::layerIndex, Cogs::RenderTargetViewDescription::levelIndex, and Cogs::RenderTargetViewDescription::texture.

◆ createRenderTarget() [2/2]

Cogs::RenderTargetHandle Cogs::RenderTargetsD3D12::createRenderTarget ( ID3D12Resource *  resource)

Definition at line 61 of file RenderTargetsD3D12.cpp.

◆ initialize()

HRESULT Cogs::RenderTargetsD3D12::initialize ( struct GraphicsDeviceD3D12 graphicsDevice)

Definition at line 49 of file RenderTargetsD3D12.cpp.

◆ loadBlendState() [1/4]

Cogs::BlendStateHandle Cogs::RenderTargetsD3D12::loadBlendState ( const BlendState blendState)
virtual

Load a blend state object.

Parameters
blendStateBlend state object to load.
Returns
Handle to the newly loaded blend state object, InvalidHandle if the operation failed.

Implements Cogs::IRenderTargets.

Definition at line 267 of file RenderTargetsD3D12.cpp.

◆ loadBlendState() [2/4]

Cogs::BlendStateHandle Cogs::RenderTargetsD3D12::loadBlendState ( const BlendState blendStateColor,
const BlendState blendStateAlpha 
)
overridevirtual

Load a blend state object with separate blending for alpha channel.

Parameters
blendStateColorBlend state object for the color channels to load.
blendStateAlphaBlend state object for the alpha channel to load.
Returns
Handle to the newly loaded blend state object, InvalidHandle if the operation failed.

Reimplemented from Cogs::IRenderTargets.

Definition at line 272 of file RenderTargetsD3D12.cpp.

◆ loadBlendState() [3/4]

Cogs::BlendStateHandle Cogs::RenderTargetsD3D12::loadBlendState ( const BlendState blendStateColor,
const BlendState blendStateAlpha,
const uint32_t  flags 
)
overridevirtual

Reimplemented from Cogs::IRenderTargets.

Definition at line 277 of file RenderTargetsD3D12.cpp.

◆ loadBlendState() [4/4]

Cogs::BlendStateHandle Cogs::RenderTargetsD3D12::loadBlendState ( const BlendState blendStateColor,
const BlendState blendStateAlpha,
const uint32_t  numBlendState,
const uint32_t  flags 
)
overridevirtual

Reimplemented from Cogs::IRenderTargets.

Definition at line 282 of file RenderTargetsD3D12.cpp.

◆ loadDepthStencilState()

Cogs::DepthStencilStateHandle Cogs::RenderTargetsD3D12::loadDepthStencilState ( const DepthStencilState depthStencilState)
virtual

Load a depth stencil state object.

Parameters
depthStencilStateDepth stencil state object to load.
Returns
Handle to the newly loaded depth stencil state object, InvalidHandle if the operation failed.

Implements Cogs::IRenderTargets.

Definition at line 195 of file RenderTargetsD3D12.cpp.

References Cogs::DepthStencilState::depthEnabled, Cogs::DepthStencilState::depthFunction, and Cogs::DepthStencilState::writeEnabled.

◆ loadRasterizerState()

Cogs::RasterizerStateHandle Cogs::RenderTargetsD3D12::loadRasterizerState ( const RasterizerState rasterizerState)
virtual

Load a rasterizer state object.

Parameters
rasterizerStateRasterizer state object to load.
Returns
Handle to the newly loaded rasterizer state object, InvalidHandle if the operation failed.

Implements Cogs::IRenderTargets.

Definition at line 241 of file RenderTargetsD3D12.cpp.

References Cogs::RasterizerState::cullMode, Cogs::RasterizerState::depthBias, Cogs::RasterizerState::depthBiasClamp, Cogs::RasterizerState::frontCounterClockwise, Cogs::RasterizerState::multiSample, Cogs::RasterizerState::slopeScaledDepthBias, and Cogs::RasterizerState::wireFrame.

◆ releaseBlendState()

void Cogs::RenderTargetsD3D12::releaseBlendState ( BlendStateHandle  handle)
virtual

Release the blend state with the given handle.

Parameters
handleValid handle to a blend state object.

Implements Cogs::IRenderTargets.

Definition at line 311 of file RenderTargetsD3D12.cpp.

◆ releaseDepthStencilState()

void Cogs::RenderTargetsD3D12::releaseDepthStencilState ( DepthStencilStateHandle  handle)
virtual

Release the depth stencil state with the given handle.

Parameters
handleValid handle to a depth stencil state object.

Implements Cogs::IRenderTargets.

Definition at line 224 of file RenderTargetsD3D12.cpp.

◆ releaseDepthStencilTarget()

void Cogs::RenderTargetsD3D12::releaseDepthStencilTarget ( DepthStencilHandle  depthStencilHandle)
virtual

Release the depth target with the given depthStencilHandle.

Parameters
depthStencilHandleValid handle to a previously created depth/stencil target.

Implements Cogs::IRenderTargets.

Definition at line 171 of file RenderTargetsD3D12.cpp.

◆ releaseRasterizerState()

void Cogs::RenderTargetsD3D12::releaseRasterizerState ( RasterizerStateHandle  handle)
virtual

Release the rasterizer state with the given handle.

Parameters
handleValid handle to a rasterizer state object.

Implements Cogs::IRenderTargets.

Definition at line 261 of file RenderTargetsD3D12.cpp.

◆ releaseRenderTarget()

void Cogs::RenderTargetsD3D12::releaseRenderTarget ( RenderTargetHandle  renderTargetHandle)
virtual

Release the render target with the given renderTargetHandle.

Parameters
renderTargetHandleValid handle to a previously created render target.

Implements Cogs::IRenderTargets.

Definition at line 113 of file RenderTargetsD3D12.cpp.

◆ releaseResources()

void Cogs::RenderTargetsD3D12::releaseResources ( )
virtual

Release all allocated render target resources.

Implements Cogs::IRenderTargets.

Definition at line 316 of file RenderTargetsD3D12.cpp.

Member Data Documentation

◆ blendStates

ResourceMap<BlendStateHandle, BlendStateD3D12> Cogs::RenderTargetsD3D12::blendStates

Definition at line 143 of file RenderTargetsD3D12.h.

◆ depthStencilStates

ResourceMap<DepthStencilStateHandle, DepthStencilStateD3D12> Cogs::RenderTargetsD3D12::depthStencilStates

Definition at line 145 of file RenderTargetsD3D12.h.

◆ depthStencilTargets

ResourceMap<DepthStencilHandle, DepthStencilTargetD3D12> Cogs::RenderTargetsD3D12::depthStencilTargets

Definition at line 141 of file RenderTargetsD3D12.h.

◆ device

ResourcePointer<ID3D12Device> Cogs::RenderTargetsD3D12::device
private

Definition at line 151 of file RenderTargetsD3D12.h.

◆ dsvPool

DescriptorPool Cogs::RenderTargetsD3D12::dsvPool

Definition at line 148 of file RenderTargetsD3D12.h.

◆ graphicsDevice

GraphicsDeviceD3D12* Cogs::RenderTargetsD3D12::graphicsDevice
private

Definition at line 152 of file RenderTargetsD3D12.h.

◆ rasterizerStates

ResourceMap<RasterizerStateHandle, RasterizerStateD3D12> Cogs::RenderTargetsD3D12::rasterizerStates

Definition at line 144 of file RenderTargetsD3D12.h.

◆ renderTargets

ResourceMap<RenderTargetHandle, RenderTargetD3D12> Cogs::RenderTargetsD3D12::renderTargets

Definition at line 140 of file RenderTargetsD3D12.h.

◆ rtvPool

DescriptorPool Cogs::RenderTargetsD3D12::rtvPool

Definition at line 147 of file RenderTargetsD3D12.h.

◆ textures

TexturesD3D12* Cogs::RenderTargetsD3D12::textures

Definition at line 115 of file RenderTargetsD3D12.h.


The documentation for this struct was generated from the following files: