IRHICommandContext

The interface RHI command context.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

RHI

Header

/Engine/Source/Runtime/RHI/Public/RHIContext.h

Include

#include "RHIContext.h"

Syntax

class IRHICommandContext : public IRHIComputeContext

Remarks

The interface RHI command context. Sometimes the RHI handles these. On platforms that can processes command lists in parallel, it is a separate object.

Variables

Name Description

Protected variable

FRHIRenderPassI...

 

RenderPassInfo

Destructors

Name Description

Public function Virtual

~IRHICommandContext()

Functions

Name Description

Public function

void

 

RHIAutomaticCacheFlushAfterComputeShader

(
    bool bEnable
)

Public function Virtual

void

 

RHIBeginComputePass

(
    const TCHAR* InName
)

Public function

void

 

RHIBeginDrawingViewport

(
    FRHIViewport* Viewport,
    FRHITexture* RenderTargetRHI
)

This method is queued with an RHIThread, otherwise it will flush after it is queued; without an RHI thread there is no benefit to queuing this frame advance commands.

Public function

void

 

RHIBeginFrame()

This method is queued with an RHIThread, otherwise it will flush after it is queued; without an RHI thread there is no benefit to queuing this frame advance commands.

Public function Virtual

void

 

RHIBeginRenderPass

(
    const FRHIRenderPassInfo& InInfo,
    const TCHAR* InName
)

Public function

void

 

RHIBeginRenderQuery

(
    FRHIRenderQuery* RenderQuery
)

Public function

void

 

RHIBeginScene()

This method is queued with an RHIThread, otherwise it will flush after it is queued; without an RHI thread there is no benefit to queuing this frame advance commands.

Public function Virtual

void

 

RHIBeginUpdateMultiFrameResource

(
    FRHIUnorderedAccessView* UAV
)

Public function Virtual

void

 

RHIBeginUpdateMultiFrameResource

(
    FRHITexture* Texture
)

Signals the beginning and ending of rendering to a resource to be used in the next frame on a multiGPU system

Public function Virtual

void

 

RHIBindClearMRTValues

(
    bool bClearColor,
    bool bClearDepth,
    bool bClearStencil
)

Bind the clear state of the currently set rendertargets.

Public function Virtual

void

 

RHIBuildAccelerationStructure

(
    FRHIRayTracingGeometry* Geomet...
)

Public function Virtual

void

 

RHIBuildAccelerationStructure

(
    FRHIRayTracingScene* Scene
)

Public function Virtual

void

 

RHIBuildAccelerationStructures

(
    const TArrayView< const FAccelerati...
)

Public function Virtual

void

 

RHIClearRayTracingBindings

(
    FRHIRayTracingScene* Scene
)

Public function

void

 

RHIClearTinyUAV

(
    FRHIUnorderedAccessView* Unord...,
    const uint32* Values
)

Clears a UAV to the multi-component value provided.

Public function Virtual

void

 

RHICopyTexture

(
    FRHITexture* SourceTexture,
    FRHITexture* DestTexture,
    const FRHICopyTextureInfo& CopyInf...
)

Public function

void

 

RHICopyToResolveTarget

(
    FRHITexture* SourceTexture,
    FRHITexture* DestTexture,
    const FResolveParams& ResolveParam...
)

Resolves from one texture to another.

Public function Virtual

void

 

RHIDiscardRenderTargets

(
    bool Depth,
    bool Stencil,
    uint32 ColorBitMask
)

Not all RHIs need this (Mobile specific)

Public function

void

 

RHIDrawIndexedIndirect

(
    FRHIIndexBuffer* IndexBufferRH...,
    FRHIStructuredBuffer* Argument...,
    int32 DrawArgumentsIndex,
    uint32 NumInstances
)

Public function

void

 

RHIDrawIndexedPrimitive

(
    FRHIIndexBuffer* IndexBuffer,
    int32 BaseVertexIndex,
    uint32 FirstInstance,
    uint32 NumVertices,
    uint32 StartIndex,
    uint32 NumPrimitives,
    uint32 NumInstances
)

Public function

void

 

RHIDrawIndexedPrimitiveIndirect

(
    FRHIIndexBuffer* IndexBuffer,
    FRHIVertexBuffer* ArgumentBuff...,
    uint32 ArgumentOffset
)

Public function

void

 

RHIDrawPrimitive

(
    uint32 BaseVertexIndex,
    uint32 NumPrimitives,
    uint32 NumInstances
)

Public function

void

 

RHIDrawPrimitiveIndirect

(
    FRHIVertexBuffer* ArgumentBuff...,
    uint32 ArgumentOffset
)

Public function Virtual

void

 

RHIEndComputePass()

Public function

void

 

RHIEndDrawingViewport

(
    FRHIViewport* Viewport,
    bool bPresent,
    bool bLockToVsync
)

This method is queued with an RHIThread, otherwise it will flush after it is queued; without an RHI thread there is no benefit to queuing this frame advance commands.

Public function

void

 

RHIEndFrame()

This method is queued with an RHIThread, otherwise it will flush after it is queued; without an RHI thread there is no benefit to queuing this frame advance commands.

Public function Virtual

void

 

RHIEndRenderPass()

Public function

void

 

RHIEndRenderQuery

(
    FRHIRenderQuery* RenderQuery
)

Public function

void

 

RHIEndScene()

This method is queued with an RHIThread, otherwise it will flush after it is queued; without an RHI thread there is no benefit to queuing this frame advance commands.

Public function Virtual

void

 

RHIEndUpdateMultiFrameResource

(
    FRHIUnorderedAccessView* UAV
)

Public function Virtual

void

 

RHIEndUpdateMultiFrameResource

(
    FRHITexture* Texture
)

Public function

void

 

RHIFlushComputeShaderCache()

Public function Virtual

void

 

RHINextSubpass()

Public function Virtual

void

 

RHIPollOcclusionQueries()

Used for OpenGL to check and see if any occlusion queries can be read back on the RHI thread. If they aren't ready when we need them, then we end up stalling.

Public function Virtual

void

 

RHIRayTraceDispatch

(
    FRHIRayTracingPipelineState* R...,
    FRHIRayTracingShader* RayGenSh...,
    FRHIRayTracingScene* Scene,
    const FRayTracingShaderBindings& G...,
    uint32 Width,
    uint32 Height
)

Public function Virtual

void

 

RHIRayTraceIntersection

(
    FRHIRayTracingScene* Scene,
    FRHIShaderResourceView* Rays,
    FRHIUnorderedAccessView* Outpu...,
    uint32 NumRays
)

Public function Virtual

void

 

RHIRayTraceOcclusion

(
    FRHIRayTracingScene* Scene,
    FRHIShaderResourceView* Rays,
    FRHIUnorderedAccessView* Outpu...,
    uint32 NumRays
)

Public function Virtual

void

 

RHISetBlendFactor

(
    const FLinearColor& BlendFactor
)

Public function

void

 

RHISetDepthBounds

(
    float MinDepth,
    float MaxDepth
)

Sets Depth Bounds range with the given min/max depth.

Public function

void

 

RHISetGraphicsPipelineState

(
    FRHIGraphicsPipelineState* Gra...
)

Public function

void

 

RHISetMultipleViewports

(
    uint32 Count,
    const FViewportBounds* Data
)

Useful when used with geometry shader (emit polygons to different viewports), otherwise SetViewPort() is simpler

Public function Virtual

void

 

RHISetRayTracingCallableShader

(
    FRHIRayTracingScene* Scene,
    uint32 ShaderSlotInScene,
    FRHIRayTracingPipelineState* P...,
    uint32 ShaderIndexInPipeline,
    uint32 NumUniformBuffers,
    FRHIUniformBuffer*const* ...,
    uint32 UserData
)

Public function Virtual

void

 

RHISetRayTracingHitGroup

(
    FRHIRayTracingScene* Scene,
    uint32 InstanceIndex,
    uint32 SegmentIndex,
    uint32 ShaderSlot,
    FRHIRayTracingPipelineState* P...,
    uint32 HitGroupIndex,
    uint32 NumUniformBuffers,
    FRHIUniformBuffer*const* ...,
    uint32 LooseParameterDataSize,
    const void* LooseParameterData,
    uint32 UserData
)

Public function

void

 

RHISetRenderTargets

(
    uint32 NumSimultaneousRenderTargets,
    const FRHIRenderTargetView* Ne...,
    const FRHIDepthRenderTargetView...,
    uint32 NumUAVs,
    FRHIUnorderedAccessView*const ...
)

Public function

void

 

RHISetRenderTargetsAndClear

(
    const FRHISetRenderTargetsInfo& Re...
)

Public function

void

 

RHISetScissorRect

(
    bool bEnable,
    uint32 MinX,
    uint32 MinY,
    uint32 MaxX,
    uint32 MaxY
)

Public function

void

 

RHISetShaderParameter

(
    FRHIDomainShader* DomainShader,
    uint32 BufferIndex,
    uint32 BaseIndex,
    uint32 NumBytes,
    const void* NewValue
)

Public function

void

 

RHISetShaderParameter

(
    FRHIVertexShader* VertexShader,
    uint32 BufferIndex,
    uint32 BaseIndex,
    uint32 NumBytes,
    const void* NewValue
)

Public function

void

 

RHISetShaderParameter

(
    FRHIPixelShader* PixelShader,
    uint32 BufferIndex,
    uint32 BaseIndex,
    uint32 NumBytes,
    const void* NewValue
)

Public function

void

 

RHISetShaderParameter

(
    FRHIHullShader* HullShader,
    uint32 BufferIndex,
    uint32 BaseIndex,
    uint32 NumBytes,
    const void* NewValue
)

Public function

void

 

RHISetShaderParameter

(
    FRHIGeometryShader* GeometrySh...,
    uint32 BufferIndex,
    uint32 BaseIndex,
    uint32 NumBytes,
    const void* NewValue
)

Public function

void

 

RHISetShaderResourceViewParameter

(
    FRHIGeometryShader* GeometrySh...,
    uint32 SamplerIndex,
    FRHIShaderResourceView* SRV
)

Public function

void

 

RHISetShaderResourceViewParameter

(
    FRHIDomainShader* DomainShader,
    uint32 SamplerIndex,
    FRHIShaderResourceView* SRV
)

Public function

void

 

RHISetShaderResourceViewParameter

(
    FRHIHullShader* HullShader,
    uint32 SamplerIndex,
    FRHIShaderResourceView* SRV
)

Public function

void

 

RHISetShaderResourceViewParameter

(
    FRHIPixelShader* PixelShader,
    uint32 SamplerIndex,
    FRHIShaderResourceView* SRV
)

Public function

void

 

RHISetShaderResourceViewParameter

(
    FRHIVertexShader* VertexShader,
    uint32 SamplerIndex,
    FRHIShaderResourceView* SRV
)

Public function

void

 

RHISetShaderSampler

(
    FRHIPixelShader* PixelShader,
    uint32 SamplerIndex,
    FRHISamplerState* NewState
)

Sets sampler state.

Public function

void

 

RHISetShaderSampler

(
    FRHIVertexShader* VertexShader,
    uint32 SamplerIndex,
    FRHISamplerState* NewState
)

Sets sampler state.

Public function

void

 

RHISetShaderSampler

(
    FRHIGeometryShader* GeometrySh...,
    uint32 SamplerIndex,
    FRHISamplerState* NewState
)

Sets sampler state.

Public function

void

 

RHISetShaderSampler

(
    FRHIDomainShader* DomainShader,
    uint32 SamplerIndex,
    FRHISamplerState* NewState
)

Sets sampler state.

Public function

void

 

RHISetShaderSampler

(
    FRHIHullShader* HullShader,
    uint32 SamplerIndex,
    FRHISamplerState* NewState
)

Sets sampler state.

Public function

void

 

RHISetShaderTexture

(
    FRHIVertexShader* VertexShader,
    uint32 TextureIndex,
    FRHITexture* NewTexture
)

Set the shader resource view of a surface.

Public function

void

 

RHISetShaderTexture

(
    FRHIHullShader* HullShader,
    uint32 TextureIndex,
    FRHITexture* NewTexture
)

Set the shader resource view of a surface.

Public function

void

 

RHISetShaderTexture

(
    FRHIDomainShader* DomainShader,
    uint32 TextureIndex,
    FRHITexture* NewTexture
)

Set the shader resource view of a surface.

Public function

void

 

RHISetShaderTexture

(
    FRHIGeometryShader* GeometrySh...,
    uint32 TextureIndex,
    FRHITexture* NewTexture
)

Set the shader resource view of a surface.

Public function

void

 

RHISetShaderTexture

(
    FRHIPixelShader* PixelShader,
    uint32 TextureIndex,
    FRHITexture* NewTexture
)

Set the shader resource view of a surface.

Public function

void

 

RHISetShaderUniformBuffer

(
    FRHIGeometryShader* GeometrySh...,
    uint32 BufferIndex,
    FRHIUniformBuffer* Buffer
)

Public function

void

 

RHISetShaderUniformBuffer

(
    FRHIHullShader* HullShader,
    uint32 BufferIndex,
    FRHIUniformBuffer* Buffer
)

Public function

void

 

RHISetShaderUniformBuffer

(
    FRHIDomainShader* DomainShader,
    uint32 BufferIndex,
    FRHIUniformBuffer* Buffer
)

Public function

void

 

RHISetShaderUniformBuffer

(
    FRHIPixelShader* PixelShader,
    uint32 BufferIndex,
    FRHIUniformBuffer* Buffer
)

Public function

void

 

RHISetShaderUniformBuffer

(
    FRHIVertexShader* VertexShader,
    uint32 BufferIndex,
    FRHIUniformBuffer* Buffer
)

Public function Virtual

void

 

RHISetStencilRef

(
    uint32 StencilRef
)

Public function Virtual

void

 

RHISetStereoViewport

(
    uint32 LeftMinX,
    uint32 RightMinX,
    uint32 LeftMinY,
    uint32 RightMinY,
    float MinZ,
    uint32 LeftMaxX,
    uint32 RightMaxX,
    uint32 LeftMaxY,
    uint32 RightMaxY,
    float MaxZ
)

Public function

void

 

RHISetStreamSource

(
    uint32 StreamIndex,
    FRHIVertexBuffer* VertexBuffer,
    uint32 Offset
)

Public function

void

 

RHISetViewport

(
    uint32 MinX,
    uint32 MinY,
    float MinZ,
    uint32 MaxX,
    uint32 MaxY,
    float MaxZ
)

Public function

void

 

RHITransitionResources

(
    EResourceTransitionAccess Transitio...,
    EResourceTransitionPipeline Transit...,
    FRHIUnorderedAccessView** ...,
    int32 NumUAVs
)

Public function Virtual

void

 

RHITransitionResources

(
    EResourceTransitionAccess Transitio...,
    FRHITexture** InTextures,
    int32 NumTextures
)

Explicitly transition a texture resource from readable -> writable by the GPU or vice versa.

Public function Virtual

void

 

RHIUpdateAccelerationStructures

(
    const TArrayView< const FAccelerati...
)

Public function

void

 

RHIUpdateTextureReference

(
    FRHITextureReference* TextureR...,
    FRHITexture* NewTexture
)

Overridden from IRHIComputeContext

Name Description

Public function

void

 

RHIDispatchComputeShader

(
    uint32 ThreadGroupCountX,
    uint32 ThreadGroupCountY,
    uint32 ThreadGroupCountZ
)

Public function

void

 

RHIDispatchIndirectComputeShader

(
    FRHIVertexBuffer* ArgumentBuff...,
    uint32 ArgumentOffset
)

Public function

void

 

RHISetShaderParameter

(
    FRHIComputeShader* ComputeShad...,
    uint32 BufferIndex,
    uint32 BaseIndex,
    uint32 NumBytes,
    const void* NewValue
)

Public function

void

 

RHISetShaderResourceViewParameter

(
    FRHIComputeShader* ComputeShad...,
    uint32 SamplerIndex,
    FRHIShaderResourceView* SRV
)

Public function

void

 

RHISetShaderSampler

(
    FRHIComputeShader* ComputeShad...,
    uint32 SamplerIndex,
    FRHISamplerState* NewState
)

Sets sampler state.

Public function

void

 

RHISetShaderTexture

(
    FRHIComputeShader* PixelShader,
    uint32 TextureIndex,
    FRHITexture* NewTexture
)

Set the shader resource view of a surface.

Public function

void

 

RHISetShaderUniformBuffer

(
    FRHIComputeShader* ComputeShad...,
    uint32 BufferIndex,
    FRHIUniformBuffer* Buffer
)

Public function

void

 

RHISetUAVParameter

(
    FRHIComputeShader* ComputeShad...,
    uint32 UAVIndex,
    FRHIUnorderedAccessView* UAV
)

Sets a compute shader UAV parameter.

Public function

void

 

RHISetUAVParameter

(
    FRHIComputeShader* ComputeShad...,
    uint32 UAVIndex,
    FRHIUnorderedAccessView* UAV,
    uint32 InitialCount
)

Sets a compute shader counted UAV parameter and initial count

Public function Virtual

void

 

RHITransitionResources

(
    EResourceTransitionAccess Transitio...,
    EResourceTransitionPipeline Transit...,
    FRHIUnorderedAccessView** ...,
    int32 NumUAVs,
    FRHIComputeFence* WriteCompute...
)

Explicitly transition a UAV from readable -> writable by the GPU or vice versa.

Public function Virtual

void

 

RHIWaitComputeFence

(
    FRHIComputeFence* InFence
)

Compute queue will wait for the fence to be written before continuing.

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback