summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngine
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2019-10-24 06:03:45 +0000
committerEgor Yusov <egor.yusov@gmail.com>2019-10-24 06:03:45 +0000
commit59cb4761f10c0639f9e041088ba46cb63a402c4c (patch)
treefb58f6c24e81e075167423ba7951ba5ea95540fb /Graphics/GraphicsEngine
parentD3D12 backend: optimized CommitRootViews method to process dynamic and non-dy... (diff)
downloadDiligentCore-59cb4761f10c0639f9e041088ba46cb63a402c4c.tar.gz
DiligentCore-59cb4761f10c0639f9e041088ba46cb63a402c4c.zip
Vk backend: optimized PrepareForDraw() by not calling BindDescriptorSetsWithDynamicOffsets if there are no dynamic buffers bound (fixed https://github.com/DiligentGraphics/DiligentCore/issues/106)
Diffstat (limited to 'Graphics/GraphicsEngine')
-rw-r--r--Graphics/GraphicsEngine/interface/DeviceContext.h23
1 files changed, 11 insertions, 12 deletions
diff --git a/Graphics/GraphicsEngine/interface/DeviceContext.h b/Graphics/GraphicsEngine/interface/DeviceContext.h
index 646a9952..baa2dd64 100644
--- a/Graphics/GraphicsEngine/interface/DeviceContext.h
+++ b/Graphics/GraphicsEngine/interface/DeviceContext.h
@@ -78,7 +78,7 @@ enum DRAW_FLAGS : Uint8
/// \remarks This flag should be used to improve performance when an application issues a
/// series of draw commands that use the same pipeline state and shader resources and
/// no dynamic buffers (constant or bound as shader resources) are updated between the
- /// commands, including when there are no dynamic buffers at all.
+ /// commands.
/// The flag has no effect on dynamic vertex and index buffers.
///
/// Details
@@ -92,26 +92,25 @@ enum DRAW_FLAGS : Uint8
/// and the application may use the flag to inform the engine that the data in the buffer
/// stay intact to avoid extra work.\n
/// Note that after a new PSO is bound or an SRB is committed, the engine will always set all
- /// required buffers addresses/offsets regardless of the flag. The flag will only take effect
+ /// required buffer addresses/offsets regardless of the flag. The flag will only take effect
/// on the second and susbequent draw calls that use the same PSO and SRB.\n
/// The flag has no effect in D3D11 and OpenGL backends.
///
/// Implementation details
///
/// Vulkan backend allocates VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC descriptors for all uniform (constant),
- /// buffers and VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC descritptors for storage buffers.
+ /// buffers and VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC descriptors for storage buffers.
/// Note that HLSL structured buffers are mapped to read-only storage buffers in SPIRV and RW buffers
/// are mapped to RW-storage buffers.
- /// By default, all dynamic descriptor sets are updated every time a draw command is issued (see
- /// PipelineStateVkImpl::BindDescriptorSetsWithDynamicOffsets). When DRAW_FLAG_DYNAMIC_RESOURCE_BUFFERS_INTACT is
- /// specified, dynamic descriptor sets are only bound by the first draw command that uses the PSO and the SRB.
- /// It avoids binding descriptors with the same offsets if none of the offsets have changed or if the buffers
- /// are not dynamic (in which case the offsets are always zero).
+ /// By default, all dynamic descriptor sets that have dynamic buffers bound are updated every time a draw command is
+ /// issued (see PipelineStateVkImpl::BindDescriptorSetsWithDynamicOffsets). When DRAW_FLAG_DYNAMIC_RESOURCE_BUFFERS_INTACT
+ /// is specified, dynamic descriptor sets are only bound by the first draw command that uses the PSO and the SRB.
+ /// The flag avoids binding descriptors with the same offsets if none of the dynamic offsets have changed.
///
- /// Direct3D12 backend binds constant buffers to root views and always treats them as dynamic. By default the engine
- /// assumes that the buffer's virtual GPU address may change between the draw commands and always commits root views
- /// (see RootSignature::CommitRootViews). When DRAW_FLAG_DYNAMIC_RESOURCE_BUFFERS_INTACT is set, root views are only committed
- /// by the first draw command that uses the PSO + SRB pair. It avoids committing the same GPU virtual addresses when
+ /// Direct3D12 backend binds constant buffers to root views. By default the engine assumes that virtual GPU addresses
+ /// of all dynamic buffers may change between the draw commands and always binds dynamic buffers to root views
+ /// (see RootSignature::CommitRootViews). When DRAW_FLAG_DYNAMIC_RESOURCE_BUFFERS_INTACT is set, root views are only bound
+ /// by the first draw command that uses the PSO + SRB pair. The flag avoids setting the same GPU virtual addresses when
/// they stay unchanged.
DRAW_FLAG_DYNAMIC_RESOURCE_BUFFERS_INTACT = 0x08
};