Device context interface. More...
#include <DeviceContext.h>
Public Member Functions | |
virtual const DeviceContextDesc &DILIGENT_CALL_TYPE | GetDesc () const =0 |
Returns the context description. | |
virtual void DILIGENT_CALL_TYPE | Begin (Uint32 ImmediateContextId)=0 |
Begins recording commands in the deferred context. | |
virtual void DILIGENT_CALL_TYPE | SetPipelineState (IPipelineState *pPipelineState)=0 |
Sets the pipeline state. | |
virtual void DILIGENT_CALL_TYPE | TransitionShaderResources (IShaderResourceBinding *pShaderResourceBinding)=0 |
virtual void DILIGENT_CALL_TYPE | CommitShaderResources (IShaderResourceBinding *pShaderResourceBinding, RESOURCE_STATE_TRANSITION_MODE StateTransitionMode)=0 |
Commits shader resources to the device context. | |
virtual void DILIGENT_CALL_TYPE | SetStencilRef (Uint32 StencilRef)=0 |
Sets the stencil reference value. | |
virtual void DILIGENT_CALL_TYPE | SetBlendFactors (const float *pBlendFactors=nullptr)=0 |
Sets the blend factors for alpha blending. | |
virtual void DILIGENT_CALL_TYPE | SetVertexBuffers (Uint32 StartSlot, Uint32 NumBuffersSet, IBuffer *const *ppBuffers, const Uint64 *pOffsets, RESOURCE_STATE_TRANSITION_MODE StateTransitionMode, SET_VERTEX_BUFFERS_FLAGS Flags=SET_VERTEX_BUFFERS_FLAG_NONE)=0 |
Binds vertex buffers to the pipeline. | |
virtual void DILIGENT_CALL_TYPE | InvalidateState ()=0 |
Invalidates the cached context state. | |
virtual void DILIGENT_CALL_TYPE | SetIndexBuffer (IBuffer *pIndexBuffer, Uint64 ByteOffset, RESOURCE_STATE_TRANSITION_MODE StateTransitionMode)=0 |
Binds an index buffer to the pipeline. | |
virtual void DILIGENT_CALL_TYPE | SetViewports (Uint32 NumViewports, const Viewport *pViewports, Uint32 RTWidth, Uint32 RTHeight)=0 |
Sets an array of viewports. | |
virtual void DILIGENT_CALL_TYPE | SetScissorRects (Uint32 NumRects, const Rect *pRects, Uint32 RTWidth, Uint32 RTHeight)=0 |
Sets active scissor rects. | |
virtual void DILIGENT_CALL_TYPE | SetRenderTargets (Uint32 NumRenderTargets, ITextureView *ppRenderTargets[], ITextureView *pDepthStencil, RESOURCE_STATE_TRANSITION_MODE StateTransitionMode)=0 |
virtual void DILIGENT_CALL_TYPE | SetRenderTargetsExt (const SetRenderTargetsAttribs &Attribs)=0 |
virtual void DILIGENT_CALL_TYPE | BeginRenderPass (const BeginRenderPassAttribs &Attribs)=0 |
Begins a new render pass. | |
virtual void DILIGENT_CALL_TYPE | NextSubpass ()=0 |
Transitions to the next subpass in the render pass instance. | |
virtual void DILIGENT_CALL_TYPE | EndRenderPass ()=0 |
Ends current render pass. | |
virtual void DILIGENT_CALL_TYPE | Draw (const DrawAttribs &Attribs)=0 |
Executes a draw command. | |
virtual void DILIGENT_CALL_TYPE | DrawIndexed (const DrawIndexedAttribs &Attribs)=0 |
Executes an indexed draw command. | |
virtual void DILIGENT_CALL_TYPE | DrawIndirect (const DrawIndirectAttribs &Attribs)=0 |
Executes an indirect draw command. | |
virtual void DILIGENT_CALL_TYPE | DrawIndexedIndirect (const DrawIndexedIndirectAttribs &Attribs)=0 |
Executes an indexed indirect draw command. | |
virtual void DILIGENT_CALL_TYPE | DrawMesh (const DrawMeshAttribs &Attribs)=0 |
Executes a mesh draw command. | |
virtual void DILIGENT_CALL_TYPE | DrawMeshIndirect (const DrawMeshIndirectAttribs &Attribs)=0 |
Executes an indirect mesh draw command. | |
virtual void DILIGENT_CALL_TYPE | MultiDraw (const MultiDrawAttribs &Attribs)=0 |
Executes a multi-draw command. | |
virtual void DILIGENT_CALL_TYPE | MultiDrawIndexed (const MultiDrawIndexedAttribs &Attribs)=0 |
Executes an indexed multi-draw command. | |
virtual void DILIGENT_CALL_TYPE | DispatchCompute (const DispatchComputeAttribs &Attribs)=0 |
Executes a dispatch compute command. | |
virtual void DILIGENT_CALL_TYPE | DispatchComputeIndirect (const DispatchComputeIndirectAttribs &Attribs)=0 |
Executes an indirect dispatch compute command. | |
virtual void DILIGENT_CALL_TYPE | DispatchTile (const DispatchTileAttribs &Attribs)=0 |
Executes a dispatch tile command. | |
virtual void DILIGENT_CALL_TYPE | GetTileSize (Uint32 &TileSizeX, Uint32 &TileSizeY)=0 |
Returns current render pass tile size. | |
virtual void DILIGENT_CALL_TYPE | ClearDepthStencil (ITextureView *pView, CLEAR_DEPTH_STENCIL_FLAGS ClearFlags, float fDepth, Uint8 Stencil, RESOURCE_STATE_TRANSITION_MODE StateTransitionMode)=0 |
Clears a depth-stencil view. | |
virtual void DILIGENT_CALL_TYPE | ClearRenderTarget (ITextureView *pView, const void *RGBA, RESOURCE_STATE_TRANSITION_MODE StateTransitionMode)=0 |
Clears a render target view. | |
virtual void DILIGENT_CALL_TYPE | FinishCommandList (ICommandList **ppCommandList)=0 |
Finishes recording commands and generates a command list. | |
virtual void DILIGENT_CALL_TYPE | ExecuteCommandLists (Uint32 NumCommandLists, ICommandList *const *ppCommandLists)=0 |
Submits an array of recorded command lists for execution. | |
virtual void DILIGENT_CALL_TYPE | EnqueueSignal (IFence *pFence, Uint64 Value)=0 |
Tells the GPU to set a fence to a specified value after all previous work has completed. | |
virtual void DILIGENT_CALL_TYPE | DeviceWaitForFence (IFence *pFence, Uint64 Value)=0 |
Waits until the specified fence reaches or exceeds the specified value, on the device. | |
virtual void DILIGENT_CALL_TYPE | WaitForIdle ()=0 |
Submits all outstanding commands for execution to the GPU and waits until they are complete. | |
virtual void DILIGENT_CALL_TYPE | BeginQuery (IQuery *pQuery)=0 |
Marks the beginning of a query. | |
virtual void DILIGENT_CALL_TYPE | EndQuery (IQuery *pQuery)=0 |
Marks the end of a query. | |
virtual void DILIGENT_CALL_TYPE | Flush ()=0 |
Submits all pending commands in the context for execution to the command queue. | |
virtual void DILIGENT_CALL_TYPE | UpdateBuffer (IBuffer *pBuffer, Uint64 Offset, Uint64 Size, const void *pData, RESOURCE_STATE_TRANSITION_MODE StateTransitionMode)=0 |
Updates the data in the buffer. | |
virtual void DILIGENT_CALL_TYPE | CopyBuffer (IBuffer *pSrcBuffer, Uint64 SrcOffset, RESOURCE_STATE_TRANSITION_MODE SrcBufferTransitionMode, IBuffer *pDstBuffer, Uint64 DstOffset, Uint64 Size, RESOURCE_STATE_TRANSITION_MODE DstBufferTransitionMode)=0 |
Copies the data from one buffer to another. | |
virtual void DILIGENT_CALL_TYPE | MapBuffer (IBuffer *pBuffer, MAP_TYPE MapType, MAP_FLAGS MapFlags, PVoid &pMappedData)=0 |
Maps the buffer. | |
virtual void DILIGENT_CALL_TYPE | UnmapBuffer (IBuffer *pBuffer, MAP_TYPE MapType)=0 |
Unmaps the previously mapped buffer. | |
virtual void DILIGENT_CALL_TYPE | UpdateTexture (ITexture *pTexture, Uint32 MipLevel, Uint32 Slice, const Box &DstBox, const TextureSubResData &SubresData, RESOURCE_STATE_TRANSITION_MODE SrcBufferTransitionMode, RESOURCE_STATE_TRANSITION_MODE TextureTransitionMode)=0 |
Updates the data in the texture. | |
virtual void DILIGENT_CALL_TYPE | CopyTexture (const CopyTextureAttribs &CopyAttribs)=0 |
Copies data from one texture to another. | |
virtual void DILIGENT_CALL_TYPE | MapTextureSubresource (ITexture *pTexture, Uint32 MipLevel, Uint32 ArraySlice, MAP_TYPE MapType, MAP_FLAGS MapFlags, const Box *pMapRegion, MappedTextureSubresource &MappedData)=0 |
Maps the texture subresource. | |
virtual void DILIGENT_CALL_TYPE | UnmapTextureSubresource (ITexture *pTexture, Uint32 MipLevel, Uint32 ArraySlice)=0 |
Unmaps the texture subresource. | |
virtual void DILIGENT_CALL_TYPE | GenerateMips (ITextureView *pTextureView)=0 |
Generates a mipmap chain. | |
virtual void DILIGENT_CALL_TYPE | FinishFrame ()=0 |
Finishes the current frame and releases dynamic resources allocated by the context. | |
virtual Uint64 DILIGENT_CALL_TYPE | GetFrameNumber () const =0 |
Returns the current frame number. | |
virtual void DILIGENT_CALL_TYPE | TransitionResourceStates (Uint32 BarrierCount, const StateTransitionDesc *pResourceBarriers)=0 |
Transitions resource states. | |
virtual void DILIGENT_CALL_TYPE | ResolveTextureSubresource (ITexture *pSrcTexture, ITexture *pDstTexture, const ResolveTextureSubresourceAttribs &ResolveAttribs)=0 |
Resolves a multi-sampled texture subresource into a non-multi-sampled texture subresource. | |
virtual void DILIGENT_CALL_TYPE | BuildBLAS (const BuildBLASAttribs &Attribs)=0 |
Builds a bottom-level acceleration structure with the specified geometries. | |
virtual void DILIGENT_CALL_TYPE | BuildTLAS (const BuildTLASAttribs &Attribs)=0 |
Builds a top-level acceleration structure with the specified instances. | |
virtual void DILIGENT_CALL_TYPE | CopyBLAS (const CopyBLASAttribs &Attribs)=0 |
Copies data from one acceleration structure to another. | |
virtual void DILIGENT_CALL_TYPE | CopyTLAS (const CopyTLASAttribs &Attribs)=0 |
Copies data from one acceleration structure to another. | |
virtual void DILIGENT_CALL_TYPE | WriteBLASCompactedSize (const WriteBLASCompactedSizeAttribs &Attribs)=0 |
Writes a bottom-level acceleration structure memory size required for compacting operation to a buffer. | |
virtual void DILIGENT_CALL_TYPE | WriteTLASCompactedSize (const WriteTLASCompactedSizeAttribs &Attribs)=0 |
Writes a top-level acceleration structure memory size required for compacting operation to a buffer. | |
virtual void DILIGENT_CALL_TYPE | TraceRays (const TraceRaysAttribs &Attribs)=0 |
Executes a trace rays command. | |
virtual void DILIGENT_CALL_TYPE | TraceRaysIndirect (const TraceRaysIndirectAttribs &Attribs)=0 |
Executes an indirect trace rays command. | |
virtual void DILIGENT_CALL_TYPE | UpdateSBT (IShaderBindingTable *pSBT, const UpdateIndirectRTBufferAttribs *pUpdateIndirectBufferAttribs=nullptr)=0 |
Updates SBT with the pending data that were recorded in IShaderBindingTable::Bind*** calls. | |
virtual void DILIGENT_CALL_TYPE | SetUserData (IObject *pUserData)=0 |
Stores a pointer to the user-provided data object. | |
virtual IObject *DILIGENT_CALL_TYPE | GetUserData () const =0 |
Returns a pointer to the user data object previously. | |
virtual void DILIGENT_CALL_TYPE | BeginDebugGroup (const Char *Name, const float *pColor=nullptr)=0 |
Begins a debug group with name and color. | |
virtual void DILIGENT_CALL_TYPE | EndDebugGroup ()=0 |
Ends a debug group that was previously started with BeginDebugGroup(). | |
virtual void DILIGENT_CALL_TYPE | InsertDebugLabel (const Char *Label, const float *pColor=nullptr)=0 |
Inserts a debug label with name and color. | |
virtual ICommandQueue *DILIGENT_CALL_TYPE | LockCommandQueue ()=0 |
Locks the internal mutex and returns a pointer to the command queue that is associated with this device context. | |
virtual void DILIGENT_CALL_TYPE | UnlockCommandQueue ()=0 |
Unlocks the command queue that was previously locked by LockCommandQueue(). | |
virtual void DILIGENT_CALL_TYPE | SetShadingRate (SHADING_RATE BaseRate, SHADING_RATE_COMBINER PrimitiveCombiner, SHADING_RATE_COMBINER TextureCombiner)=0 |
Sets the shading base rate and combiners. | |
virtual void DILIGENT_CALL_TYPE | BindSparseResourceMemory (const BindSparseResourceMemoryAttribs &Attribs)=0 |
Binds or unbinds memory objects to sparse buffer and sparse textures. | |
virtual void DILIGENT_CALL_TYPE | ClearStats ()=0 |
Clears the device context statistics. | |
virtual const DeviceContextStats &DILIGENT_CALL_TYPE | GetStats () const =0 |
Returns the device context statistics, see Diligent::DeviceContextStats. | |
![]() | |
virtual void DILIGENT_CALL_TYPE | QueryInterface (const INTERFACE_ID &IID, IObject **ppInterface)=0 |
Queries the specific interface. | |
virtual ReferenceCounterValueType DILIGENT_CALL_TYPE | AddRef ()=0 |
Increments the number of strong references by 1. | |
virtual ReferenceCounterValueType DILIGENT_CALL_TYPE | Release ()=0 |
virtual IReferenceCounters *DILIGENT_CALL_TYPE | GetReferenceCounters () const =0 |
Device context interface.
|
pure virtual |
Begins recording commands in the deferred context.
This method must be called before any command in the deferred context may be recorded.
[in] | ImmediateContextId | - the ID of the immediate context where commands from this deferred context will be executed, see Diligent::DeviceContextDesc::ContextId. |
Implemented in Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Begins a debug group with name and color.
External debug tools may use this information when displaying context commands.
[in] | Name | - Group name. |
[in] | pColor | - Region color. |
Implemented in Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Marks the beginning of a query.
[in] | pQuery | - A pointer to a query object. |
Vulkan requires that a query must either begin and end inside the same subpass of a render pass instance, or must both begin and end outside of a render pass instance. This means that an application must either begin and end a query while preserving render targets, or begin it when no render targets are bound to the context. In the latter case the engine will automatically end the render pass, if needed, when the query is ended. Also note that resource transitions must be performed outside of a render pass, and may thus require ending current render pass. To explicitly end current render pass, call SetRenderTargets(0, nullptr, nullptr, RESOURCE_STATE_TRANSITION_MODE_NONE).
Implemented in Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Begins a new render pass.
[in] | Attribs | - The command attributes, see Diligent::BeginRenderPassAttribs for details. |
Implemented in Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Binds or unbinds memory objects to sparse buffer and sparse textures.
[in] | Attribs | - command attributes, see Diligent::BindSparseResourceMemoryAttribs. |
This command implicitly calls Flush().
Implemented in Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Builds a bottom-level acceleration structure with the specified geometries.
[in] | Attribs | - Structure describing build BLAS command attributes, see Diligent::BuildBLASAttribs for details. |
Implemented in Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Builds a top-level acceleration structure with the specified instances.
[in] | Attribs | - Structure describing build TLAS command attributes, see Diligent::BuildTLASAttribs for details. |
Implemented in Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Clears a depth-stencil view.
[in] | pView | - Pointer to ITextureView interface to clear. The view type must be Diligent::TEXTURE_VIEW_DEPTH_STENCIL. |
[in] | StateTransitionMode | - state transition mode of the depth-stencil buffer to clear. |
[in] | ClearFlags | - Indicates which parts of the buffer to clear, see Diligent::CLEAR_DEPTH_STENCIL_FLAGS. |
[in] | fDepth | - Value to clear depth part of the view with. |
[in] | Stencil | - Value to clear stencil part of the view with. |
When StateTransitionMode
is Diligent::RESOURCE_STATE_TRANSITION_MODE_TRANSITION, the method will transition the state of the texture to the state required by clear operation. In Direct3D12, this state is always Diligent::RESOURCE_STATE_DEPTH_WRITE, however in Vulkan the state depends on whether the depth buffer is bound to the pipeline.
Resource state transitioning is not thread-safe, so no other thread is allowed to read or write the state of resources used by the command.
Implemented in Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Clears a render target view.
[in] | pView | - Pointer to ITextureView interface to clear. The view type must be Diligent::TEXTURE_VIEW_RENDER_TARGET. |
[in] | RGBA | - A 4-component array that represents the color to fill the render target with: |
[in] | StateTransitionMode | - Defines required state transitions (see Diligent::RESOURCE_STATE_TRANSITION_MODE) |
The full extent of the view is always cleared. Viewport and scissor settings are not applied.
When StateTransitionMode is Diligent::RESOURCE_STATE_TRANSITION_MODE_TRANSITION, the method will transition the texture to the state required by the command. Resource state transitioning is not thread safe, so no other thread is allowed to read or write the states of the same textures.
If the application intends to use the same resource in other threads simultaneously, it needs to explicitly manage the states using TransitionResourceStates() method.
In D3D12 backend, clearing render targets requires textures to always be transitioned to Diligent::RESOURCE_STATE_RENDER_TARGET state. In Vulkan backend however this depends on whether a render pass has been started. To clear render target outside of a render pass, the texture must be transitioned to Diligent::RESOURCE_STATE_COPY_DEST state. Inside a render pass it must be in Diligent::RESOURCE_STATE_RENDER_TARGET state. When using Diligent::RESOURCE_STATE_TRANSITION_TRANSITION mode, the engine takes care of proper resource state transition, otherwise it is the responsibility of the application.
Implemented in Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Commits shader resources to the device context.
[in] | pShaderResourceBinding | - Shader resource binding whose resources will be committed. If pipeline state contains no shader resources, this parameter can be null. |
[in] | StateTransitionMode | - State transition mode (see Diligent::RESOURCE_STATE_TRANSITION_MODE). |
If Diligent::RESOURCE_STATE_TRANSITION_MODE_TRANSITION mode is used, the engine will also transition all shader resources to required states. If the flag is not set, it is assumed that all resources are already in correct states.
Resources can be explicitly transitioned to required states by calling TransitionShaderResources() or TransitionResourceStates().
If the application intends to use the same resources in other threads simultaneously, it should manage the states manually by setting the state to Diligent::RESOURCE_STATE_UNKNOWN (which will disable automatic state management) using IBuffer::SetState() or ITexture::SetState() and explicitly transitioning the states with TransitionResourceStates().
If an application calls any method that changes the state of any resource after it has been committed, the application is responsible for transitioning the resource back to correct state using one of the available methods before issuing the next draw or dispatch command.
Implemented in Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Copies data from one acceleration structure to another.
[in] | Attribs | - Structure describing copy BLAS command attributes, see Diligent::CopyBLASAttribs for details. |
Implemented in Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Copies the data from one buffer to another.
[in] | pSrcBuffer | - Source buffer to copy data from. |
[in] | SrcOffset | - Offset in bytes from the beginning of the source buffer to the beginning of data to copy. |
[in] | SrcBufferTransitionMode | - State transition mode of the source buffer (see Diligent::RESOURCE_STATE_TRANSITION_MODE). |
[in] | pDstBuffer | - Destination buffer to copy data to. |
[in] | DstOffset | - Offset in bytes from the beginning of the destination buffer to the beginning of the destination region. |
[in] | Size | - Size in bytes of data to copy. |
[in] | DstBufferTransitionMode | - State transition mode of the destination buffer (see Diligent::RESOURCE_STATE_TRANSITION_MODE). |
Implemented in Diligent::DeviceContextBase< EngineWebGPUImplTraits >, and Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Copies data from one texture to another.
[in] | CopyAttribs | - Structure describing copy command attributes, see Diligent::CopyTextureAttribs for details. |
Implemented in Diligent::DeviceContextBase< EngineWebGPUImplTraits >, and Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Copies data from one acceleration structure to another.
[in] | Attribs | - Structure describing copy TLAS command attributes, see Diligent::CopyTLASAttribs for details. |
Implemented in Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Waits until the specified fence reaches or exceeds the specified value, on the device.
[in] | pFence | - The fence to wait. Fence must be created with type FENCE_TYPE_GENERAL. |
[in] | Value | - The value that the context is waiting for the fence to reach. |
If NativeFence feature is not enabled (see Diligent::DeviceFeatures) then Value must be less than or equal to the last signaled or pending value. Value becomes pending when the context is flushed. Waiting for a value that is greater than any pending value will cause a deadlock.
In Direct3D12 and Vulkan backend, the access to the fence is thread-safe.
Implemented in Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Executes a dispatch compute command.
[in] | Attribs | - Dispatch command attributes, see Diligent::DispatchComputeAttribs for details. |
In Metal, the compute group sizes are defined by the dispatch command rather than by the compute shader. When the shader is compiled from HLSL or GLSL, the engine will use the group size information from the shader. When using MSL, an application should provide the compute group dimensions through MtlThreadGroupSizeX
, MtlThreadGroupSizeY
, and MtlThreadGroupSizeZ
members.
Implemented in Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Executes an indirect dispatch compute command.
[in] | Attribs | - The command attributes, see Diligent::DispatchComputeIndirectAttribs for details. |
If IndirectAttribsBufferStateTransitionMode
member is Diligent::RESOURCE_STATE_TRANSITION_MODE_TRANSITION, the method may transition the state of indirect dispatch arguments buffer. This is not a thread safe operation, so no other thread is allowed to read or write the state of the same resource.
If the application intends to use the same resources in other threads simultaneously, it needs to explicitly manage the states using TransitionResourceStates() method.
In Metal, the compute group sizes are defined by the dispatch command rather than by the compute shader. When the shader is compiled from HLSL or GLSL, the engine will use the group size information from the shader. When using MSL, an application should provide the compute group dimensions through MtlThreadGroupSizeX
, MtlThreadGroupSizeY
, and MtlThreadGroupSizeZ
members.
Implemented in Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Executes a dispatch tile command.
[in] | Attribs | - The command attributes, see Diligent::DispatchTileAttribs for details. |
Implemented in Diligent::DeviceContextBase< EngineWebGPUImplTraits >.
|
pure virtual |
Executes a draw command.
[in] | Attribs | - Draw command attributes, see Diligent::DrawAttribs for details. |
If Diligent::DRAW_FLAG_VERIFY_STATES flag is set, the method reads the state of vertex buffers, so no other threads are allowed to alter the states of the same resources. It is OK to read these states.
If the application intends to use the same resources in other threads simultaneously, it needs to explicitly manage the states using TransitionResourceStates() method.
Implemented in Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Executes an indexed draw command.
[in] | Attribs | - Draw command attributes, see Diligent::DrawIndexedAttribs for details. |
If Diligent::DRAW_FLAG_VERIFY_STATES flag is set, the method reads the state of vertex/index buffers, so no other threads are allowed to alter the states of the same resources. It is OK to read these states.
If the application intends to use the same resources in other threads simultaneously, it needs to explicitly manage the states using TransitionResourceStates() method.
Implemented in Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Executes an indexed indirect draw command.
[in] | Attribs | - Structure describing the command attributes, see Diligent::DrawIndexedIndirectAttribs for details. |
Draw command arguments are read from the attributes buffer at the offset given by Attribs.IndirectDrawArgsOffset. If Attribs.DrawCount > 1
, the arguments for command N will be read at the offset
Attribs.IndirectDrawArgsOffset + N * Attribs.IndirectDrawArgsStride.
If pCountBuffer is not null, the number of commands to execute will be read from the buffer at the offset given by Attribs.CounterOffset. The number of commands will be the lesser of the value read from the buffer and Attribs.DrawCount:
NumCommands = min(CountBuffer[Attribs.CounterOffset], Attribs.DrawCount)
If Attribs.IndirectAttribsBufferStateTransitionMode
or Attribs.CounterBufferStateTransitionMode
is Diligent::RESOURCE_STATE_TRANSITION_MODE_TRANSITION, the method may transition the state of the indirect draw arguments buffer, and the state of the counter buffer . This is not a thread safe operation, so no other thread is allowed to read or write the state of the buffer.
If Diligent::DRAW_FLAG_VERIFY_STATES flag is set, the method reads the state of vertex/index buffers, so no other threads are allowed to alter the states of the same resources. It is OK to read these states.
If the application intends to use the same resources in other threads simultaneously, it needs to explicitly manage the states using TransitionResourceStates() method.
Implemented in Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Executes an indirect draw command.
[in] | Attribs | - Structure describing the command attributes, see Diligent::DrawIndirectAttribs for details. |
Draw command arguments are read from the attributes buffer at the offset given by Attribs.IndirectDrawArgsOffset. If Attribs.DrawCount > 1
, the arguments for command N will be read at the offset
Attribs.IndirectDrawArgsOffset + N * Attribs.IndirectDrawArgsStride.
If pCountBuffer is not null, the number of commands to execute will be read from the buffer at the offset given by Attribs.CounterOffset. The number of commands will be the lesser of the value read from the buffer and Attribs.DrawCount:
NumCommands = min(CountBuffer[Attribs.CounterOffset], Attribs.DrawCount)
If Attribs.IndirectAttribsBufferStateTransitionMode
or Attribs.CounterBufferStateTransitionMode
is Diligent::RESOURCE_STATE_TRANSITION_MODE_TRANSITION, the method may transition the state of the indirect draw arguments buffer, and the state of the counter buffer . This is not a thread safe operation, so no other thread is allowed to read or write the state of the buffer.
If Diligent::DRAW_FLAG_VERIFY_STATES flag is set, the method reads the state of vertex/index buffers, so no other threads are allowed to alter the states of the same resources. It is OK to read these states.
If the application intends to use the same resources in other threads simultaneously, it needs to explicitly manage the states using TransitionResourceStates() method.
Implemented in Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Executes a mesh draw command.
[in] | Attribs | - Draw command attributes, see Diligent::DrawMeshAttribs for details. |
For compatibility between Direct3D12 and Vulkan, only a single work group dimension is used. Also in the shader, numthreads
and local_size
attributes must define only the first dimension, for example: [numthreads(ThreadCount, 1, 1)]
or layout(local_size_x = ThreadCount) in
.
Implemented in Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Executes an indirect mesh draw command.
[in] | Attribs | - Structure describing the command attributes, see Diligent::DrawMeshIndirectAttribs for details. |
For compatibility between Direct3D12 and Vulkan and with direct call (DrawMesh) use the first element in the structure, for example:
{TaskCount, 1, 1}
{TaskCount, 0}
.If IndirectAttribsBufferStateTransitionMode
member is Diligent::RESOURCE_STATE_TRANSITION_MODE_TRANSITION, the method may transition the state of the indirect draw arguments buffer. This is not a thread safe operation, so no other thread is allowed to read or write the state of the buffer.
If the application intends to use the same resources in other threads simultaneously, it needs to explicitly manage the states using TransitionResourceStates() method.
Implemented in Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Marks the end of a query.
[in] | pQuery | - A pointer to a query object. |
In Direct3D12 and Vulkan, queries (except for timestamp queries) cannot span command list boundaries, so the engine will never flush the context even if the number of commands exceeds the user-specified limit when there is an active query. It is an error to explicitly flush the context while a query is active.
All queries must be ended when FinishFrame() is called.
Implemented in Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Ends current render pass.
Implemented in Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Tells the GPU to set a fence to a specified value after all previous work has completed.
[in] | pFence | - The fence to signal. |
[in] | Value | - The value to set the fence to. This value must be greater than the previously signaled value on the same fence. |
Implemented in Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Submits an array of recorded command lists for execution.
[in] | NumCommandLists | - The number of command lists to execute. |
[in] | ppCommandLists | - Pointer to the array of NumCommandLists command lists to execute. |
Implemented in Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Finishes recording commands and generates a command list.
[out] | ppCommandList | - Memory location where pointer to the recorded command list will be written. |
Implemented in Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Finishes the current frame and releases dynamic resources allocated by the context.
For immediate context, this method is called automatically by ISwapChain::Present() of the primary swap chain, but can also be called explicitly. For deferred contexts, the method must be called by the application to release dynamic resources. The method has some overhead, so it is better to call it once per frame, though it can be called with different frequency. Note that unless the GPU is idled, the resources may actually be released several frames after the one they were used in last time.
For deferred contexts, this method must be called after all command lists referencing dynamic resources have been executed through immediate context.
The method does not Flush() the context.
Implemented in Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Submits all pending commands in the context for execution to the command queue.
Only immediate contexts can be flushed.
Internally the method resets the state of the current command list/buffer. When the next draw command is issued, the engine will restore all states (rebind render targets and depth-stencil buffer as well as index and vertex buffers, restore viewports and scissor rects, etc.) except for the pipeline state and shader resource bindings. An application must explicitly reset the PSO and bind all required shader resources after flushing the context.
Implemented in Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Generates a mipmap chain.
[in] | pTextureView | - Texture view to generate mip maps for. |
Implemented in Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Returns the current frame number.
|
pure virtual |
Returns current render pass tile size.
[out] | TileSizeX | - Tile size in X direction. |
[out] | TileSizeY | - Tile size in Y direction. |
Implemented in Diligent::DeviceContextBase< EngineWebGPUImplTraits >.
|
pure virtual |
Returns a pointer to the user data object previously.
set with SetUserData() method.
Implemented in Diligent::DeviceContextBase< EngineWebGPUImplTraits >.
|
pure virtual |
Inserts a debug label with name and color.
External debug tools may use this information when displaying context commands.
[in] | Label | - Label name. |
[in] | pColor | - Label color. |
Implemented in Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Invalidates the cached context state.
This method should be called by an application to invalidate internal cached states.
Implemented in Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Locks the internal mutex and returns a pointer to the command queue that is associated with this device context.
Only immediate device contexts have associated command queues.
The engine locks the internal mutex to prevent simultaneous access to the command queue. An application must release the lock by calling UnlockCommandQueue() when it is done working with the queue or the engine will not be able to submit any command list to the queue. Nested calls to LockCommandQueue() are not allowed. The queue pointer never changes while the context is alive, so an application may cache and use the pointer if it does not need to prevent potential simultaneous access to the queue from other threads.
The engine manages the lifetimes of command queues and all other device objects, so an application must not call AddRef/Release methods on the returned interface.
Implemented in Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Maps the buffer.
[in] | pBuffer | - Pointer to the buffer to map. |
[in] | MapType | - Type of the map operation. See Diligent::MAP_TYPE. |
[in] | MapFlags | - Special map flags. See Diligent::MAP_FLAGS. |
[out] | pMappedData | - Reference to the void pointer to store the address of the mapped region. |
Implemented in Diligent::DeviceContextBase< EngineWebGPUImplTraits >, and Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Maps the texture subresource.
[in] | pTexture | - Pointer to the texture to map. |
[in] | MipLevel | - Mip level to map. |
[in] | ArraySlice | - Array slice to map. This parameter must be 0 for non-array textures. |
[in] | MapType | - Type of the map operation. See Diligent::MAP_TYPE. |
[in] | MapFlags | - Special map flags. See Diligent::MAP_FLAGS. |
[in] | pMapRegion | - Texture region to map. If this parameter is null, the entire subresource is mapped. |
[out] | MappedData | - Mapped texture region data |
This method is supported in D3D11, D3D12 and Vulkan backends. In D3D11 backend, only the entire subresource can be mapped, so pMapRegion must either be null, or cover the entire subresource. In D3D11 and Vulkan backends, dynamic textures are no different from non-dynamic textures, and mapping with MAP_FLAG_DISCARD has exactly the same behavior.
Implemented in Diligent::DeviceContextBase< EngineWebGPUImplTraits >, and Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Executes a multi-draw command.
[in] | Attribs | - Multi-draw command attributes, see Diligent::MultiDrawAttribs for details. |
If the device does not support the NativeMultiDraw feature, the method will emulate it by issuing a sequence of individual draw commands. Note that draw command index is only available in the shader when the NativeMultiDraw feature is supported.
Implemented in Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Executes an indexed multi-draw command.
[in] | Attribs | - Multi-draw command attributes, see Diligent::MultiDrawIndexedAttribs for details. |
If the device does not support the NativeMultiDraw
feature, the method will emulate it by issuing a sequence of individual draw commands. Note that draw command index is only available in the shader when the NativeMultiDraw
feature is supported.
Implemented in Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Transitions to the next subpass in the render pass instance.
Implemented in Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Resolves a multi-sampled texture subresource into a non-multi-sampled texture subresource.
[in] | pSrcTexture | - Source multi-sampled texture. |
[in] | pDstTexture | - Destination non-multi-sampled texture. |
[in] | ResolveAttribs | - Resolve command attributes, see Diligent::ResolveTextureSubresourceAttribs for details. |
Implemented in Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Sets the blend factors for alpha blending.
[in] | pBlendFactors | - Array of four blend factors, one for each RGBA component. These factors are used if the blend state uses one of the Diligent::BLEND_FACTOR_BLEND_FACTOR or Diligent::BLEND_FACTOR_INV_BLEND_FACTOR blend factors. If nullptr is provided, default blend factors array {1, 1, 1, 1} will be used. |
Implemented in Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Binds an index buffer to the pipeline.
[in] | pIndexBuffer | - Pointer to the index buffer. The buffer must have been created with the Diligent::BIND_INDEX_BUFFER flag. |
[in] | ByteOffset | - Offset from the beginning of the buffer to the start of index data. |
[in] | StateTransitionMode | - State transition mode for the index buffer to bind (see Diligent::RESOURCE_STATE_TRANSITION_MODE). |
When StateTransitionMode is Diligent::RESOURCE_STATE_TRANSITION_MODE_TRANSITION, the method will transition the buffer to Diligent::RESOURCE_STATE_INDEX_BUFFER (if its state is not unknown). Resource state transitioning is not thread-safe, so no other thread is allowed to read or write the state of the buffer.
If the application intends to use the same resource in other threads simultaneously, it needs to explicitly manage the states using TransitionResourceStates() method.
Implemented in Diligent::DeviceContextBase< EngineWebGPUImplTraits >, and Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Sets the pipeline state.
[in] | pPipelineState | - Pointer to IPipelineState interface to bind to the context. |
Implemented in Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Binds one or more render targets and the depth-stencil buffer to the context. It also sets the viewport to match the first non-null render target or depth-stencil buffer.
[in] | NumRenderTargets | - Number of render targets to bind. |
[in] | ppRenderTargets | - Array of pointers to ITextureView that represent the render targets to bind to the device. The type of each view in the array must be Diligent::TEXTURE_VIEW_RENDER_TARGET. |
[in] | pDepthStencil | - Pointer to the ITextureView that represents the depth stencil to bind to the device. The view type must be Diligent::TEXTURE_VIEW_DEPTH_STENCIL or Diligent::TEXTURE_VIEW_READ_ONLY_DEPTH_STENCIL. |
[in] | StateTransitionMode | - State transition mode of the render targets and depth stencil buffer being set (see Diligent::RESOURCE_STATE_TRANSITION_MODE). |
The device context will keep strong references to all bound render target and depth-stencil views. Thus these views (and consequently referenced textures) cannot be released until they are unbound from the context.
Any render targets not defined by this call are set to nullptr
.
When StateTransitionMode
is Diligent::RESOURCE_STATE_TRANSITION_MODE_TRANSITION, the method will transition all render targets in known states to Diligent::RESOURCE_STATE_RENDER_TARGET, and the depth-stencil buffer to Diligent::RESOURCE_STATE_DEPTH_WRITE state. Resource state transitioning is not thread-safe, so no other thread is allowed to read or write the states of resources used by the command.
If the application intends to use the same resource in other threads simultaneously, it needs to explicitly manage the states using TransitionResourceStates() method.
Implemented in Diligent::DeviceContextBase< EngineWebGPUImplTraits >.
|
pure virtual |
Binds one or more render targets, the depth-stencil buffer and shading rate map to the context. It also sets the viewport to match the first non-null render target or depth-stencil buffer.
[in] | Attribs | - The command attributes, see Diligent::SetRenderTargetsAttribs for details. |
The device context will keep strong references to all bound render target and depth-stencil views as well as to shading rate map. Thus these views (and consequently referenced textures) cannot be released until they are unbound from the context.
Any render targets not defined by this call are set to nullptr.
Implemented in Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Sets active scissor rects.
[in] | NumRects | - Number of scissor rectangles to set. |
[in] | pRects | - An array of Rect structures describing the scissor rectangles to bind. |
[in] | RTWidth | - Render target width. If 0 is provided, width of the currently bound render target will be used. |
[in] | RTHeight | - Render target height. If 0 is provided, height of the currently bound render target will be used. |
Implemented in Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Sets the shading base rate and combiners.
[in] | BaseRate | - Base shading rate used for combiner operations. |
[in] | PrimitiveCombiner | - Combiner operation for the per primitive shading rate (the output of the vertex or geometry shader). |
[in] | TextureCombiner | - Combiner operation for texture-based shading rate (fetched from the shading rate texture), see SetRenderTargetsAttribs::pShadingRateMap and SubpassDesc::pShadingRateAttachment. |
The final shading rate is calculated before the triangle is rasterized by the following algorithm:
PrimitiveRate = ApplyCombiner(PrimitiveCombiner, BaseRate, PerPrimitiveRate) FinalRate = ApplyCombiner(TextureCombiner, PrimitiveRate, TextureRate)
Where
PerPrimitiveRate - vertex shader output value (HLSL: SV_ShadingRate; GLSL: gl_PrimitiveShadingRateEXT). TextureRate - texel value from the shading rate texture, see SetRenderTargetsAttribs::pShadingRateMap. SHADING_RATE ApplyCombiner(SHADING_RATE_COMBINER Combiner, SHADING_RATE OriginalRate, SHADING_RATE NewRate) { switch (Combiner) { case SHADING_RATE_COMBINER_PASSTHROUGH: return OriginalRate; case SHADING_RATE_COMBINER_OVERRIDE: return NewRate; case SHADING_RATE_COMBINER_MIN: return Min(OriginalRate, NewRate); case SHADING_RATE_COMBINER_MAX: return Max(OriginalRate, NewRate); case SHADING_RATE_COMBINER_SUM: return OriginalRate + NewRate; case SHADING_RATE_COMBINER_MUL: return OriginalRate * NewRate; } }
Implemented in Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Sets the stencil reference value.
[in] | StencilRef | - Stencil reference value. |
Implemented in Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Stores a pointer to the user-provided data object.
The pointer may later be retrieved through GetUserData().
[in] | pUserData | - Pointer to the user data object to store. |
The method keeps strong reference to the user data object. If an application needs to release the object, it should call SetUserData(nullptr);
Implemented in Diligent::DeviceContextBase< EngineWebGPUImplTraits >.
|
pure virtual |
Binds vertex buffers to the pipeline.
[in] | StartSlot | - The first input slot for binding. The first vertex buffer is explicitly bound to the start slot; each additional vertex buffer in the array is implicitly bound to each subsequent input slot. |
[in] | NumBuffersSet | - The number of vertex buffers in the array. |
[in] | ppBuffers | - A pointer to an array of vertex buffers. The buffers must have been created with the Diligent::BIND_VERTEX_BUFFER flag. |
[in] | pOffsets | - Pointer to an array of offset values; one offset value for each buffer in the vertex-buffer array. Each offset is the number of bytes between the first element of a vertex buffer and the first element that will be used. If this parameter is nullptr, zero offsets for all buffers will be used. |
[in] | StateTransitionMode | - State transition mode for buffers being set (see Diligent::RESOURCE_STATE_TRANSITION_MODE). |
[in] | Flags | - Additional flags. See Diligent::SET_VERTEX_BUFFERS_FLAGS for a list of allowed values. |
The device context keeps strong references to all bound vertex buffers. Thus a buffer cannot be released until it is unbound from the context.
It is suggested to specify Diligent::SET_VERTEX_BUFFERS_FLAG_RESET flag whenever possible. This will assure that no buffers from previous draw calls are bound to the pipeline.
When StateTransitionMode is Diligent::RESOURCE_STATE_TRANSITION_MODE_TRANSITION, the method will transition all buffers in known states to Diligent::RESOURCE_STATE_VERTEX_BUFFER. Resource state transitioning is not thread-safe, so no other thread is allowed to read or write the states of these buffers.
If the application intends to use the same resources in other threads simultaneously, it needs to explicitly manage the states using TransitionResourceStates() method.
Implemented in Diligent::DeviceContextBase< EngineWebGPUImplTraits >, and Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Sets an array of viewports.
[in] | NumViewports | - Number of viewports to set. |
[in] | pViewports | - An array of Viewport structures describing the viewports to bind. |
[in] | RTWidth | - Render target width. If 0 is provided, width of the currently bound render target will be used. |
[in] | RTHeight | - Render target height. If 0 is provided, height of the currently bound render target will be used. |
DirectX and OpenGL use different window coordinate systems. In DirectX, the coordinate system origin is in the left top corner of the screen with Y axis pointing down. In OpenGL, the origin is in the left bottom corner of the screen with Y axis pointing up. Render target size is required to convert viewport from DirectX to OpenGL coordinate system if OpenGL device is used.
All viewports must be set atomically as one operation. Any viewports not defined by the call are disabled.
You can set the viewport size to match the currently bound render target using the following call:
pContext->SetViewports(1, nullptr, 0, 0);
Implemented in Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Executes a trace rays command.
[in] | Attribs | - Trace rays command attributes, see Diligent::TraceRaysAttribs for details. |
Implemented in Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Executes an indirect trace rays command.
[in] | Attribs | - Indirect trace rays command attributes, see Diligent::TraceRaysIndirectAttribs. |
Implemented in Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Transitions resource states.
[in] | BarrierCount | - Number of barriers in pResourceBarriers array |
[in] | pResourceBarriers | - Pointer to the array of resource barriers |
When both old and new states are Diligent::RESOURCE_STATE_UNORDERED_ACCESS, the engine executes UAV barrier on the resource. The barrier makes sure that all UAV accesses (reads or writes) are complete before any future UAV accesses (read or write) can begin.
There are two main usage scenarios for this method:
The method always reads the states of all resources to transition. If the state of a resource is managed by multiple threads in parallel, the resource must first be transitioned to unknown state (Diligent::RESOURCE_STATE_UNKNOWN) to disable automatic state management in the engine.
When StateTransitionDesc::UpdateResourceState is set to true, the method may update the state of the corresponding resource which is not thread-safe. No other threads should read or write the state of that resource.
Implemented in Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Transitions shader resources to the states required by Draw or Dispatch command.
[in] | pShaderResourceBinding | - Shader resource binding whose resources will be transitioned. |
This method explicitly transitions all resources except ones in unknown state to the states required by Draw or Dispatch command. If this method was called, there is no need to use Diligent::RESOURCE_STATE_TRANSITION_MODE_TRANSITION when calling CommitShaderResources()
Implemented in Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Unmaps the previously mapped buffer.
[in] | pBuffer | - Pointer to the buffer to unmap. |
[in] | MapType | - Type of the map operation. This parameter must match the type that was provided to the Map() method. |
Implemented in Diligent::DeviceContextBase< EngineWebGPUImplTraits >, and Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Unmaps the texture subresource.
[in] | pTexture | - Pointer to the texture to unmap. |
[in] | MipLevel | - Mip level to unmap. |
[in] | ArraySlice | - Array slice to unmap. This parameter must be 0 for non-array textures. |
Implemented in Diligent::DeviceContextBase< EngineWebGPUImplTraits >, and Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Updates the data in the buffer.
[in] | pBuffer | - Pointer to the buffer to update. |
[in] | Offset | - Offset in bytes from the beginning of the buffer to the update region. |
[in] | Size | - Size in bytes of the data region to update. |
[in] | pData | - Pointer to the data to write to the buffer. |
[in] | StateTransitionMode | - Buffer state transition mode (see Diligent::RESOURCE_STATE_TRANSITION_MODE) |
Implemented in Diligent::DeviceContextBase< EngineWebGPUImplTraits >, and Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Updates SBT with the pending data that were recorded in IShaderBindingTable::Bind*** calls.
[in] | pSBT | - Shader binding table that will be updated if there are pending data. |
[in] | pUpdateIndirectBufferAttribs | - Indirect ray tracing attributes buffer update attributes (optional, may be null). |
When pUpdateIndirectBufferAttribs
is not null, the indirect ray tracing attributes will be written to the pAttribsBuffer
buffer specified by the structure and can be used by TraceRaysIndirect() command. In Direct3D12 backend, the pAttribsBuffer buffer will be initialized with D3D12_DISPATCH_RAYS_DESC
structure that contains GPU addresses of the ray tracing shaders in the first 88 bytes and 12 bytes for dimension (see TraceRaysIndirect() description).
In Vulkan backend, the pAttribsBuffer
buffer will not be modified, because the SBT is used directly in TraceRaysIndirect().
Implemented in Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Updates the data in the texture.
[in] | pTexture | - Pointer to the device context interface to be used to perform the operation. |
[in] | MipLevel | - Mip level of the texture subresource to update. |
[in] | Slice | - Array slice. Should be 0 for non-array textures. |
[in] | DstBox | - Destination region on the texture to update. |
[in] | SubresData | - Source data to copy to the texture. |
[in] | SrcBufferTransitionMode | - If pSrcBuffer member of TextureSubResData structure is not null, this parameter defines state transition mode of the source buffer. If pSrcBuffer is null, this parameter is ignored. |
[in] | TextureTransitionMode | - Texture state transition mode (see Diligent::RESOURCE_STATE_TRANSITION_MODE) |
Implemented in Diligent::DeviceContextBase< EngineWebGPUImplTraits >, and Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Submits all outstanding commands for execution to the GPU and waits until they are complete.
Only immediate contexts can be idled.
The methods implicitly flushes the context (see Flush()), so an application must explicitly reset the PSO and bind all required shader resources after idling the context.
Implemented in Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Writes a bottom-level acceleration structure memory size required for compacting operation to a buffer.
[in] | Attribs | - Structure describing write BLAS compacted size command attributes, see Diligent::WriteBLASCompactedSizeAttribs for details. |
Implemented in Diligent::DeviceContextWebGPUImpl.
|
pure virtual |
Writes a top-level acceleration structure memory size required for compacting operation to a buffer.
[in] | Attribs | - Structure describing write TLAS compacted size command attributes, see Diligent::WriteTLASCompactedSizeAttribs for details. |
Implemented in Diligent::DeviceContextWebGPUImpl.