Provides an interface for issuing GPU rendering and compute commands within a single rendering scope.
More...
|
| void | BeginRendering (const xiiRenderingSetup &renderingSetup, const xiiRectFloat &viewport, xiiStringView sName={}, bool bStereoRendering=false) |
| | Begins a graphics render pass with the given setup and viewport.
|
| |
|
void | EndRendering () |
| | Ends the current rendering scope.
|
| |
| void | BeginCompute (xiiStringView sName={}) |
| | Begins a compute dispatch scope.
|
| |
|
void | EndCompute () |
| | Ends the current compute dispatch scope.
|
| |
|
void | SetShaderPermutationVariable (xiiStringView sName, const xiiTempHashedString &sValue) |
| | Sets a shader permutation variable (string-based).
|
| |
|
void | SetShaderPermutationVariable (const xiiHashedString &sName, const xiiHashedString &sValue) |
| | Sets a shader permutation variable (hashed key).
|
| |
|
void | BindConstantBuffer (const xiiTempHashedString &sSlotName, xiiSharedPtr< xiiGALBuffer > pConstantBuffer) |
| | Binds a constant buffer to a shader slot.
|
| |
|
void | BindBufferView (const xiiTempHashedString &sSlotName, xiiSharedPtr< xiiGALBufferView > pBufferView) |
| | Binds a buffer view as a shader resource.
|
| |
|
void | BindTextureView (const xiiTempHashedString &sSlotName, xiiSharedPtr< xiiGALTextureView > pTextureView) |
| | Binds a texture view as a shader resource.
|
| |
|
void | BindSampler (const xiiTempHashedString &sSlotName, xiiSharedPtr< xiiGALSampler > pSampler) |
| | Binds a sampler state to a shader slot.
|
| |
|
void | BindBufferViewUAV (const xiiTempHashedString &sSlotName, xiiSharedPtr< xiiGALBufferView > pBufferView) |
| | Binds a buffer view as an unordered access view (UAV).
|
| |
|
void | BindTextureViewUAV (const xiiTempHashedString &sSlotName, xiiSharedPtr< xiiGALTextureView > pTextureView) |
| | Binds a texture view as an unordered access view (UAV).
|
| |
|
void | BindTexture2D (const xiiTempHashedString &sSlotName, const xiiTexture2DResourceHandle &hTexture, xiiResourceAcquireMode acquireMode=xiiResourceAcquireMode::AllowLoadingFallback) |
| | Binds a 2D texture resource to a shader slot.
|
| |
|
void | BindTexture3D (const xiiTempHashedString &sSlotName, const xiiTexture3DResourceHandle &hTexture, xiiResourceAcquireMode acquireMode=xiiResourceAcquireMode::AllowLoadingFallback) |
| | Binds a 3D texture resource to a shader slot.
|
| |
|
void | BindTextureCube (const xiiTempHashedString &sSlotName, const xiiTextureCubeResourceHandle &hTexture, xiiResourceAcquireMode acquireMode=xiiResourceAcquireMode::AllowLoadingFallback) |
| | Binds a cube texture resource to a shader slot.
|
| |
|
void | BindMaterial (const xiiMaterialResourceHandle &hMaterial) |
| | Binds a material, including shader and its parameters.
|
| |
| void | BindShader (const xiiShaderResourceHandle &hShader, xiiBitflags< xiiShaderBindFlags > flags=xiiShaderBindFlags::Default) |
| | Sets the shader for the next rendering or compute call.
|
| |
| void | SetBlendState (xiiSharedPtr< xiiGALBlendState > pBlendState) |
| | Sets the blend state for the graphics pipeline.
|
| |
| void | SetDepthStencilState (xiiSharedPtr< xiiGALDepthStencilState > pDepthStencilState) |
| | Sets the depth-stencil state for the graphics pipeline to control depth and stencil testing behavior..
|
| |
| void | SetRasterizerState (xiiSharedPtr< xiiGALRasterizerState > pRasterizerState) |
| | Sets the rasterizer state for the graphics pipeline.
|
| |
|
void | BindMeshBuffer (const xiiDynamicMeshBufferResourceHandle &hDynamicMeshBuffer) |
| | Binds a dynamic mesh buffer for rendering.
|
| |
|
void | BindMeshBuffer (const xiiMeshBufferResourceHandle &hMeshBuffer) |
| | Binds a static mesh buffer for rendering.
|
| |
| void | BindMeshBuffer (xiiArrayPtr< xiiSharedPtr< xiiGALBuffer > > pVertexBuffers, xiiSharedPtr< xiiGALBuffer > pIndexBuffer, const xiiInputLayoutInfo *pInputLayoutInfo, xiiEnum< xiiGALPrimitiveTopology > topology, xiiUInt32 uiPrimitiveCount) |
| | Binds raw GPU buffers with custom vertex/index layout.
|
| |
|
void | SetShadingRate (xiiBitflags< xiiGALPipelineShadingRateFlags > pipelineShadingRateFlags, xiiBitflags< xiiGALShadingRateFlags > baseRateFlags, xiiBitflags< xiiGALShadingRateCombinerFlags > primitiveCombinerFlags, xiiBitflags< xiiGALShadingRateCombinerFlags > textureCombinerFlags) |
| | Sets the shading rate for variable rate shading (VRS).
|
| |
| xiiResult | DrawMeshBuffer (xiiUInt32 uiPrimitiveCount=0xFFFFFFFFU, xiiUInt32 uiFirstPrimitive=0U, xiiUInt32 uiInstanceCount=1U) |
| | Issues a draw call for the currently bound mesh buffer.
|
| |
|
xiiResult | Dispatch (xiiUInt32 uiThreadGroupCountX, xiiUInt32 uiThreadGroupCountY=1U, xiiUInt32 uiThreadGroupCountZ=1U) |
| | Dispatches a compute shader with the given thread group counts.
|
| |
| xiiResult | ApplyContextStates (bool bForce=false) |
| | Applies all currently bound states to the GPU context.
|
| |
|
XII_ALWAYS_INLINE xiiSharedPtr< xiiGALCommandList > | GetCommandList () const |
| | Returns the command list in use by this render context.
|
| |
|
XII_ALWAYS_INLINE RenderContextScope | GetRenderContextScope () const |
| | Returns the current render context scope.
|
| |
|
XII_ALWAYS_INLINE xiiGlobalConstants * | GetGlobalConstants () const |
| | Returns the global constant buffer that is used to store this render context global state.
|
| |
|
XII_ALWAYS_INLINE xiiPassConstants * | GetPassConstants () const |
| | Returns the pass constant buffer that is used to store per-pass state.
|
| |
|
XII_ALWAYS_INLINE bool | GetAllowAsyncShaderLoading () const |
| | Returns async shader loading. During runtime all shaders should be preloaded so this is off by default.
|
| |
| XII_ALWAYS_INLINE void | SetAllowAsyncShaderLoading (bool bAllow) |
| | Enables or disables asynchronous shader loading.
|
| |
| XII_ALWAYS_INLINE void | BindBuffer (const xiiTempHashedString &sSlotName, xiiSharedPtr< xiiGALBuffer > pBuffer) |
| | Binds a buffer to the specified shader slot as a shader resource view (SRV).
|
| |
| XII_ALWAYS_INLINE void | BindTexture (const xiiTempHashedString &sSlotName, xiiSharedPtr< xiiGALTexture > pTexture) |
| | Binds a texture to the specified shader slot as a shader resource view (SRV).
|
| |
| XII_ALWAYS_INLINE void | BindBufferUAV (const xiiTempHashedString &sSlotName, xiiSharedPtr< xiiGALBuffer > pBuffer) |
| | Binds a buffer to the specified shader slot as an unordered access view (UAV).
|
| |
| XII_ALWAYS_INLINE void | BindTextureUAV (const xiiTempHashedString &sSlotName, xiiSharedPtr< xiiGALTexture > pTexture) |
| | Binds a texture to the specified shader slot as an unordered access view (UAV).
|
| |
| XII_ALWAYS_INLINE void | BindNullMeshBuffer (xiiEnum< xiiGALPrimitiveTopology > topology, xiiUInt32 uiPrimitiveCount) |
| | Binds a null mesh buffer to the pipeline for procedural or indirect drawing.
|
| |
|
void | SetGlobalAndWorldTimeConstants () |
| |
|
void | SetGlobalAndWorldTimeConstants (xiiTime worldTime) |
| |
Provides an interface for issuing GPU rendering and compute commands within a single rendering scope.
The render context encapsulates a command list and simplifies binding resources, setting up shaders, and issuing draw or dispatch commands.
Typical usage:
xiiRenderContext context(pCommandList);
context.BeginRendering(setup, viewport);
context.BindShader(hShader);
context.BindMaterial(hMaterial);
context.DrawMeshBuffer();
context.EndRendering();