Provides an interface for issuing GPU rendering and compute commands within a single rendering scope.
More...
|
| xiiRenderContext (xiiSharedPtr< xiiGALCommandList > pCommandList) |
| Initializes the render context with a command list.
|
|
| ~xiiRenderContext () |
| Cleans up stateful bindings.
|
|
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 (xiiSharedPtr< xiiGALBuffer > pVertexBuffer0, xiiSharedPtr< xiiGALBuffer > pIndexBuffer, const xiiInputLayoutInfo *pInputLayoutInfo, xiiEnum< xiiGALPrimitiveTopology > topology, xiiUInt32 uiPrimitiveCount, xiiArrayPtr< xiiSharedPtr< xiiGALBuffer > > pVertexBuffers={}) |
| Binds raw GPU buffers with custom vertex/index layout.
|
|
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.
|
|
void | ResetContextState () |
| Resets all context bindings and internal states.
|
|
XII_ALWAYS_INLINE 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 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.
|
|
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:
context.BeginRendering(setup, viewport);
context.BindShader(hShader);
context.BindMaterial(hMaterial);
context.DrawMeshBuffer();
context.EndRendering();
xiiRenderContext(xiiSharedPtr< xiiGALCommandList > pCommandList)
Initializes the render context with a command list.
Definition RenderContext.cpp:15