Creates ezGALBindGroupCreationDescription that can be passed into ezGALCommandEncoder.
More...
#include <BindGroupBuilder.h>
|
void | ResetBoundResources (const ezGALDevice *pDevice) |
| Must be called before the builder can be used. This should be called at the start of each frame to make sure no stale resources are referenced inside the builder.
|
|
bool | IsModified () const |
| Returns whether a Bind* call modified in internal state since the last CreateBindGroup call.
|
|
void | BindSampler (ezTempHashedString sSlotName, ezGALSamplerStateHandle hSampler) |
|
void | BindBuffer (ezTempHashedString sSlotName, ezGALBufferHandle hBuffer, ezGALBufferRange bufferRange={}, ezEnum< ezGALResourceFormat > overrideTexelBufferFormat=ezGALResourceFormat::Invalid) |
|
void | BindTexture (ezTempHashedString sSlotName, ezGALTextureHandle hTexture, ezGALTextureRange textureRange={}, ezEnum< ezGALResourceFormat > overrideViewFormat=ezGALResourceFormat::Invalid) |
|
void | BindTexture (ezTempHashedString sSlotName, const ezTexture2DResourceHandle &hTexture, ezResourceAcquireMode acquireMode=ezResourceAcquireMode::AllowLoadingFallback, ezGALTextureRange textureRange={}, ezEnum< ezGALResourceFormat > overrideViewFormat=ezGALResourceFormat::Invalid) |
|
void | BindTexture (ezTempHashedString sSlotName, const ezTexture3DResourceHandle &hTexture, ezResourceAcquireMode acquireMode=ezResourceAcquireMode::AllowLoadingFallback, ezGALTextureRange textureRange={}, ezEnum< ezGALResourceFormat > overrideViewFormat=ezGALResourceFormat::Invalid) |
|
void | BindTexture (ezTempHashedString sSlotName, const ezTextureCubeResourceHandle &hTexture, ezResourceAcquireMode acquireMode=ezResourceAcquireMode::AllowLoadingFallback, ezGALTextureRange textureRange={}, ezEnum< ezGALResourceFormat > overrideViewFormat=ezGALResourceFormat::Invalid) |
|
void | BindBuffer (ezTempHashedString sSlotName, ezConstantBufferStorageHandle hBuffer, ezGALBufferRange bufferRange={}, ezGALResourceFormat::Enum overrideTexelBufferFormat=ezGALResourceFormat::Invalid) |
|
void | CreateBindGroup (ezGALBindGroupLayoutHandle hBindGroupLayout, ezGALBindGroupCreationDescription &out_bindGroup) |
|
|
static ezUInt32 | s_uiWrites = 0 |
| Number of modifications of the hash tables each frame. Used for stats.
|
|
static ezUInt32 | s_uiReads = 0 |
| Number of reads of the hash tables each frame. Used for stats.
|
|
Creates ezGALBindGroupCreationDescription that can be passed into ezGALCommandEncoder.
This class is usually not created manually but instead retrieved via ezRenderContext::GetBindGroup. By calling the various Bind* methods resources can be bound to a shader. The evaluation is deferred until the CreateBindGroup call which matches the bound items to the bind group layout's ezShaderResourceBinding. Any binding that can't find a matching item will be filled with a fallback resource via ezGALRendererFallbackResources. These bind group items will be marked with the flag ezGALBindGroupItemFlags::Fallback.
◆ BindBuffer()
Binds a buffer to this bind group
- Parameters
-
sSlotName | The slot under which the buffer is to be bound. |
hBuffer | If valid, it will be bound. If not, bind group item under this slot will be removed and replaced with a fallback resource if required. |
bufferRange | What part of the buffer should be bound. Default is entire buffer. |
overrideTexelBufferFormat | Sets the format of the texel buffer. If invalid, default format of the buffer will be used. |
◆ BindSampler()
Binds a sampler to this bind group
- Parameters
-
sSlotName | The slot under which the sampler is to be bound. |
hSampler | If valid, it will be bound. If not, bind group item under this slot will be removed and replaced with a fallback resource if required. |
◆ BindTexture()
Binds a texture to this bind group
- Parameters
-
sSlotName | The slot under which the texture is to be bound. |
hTexture | If valid, it will be bound. If not, bind group item under this slot will be removed and replaced with a fallback resource if required. |
textureRange | What part of the texture should be bound. Default is entire texture. Or as much as the target ezShaderResourceBinding allows for. |
overrideViewFormat | If set, re-interprets the format of the texture. This can cause performance penalties. Only use it to e.g. read linear vs gamma space or other formats of same type and width. |
◆ CreateBindGroup()
Create a new bind group for the given layout.
- Parameters
-
hBindGroupLayout | The bind group layout for which to create the bind group. |
out_bindGroup | The resulting bind group. Will be undefined if EZ_FAILURE is returned. |
◆ ResetBoundResources()
void ezBindGroupBuilder::ResetBoundResources |
( |
const ezGALDevice * |
pDevice | ) |
|
Must be called before the builder can be used. This should be called at the start of each frame to make sure no stale resources are referenced inside the builder.
- Parameters
-
pDevice | The device used to validate resources in bind calls. |
The documentation for this class was generated from the following files:
- /home/runner/work/ezEngine/ezEngine/Code/Engine/RendererCore/RenderContext/BindGroupBuilder.h
- /home/runner/work/ezEngine/ezEngine/Code/Engine/RendererCore/RenderContext/Implementation/BindGroupBuilder.cpp