Cogs.Core
Public Member Functions | Public Attributes | List of all members
Cogs::RenderTargetsVK Class Reference
Inheritance diagram for Cogs::RenderTargetsVK:
Cogs::IRenderTargets

Public Member Functions

void initialize (class GraphicsDeviceVK *device)
 
RenderTargetHandle createRenderTarget (const RenderTargetViewDescription *renderTargetViews, const size_t numViews) override
 Create a render target using the given view descriptions.
 
void releaseRenderTarget (RenderTargetHandle renderTargetHandle) override
 Release the render target with the given renderTargetHandle.
 
RenderTargetLayout getLayout (const RenderTargetHandle renderTargetHandle, const DepthStencilHandle depthStencilHandle) override
 Get the view layout for the given render target / depth stencil target pair.
 
DepthStencilHandle createDepthStencilTarget (const RenderTargetHandle handle) override
 Creates a depth/stencil target to back the render target with the given handle.
 
DepthStencilHandle createDepthStencilTarget (const RenderTargetHandle handle, const TextureHandle textureHandle) override
 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 depthStencilHandle) override
 Release the depth target with the given depthStencilHandle.
 
DepthStencilStateHandle loadDepthStencilState (const DepthStencilState &depthStencilState) override
 Load a depth stencil state object.
 
void releaseDepthStencilState (DepthStencilStateHandle handle) override
 Release the depth stencil state with the given handle.
 
RasterizerStateHandle loadRasterizerState (const RasterizerState &rasterizerState) override
 Load a rasterizer state object.
 
void releaseRasterizerState (RasterizerStateHandle handle) override
 Release the rasterizer state with the given handle.
 
BlendStateHandle loadBlendState (const BlendState &blendState) override
 Load a blend state object.
 
void releaseBlendState (BlendStateHandle handle) override
 Release the blend state with the given handle.
 
void releaseResources () override
 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 RenderTargetLayout getLayout (const RenderTargetHandle renderTargetHandle, const DepthStencilHandle depthStencilHandle)=0
 Get the view layout for the given render target / depth stencil target pair.
 
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 &)
 Load a blend state object with separate blending for alpha channel.
 
virtual BlendStateHandle loadBlendState (const BlendState &blendStateColor, const BlendState &blendStateAlpha, const BlendFlags)
 
virtual BlendStateHandle loadBlendState (const BlendState *, const BlendState *, const uint32_t, const BlendFlags)
 
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

ResourceMap< RenderTargetHandle, RenderTargetVKrenderTargets
 
ResourceMap< DepthStencilHandle, DepthStencilTargetVKdepthTargets
 
ResourceMap< RasterizerStateHandle, RasterizerStateVKrasterizerStates
 
ResourceMap< DepthStencilStateHandle, DepthStencilStateVKdepthStencilStates
 
ResourceMap< BlendStateHandle, BlendStateVKblendStates
 
class GraphicsDeviceVKgraphicsDevice
 

Detailed Description

Definition at line 40 of file RenderTargetsVK.h.

Member Function Documentation

◆ createDepthStencilTarget() [1/3]

Cogs::DepthStencilHandle Cogs::RenderTargetsVK::createDepthStencilTarget ( const RenderTargetHandle  handle)
overridevirtual

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 20 of file RenderTargetsVK.cpp.

References Cogs::TextureFlags::DepthBuffer.

◆ createDepthStencilTarget() [2/3]

Cogs::DepthStencilHandle Cogs::RenderTargetsVK::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 325 of file RenderTargetsVK.cpp.

◆ createDepthStencilTarget() [3/3]

Cogs::DepthStencilHandle Cogs::RenderTargetsVK::createDepthStencilTarget ( const RenderTargetHandle  handle,
const TextureHandle  textureHandle 
)
overridevirtual

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 33 of file RenderTargetsVK.cpp.

References Cogs::Handle_t< DepthStencilTag >::InvalidHandle.

◆ createRenderTarget()

Cogs::RenderTargetHandle Cogs::RenderTargetsVK::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 320 of file RenderTargetsVK.cpp.

◆ getLayout()

Cogs::RenderTargetLayout Cogs::RenderTargetsVK::getLayout ( const RenderTargetHandle  renderTargetHandle,
const DepthStencilHandle  depthStencilHandle 
)
overridevirtual

Get the view layout for the given render target / depth stencil target pair.

Parameters
renderTargetHandleHandle to a render target, or NoHandle for the default render target.
depthStencilHandleHandle to a depth stencil target, or NoHandle if none is bound.
Returns
The layout describing the formats and sample count of the given targets.

Implements Cogs::IRenderTargets.

Definition at line 151 of file RenderTargetsVK.cpp.

References Cogs::GraphicsDeviceSettings::colorFormat, Cogs::RenderTargetLayout::colorFormats, Cogs::GraphicsDeviceSettings::depthFormat, Cogs::RenderTargetLayout::depthStencilFormat, Cogs::RenderTargetLayout::numColorTargets, Cogs::GraphicsDeviceSettings::numSamples, and Cogs::RenderTargetLayout::samples.

◆ initialize()

void Cogs::RenderTargetsVK::initialize ( class GraphicsDeviceVK device)

Definition at line 11 of file RenderTargetsVK.cpp.

◆ loadBlendState()

Cogs::BlendStateHandle Cogs::RenderTargetsVK::loadBlendState ( const BlendState blendState)
overridevirtual

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 284 of file RenderTargetsVK.cpp.

References Cogs::BlendState::destinationBlend, Cogs::BlendState::enabled, and Cogs::BlendState::sourceBlend.

◆ loadDepthStencilState()

Cogs::DepthStencilStateHandle Cogs::RenderTargetsVK::loadDepthStencilState ( const DepthStencilState depthStencilState)
overridevirtual

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 188 of file RenderTargetsVK.cpp.

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

◆ loadRasterizerState()

Cogs::RasterizerStateHandle Cogs::RenderTargetsVK::loadRasterizerState ( const RasterizerState rasterizerState)
overridevirtual

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 226 of file RenderTargetsVK.cpp.

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

◆ releaseBlendState()

void Cogs::RenderTargetsVK::releaseBlendState ( BlendStateHandle  handle)
overridevirtual

Release the blend state with the given handle.

Parameters
handleValid handle to a blend state object.

Implements Cogs::IRenderTargets.

Definition at line 312 of file RenderTargetsVK.cpp.

◆ releaseDepthStencilState()

void Cogs::RenderTargetsVK::releaseDepthStencilState ( DepthStencilStateHandle  handle)
overridevirtual

Release the depth stencil state with the given handle.

Parameters
handleValid handle to a depth stencil state object.

Implements Cogs::IRenderTargets.

Definition at line 222 of file RenderTargetsVK.cpp.

◆ releaseDepthStencilTarget()

void Cogs::RenderTargetsVK::releaseDepthStencilTarget ( DepthStencilHandle  depthStencilHandle)
overridevirtual

Release the depth target with the given depthStencilHandle.

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

Implements Cogs::IRenderTargets.

Definition at line 147 of file RenderTargetsVK.cpp.

◆ releaseRasterizerState()

void Cogs::RenderTargetsVK::releaseRasterizerState ( RasterizerStateHandle  handle)
overridevirtual

Release the rasterizer state with the given handle.

Parameters
handleValid handle to a rasterizer state object.

Implements Cogs::IRenderTargets.

Definition at line 257 of file RenderTargetsVK.cpp.

◆ releaseRenderTarget()

void Cogs::RenderTargetsVK::releaseRenderTarget ( RenderTargetHandle  renderTargetHandle)
overridevirtual

Release the render target with the given renderTargetHandle.

Parameters
renderTargetHandleValid handle to a previously created render target.

Implements Cogs::IRenderTargets.

Definition at line 16 of file RenderTargetsVK.cpp.

◆ releaseResources()

void Cogs::RenderTargetsVK::releaseResources ( )
overridevirtual

Release all allocated render target resources.

Implements Cogs::IRenderTargets.

Definition at line 316 of file RenderTargetsVK.cpp.

Member Data Documentation

◆ blendStates

ResourceMap<BlendStateHandle, BlendStateVK> Cogs::RenderTargetsVK::blendStates

Definition at line 76 of file RenderTargetsVK.h.

◆ depthStencilStates

ResourceMap<DepthStencilStateHandle, DepthStencilStateVK> Cogs::RenderTargetsVK::depthStencilStates

Definition at line 75 of file RenderTargetsVK.h.

◆ depthTargets

ResourceMap<DepthStencilHandle, DepthStencilTargetVK> Cogs::RenderTargetsVK::depthTargets

Definition at line 72 of file RenderTargetsVK.h.

◆ graphicsDevice

class GraphicsDeviceVK* Cogs::RenderTargetsVK::graphicsDevice

Definition at line 78 of file RenderTargetsVK.h.

◆ rasterizerStates

ResourceMap<RasterizerStateHandle, RasterizerStateVK> Cogs::RenderTargetsVK::rasterizerStates

Definition at line 74 of file RenderTargetsVK.h.

◆ renderTargets

ResourceMap<RenderTargetHandle, RenderTargetVK> Cogs::RenderTargetsVK::renderTargets

Definition at line 71 of file RenderTargetsVK.h.


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