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

Public Member Functions

void initialize (GraphicsDeviceWebGPU *graphicsDevice)
 
virtual void annotate (RenderTargetHandle, const StringView &) override
 Associate a name with an object for use in graphics debugging.
 
virtual void annotate (DepthStencilHandle, const StringView &) override
 Associate a name with an object for use in graphics debugging.
 
virtual RenderTargetHandle createRenderTarget (const RenderTargetViewDescription *renderTargetViews, const size_t numViews) override
 Create a render target using the given view descriptions.
 
virtual void releaseRenderTarget (RenderTargetHandle handle) override
 Release the render target with the given renderTargetHandle.
 
virtual DepthStencilHandle createDepthStencilTarget (const RenderTargetHandle handle) override
 Creates a depth/stencil target to back the render target with the given handle.
 
virtual DepthStencilHandle createDepthStencilTarget (const RenderTargetHandle handle, const TextureHandle textureHandle) override
 Creates a depth/stencil target to back the render target with the given handle.
 
virtual DepthStencilHandle createDepthStencilTarget (const RenderTargetHandle handle, const DepthStencilViewDescription &depthStencilView) override
 Creates a depth stencil view using the given description.
 
virtual void releaseDepthStencilTarget (DepthStencilHandle handle) override
 Release the depth target with the given depthStencilHandle.
 
virtual DepthStencilStateHandle loadDepthStencilState (const DepthStencilState &depthStencilState) override
 Load a depth stencil state object.
 
virtual void releaseDepthStencilState (DepthStencilStateHandle depthStencilStateHandle) override
 Release the depth stencil state with the given handle.
 
virtual RasterizerStateHandle loadRasterizerState (const RasterizerState &rasterizerState) override
 Load a rasterizer state object.
 
virtual void releaseRasterizerState (RasterizerStateHandle rasterizerStateHandle) override
 Release the rasterizer state with the given handle.
 
virtual BlendStateHandle loadBlendState (const BlendState &blendState) override
 Load a blend state object.
 
virtual BlendStateHandle loadBlendState (const BlendState &color, const BlendState &alpha) override
 Load a blend state object with separate blending for alpha channel.
 
virtual void releaseBlendState (BlendStateHandle blendStateHandle) override
 Release the blend state with the given handle.
 
virtual 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 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

GraphicsDeviceWebGPUgraphicsDevice = nullptr
 
SafeResourceMap< RenderTargetHandle, RenderTargetWebGPUrender_targets
 
SafeResourceMap< DepthStencilHandle, DepthStencilTargetWebGPUdepth_stencil_targets
 

Detailed Description

Definition at line 28 of file RenderTargetsWebGPU.h.

Member Function Documentation

◆ annotate() [1/2]

virtual void Cogs::RenderTargetsWebGPU::annotate ( DepthStencilHandle  handle,
const StringView name 
)
inlineoverridevirtual

Associate a name with an object for use in graphics debugging.

Reimplemented from Cogs::IRenderTargets.

Definition at line 33 of file RenderTargetsWebGPU.h.

◆ annotate() [2/2]

virtual void Cogs::RenderTargetsWebGPU::annotate ( RenderTargetHandle  handle,
const StringView name 
)
inlineoverridevirtual

Associate a name with an object for use in graphics debugging.

Reimplemented from Cogs::IRenderTargets.

Definition at line 32 of file RenderTargetsWebGPU.h.

◆ createDepthStencilTarget() [1/3]

DepthStencilHandle Cogs::RenderTargetsWebGPU::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 70 of file RenderTargetsWebGPU.cpp.

References createDepthStencilTarget(), Cogs::TextureFlags::DepthBuffer, Cogs::DepthStencilViewDescription::layerIndex, Cogs::DepthStencilViewDescription::levelIndex, Cogs::TexturesWebGPU::loadTexture(), Cogs::DepthStencilViewDescription::numLayers, and Cogs::DepthStencilViewDescription::texture.

Referenced by createDepthStencilTarget().

◆ createDepthStencilTarget() [2/3]

DepthStencilHandle Cogs::RenderTargetsWebGPU::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 109 of file RenderTargetsWebGPU.cpp.

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

◆ createDepthStencilTarget() [3/3]

DepthStencilHandle Cogs::RenderTargetsWebGPU::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 99 of file RenderTargetsWebGPU.cpp.

References createDepthStencilTarget(), Cogs::DepthStencilViewDescription::layerIndex, Cogs::DepthStencilViewDescription::levelIndex, Cogs::DepthStencilViewDescription::numLayers, and Cogs::DepthStencilViewDescription::texture.

◆ createRenderTarget()

RenderTargetHandle Cogs::RenderTargetsWebGPU::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 14 of file RenderTargetsWebGPU.cpp.

References Cogs::RenderTargetViewDescription::layerIndex, Cogs::RenderTargetViewDescription::levelIndex, Cogs::RenderTargetViewDescription::numLayers, and Cogs::RenderTargetViewDescription::texture.

◆ initialize()

void Cogs::RenderTargetsWebGPU::initialize ( GraphicsDeviceWebGPU graphicsDevice)

Definition at line 9 of file RenderTargetsWebGPU.cpp.

◆ loadBlendState() [1/2]

virtual BlendStateHandle Cogs::RenderTargetsWebGPU::loadBlendState ( const BlendState blendState)
inlineoverridevirtual

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 55 of file RenderTargetsWebGPU.h.

References loadBlendState().

Referenced by loadBlendState().

◆ loadBlendState() [2/2]

virtual BlendStateHandle Cogs::RenderTargetsWebGPU::loadBlendState ( const BlendState blendStateColor,
const BlendState blendStateAlpha 
)
inlineoverridevirtual

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 58 of file RenderTargetsWebGPU.h.

◆ loadDepthStencilState()

virtual DepthStencilStateHandle Cogs::RenderTargetsWebGPU::loadDepthStencilState ( const DepthStencilState depthStencilState)
inlineoverridevirtual

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 43 of file RenderTargetsWebGPU.h.

◆ loadRasterizerState()

virtual RasterizerStateHandle Cogs::RenderTargetsWebGPU::loadRasterizerState ( const RasterizerState rasterizerState)
inlineoverridevirtual

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 49 of file RenderTargetsWebGPU.h.

◆ releaseBlendState()

virtual void Cogs::RenderTargetsWebGPU::releaseBlendState ( BlendStateHandle  handle)
inlineoverridevirtual

Release the blend state with the given handle.

Parameters
handleValid handle to a blend state object.

Implements Cogs::IRenderTargets.

Definition at line 61 of file RenderTargetsWebGPU.h.

References Cogs::Handle_t< Type, Convertible >::handle.

◆ releaseDepthStencilState()

virtual void Cogs::RenderTargetsWebGPU::releaseDepthStencilState ( DepthStencilStateHandle  handle)
inlineoverridevirtual

Release the depth stencil state with the given handle.

Parameters
handleValid handle to a depth stencil state object.

Implements Cogs::IRenderTargets.

Definition at line 46 of file RenderTargetsWebGPU.h.

References Cogs::Handle_t< Type, Convertible >::handle.

◆ releaseDepthStencilTarget()

void Cogs::RenderTargetsWebGPU::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 145 of file RenderTargetsWebGPU.cpp.

◆ releaseRasterizerState()

virtual void Cogs::RenderTargetsWebGPU::releaseRasterizerState ( RasterizerStateHandle  handle)
inlineoverridevirtual

Release the rasterizer state with the given handle.

Parameters
handleValid handle to a rasterizer state object.

Implements Cogs::IRenderTargets.

Definition at line 52 of file RenderTargetsWebGPU.h.

References Cogs::Handle_t< Type, Convertible >::handle.

◆ releaseRenderTarget()

void Cogs::RenderTargetsWebGPU::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 60 of file RenderTargetsWebGPU.cpp.

◆ releaseResources()

virtual void Cogs::RenderTargetsWebGPU::releaseResources ( )
inlineoverridevirtual

Release all allocated render target resources.

Implements Cogs::IRenderTargets.

Definition at line 65 of file RenderTargetsWebGPU.h.

Referenced by Cogs::GraphicsDeviceWebGPU::releaseResources().

Member Data Documentation

◆ depth_stencil_targets

SafeResourceMap<DepthStencilHandle, DepthStencilTargetWebGPU> Cogs::RenderTargetsWebGPU::depth_stencil_targets

Definition at line 70 of file RenderTargetsWebGPU.h.

◆ graphicsDevice

GraphicsDeviceWebGPU* Cogs::RenderTargetsWebGPU::graphicsDevice = nullptr

Definition at line 67 of file RenderTargetsWebGPU.h.

◆ render_targets

SafeResourceMap<RenderTargetHandle, RenderTargetWebGPU> Cogs::RenderTargetsWebGPU::render_targets

Definition at line 69 of file RenderTargetsWebGPU.h.


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