Skip to content

Commit b8c37db

Browse files
Updated documentation for IDeviceMemory, IFence and InputLayout
1 parent 31045b6 commit b8c37db

File tree

4 files changed

+46
-32
lines changed

4 files changed

+46
-32
lines changed

Graphics/GraphicsEngine/include/FenceBase.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019-2022 Diligent Graphics LLC
2+
* Copyright 2019-2025 Diligent Graphics LLC
33
* Copyright 2015-2019 Egor Yusov
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -74,7 +74,7 @@ class FenceBase : public DeviceObjectBase<typename EngineImplTraits::FenceInterf
7474
void DvpSignal(Uint64 NewValue)
7575
{
7676
#ifdef DILIGENT_DEVELOPMENT
77-
auto EnqueuedValue = m_EnqueuedFenceValue.load();
77+
Uint64 EnqueuedValue = m_EnqueuedFenceValue.load();
7878
DEV_CHECK_ERR(NewValue >= EnqueuedValue,
7979
"Fence '", this->m_Desc.Name, "' is being signaled or enqueued for signal with value ", NewValue,
8080
", but the previous value (", EnqueuedValue,

Graphics/GraphicsEngine/interface/DeviceMemory.h

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019-2023 Diligent Graphics LLC
2+
* Copyright 2019-2025 Diligent Graphics LLC
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -44,6 +44,7 @@ static DILIGENT_CONSTEXPR INTERFACE_ID IID_DeviceMemory =
4444
/// This enumeration is used by DeviceMemoryDesc structure.
4545
DILIGENT_TYPED_ENUM(DEVICE_MEMORY_TYPE, Uint8)
4646
{
47+
/// Indicates that the memory type is not defined.
4748
DEVICE_MEMORY_TYPE_UNDEFINED = 0,
4849

4950
/// Indicates that memory will be used for sparse resources.
@@ -56,7 +57,8 @@ struct DeviceMemoryDesc DILIGENT_DERIVE(DeviceObjectAttribs)
5657
/// Memory type, see Diligent::DEVICE_MEMORY_TYPE.
5758
DEVICE_MEMORY_TYPE Type DEFAULT_INITIALIZER(DEVICE_MEMORY_TYPE_UNDEFINED);
5859

59-
/// Size of the memory page.
60+
/// Size of the memory page, in bytes.
61+
6062
/// Depending on the implementation, the memory may be allocated as a single chunk or as an array of pages.
6163
Uint64 PageSize DEFAULT_INITIALIZER(0);
6264

@@ -92,19 +94,21 @@ struct DeviceMemoryCreateInfo
9294
DeviceMemoryDesc Desc;
9395

9496
/// Initial size of the memory object.
95-
///
97+
9698
/// Some implementations do not support IDeviceMemory::Resize() and memory can only be allocated during the initialization.
9799
Uint64 InitialSize DEFAULT_INITIALIZER(0);
98100

99-
/// An array of NumResources resources that this memory must be compatible with.
100-
/// For sparse memory, only USAGE_SPARSE buffer and texture resources are allowed.
101+
/// An array of `NumResources` resources that this memory must be compatible with.
102+
103+
/// For sparse memory, only Diligent::USAGE_SPARSE buffer and texture resources are allowed.
101104
///
102-
/// \note Vulkan backend requires at least one resource to be provided.
105+
/// Vulkan backend requires at least one resource to be provided.
106+
///
107+
/// In Direct3D12, the list of resources is optional on D3D12_RESOURCE_HEAP_TIER_2-hardware
108+
/// and above, but is required on D3D12_RESOURCE_HEAP_TIER_1-hardware
109+
/// (see SPARSE_RESOURCE_CAP_FLAG_MIXED_RESOURCE_TYPE_SUPPORT).
103110
///
104-
/// In Direct3D12, the list of resources is optional on D3D12_RESOURCE_HEAP_TIER_2-hardware
105-
/// and above, but is required on D3D12_RESOURCE_HEAP_TIER_1-hardware
106-
/// (see SPARSE_RESOURCE_CAP_FLAG_MIXED_RESOURCE_TYPE_SUPPORT).
107-
/// It is recommended to always provide the list.
111+
/// It is recommended to always provide the list.
108112
IDeviceObject** ppCompatibleResources DEFAULT_INITIALIZER(nullptr);
109113

110114
/// The number of elements in the ppCompatibleResources array.
@@ -137,8 +141,8 @@ DILIGENT_BEGIN_INTERFACE(IDeviceMemory, IDeviceObject)
137141

138142
/// \param [in] NewSize - The new size of the memory object; must be a multiple of DeviceMemoryDesc::PageSize.
139143
///
140-
/// \remarks Depending on the implementation, the function may resize the existing memory object or
141-
/// create/destroy pages with separate memory objects.
144+
/// Depending on the implementation, the function may resize the existing memory object or
145+
/// create/destroy pages with separate memory objects.
142146
///
143147
/// \remarks This method must be externally synchronized with IDeviceMemory::GetCapacity()
144148
/// and IDeviceContext::BindSparseResourceMemory().

Graphics/GraphicsEngine/interface/Fence.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019-2023 Diligent Graphics LLC
2+
* Copyright 2019-2025 Diligent Graphics LLC
33
* Copyright 2015-2019 Egor Yusov
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -84,8 +84,8 @@ typedef struct FenceDesc FenceDesc;
8484

8585
/// Defines the methods to manipulate a fence object
8686
///
87-
/// \remarks When a fence that was previously signaled by IDeviceContext::EnqueueSignal() is destroyed,
88-
/// it may block the GPU until all prior commands have completed execution.
87+
/// When a fence that was previously signaled by IDeviceContext::EnqueueSignal() is destroyed,
88+
/// it may block the GPU until all prior commands have completed execution.
8989
///
9090
/// \remarks In Direct3D12 and Vulkan backends, fence is thread-safe.
9191
DILIGENT_BEGIN_INTERFACE(IFence, IDeviceObject)
@@ -108,12 +108,12 @@ DILIGENT_BEGIN_INTERFACE(IFence, IDeviceObject)
108108
/// \param [in] Value - New value to set the fence to.
109109
/// The value must be greater than the current value of the fence.
110110
///
111-
/// \note Fence value will be changed immediately on the CPU.
112-
/// Use IDeviceContext::EnqueueSignal to enqueue a signal command
113-
/// that will change the value on the GPU after all previously submitted commands
114-
/// are complete.
111+
/// Fence value will be changed immediately on the CPU.
112+
/// Use IDeviceContext::EnqueueSignal to enqueue a signal command
113+
/// that will change the value on the GPU after all previously submitted commands
114+
/// are complete.
115115
///
116-
/// \note The fence must have been created with type FENCE_TYPE_GENERAL.
116+
/// \note The fence must have been created with type Diligent::FENCE_TYPE_GENERAL.
117117
VIRTUAL void METHOD(Signal)(THIS_
118118
Uint64 Value) PURE;
119119

@@ -122,7 +122,7 @@ DILIGENT_BEGIN_INTERFACE(IFence, IDeviceObject)
122122

123123
/// \param [in] Value - The value that the fence is waiting for to reach.
124124
///
125-
/// \note The method blocks the execution of the calling thread until the wait is complete.
125+
/// The method blocks the execution of the calling thread until the wait is complete.
126126
VIRTUAL void METHOD(Wait)(THIS_
127127
Uint64 Value) PURE;
128128
};

Graphics/GraphicsEngine/interface/InputLayout.h

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019-2023 Diligent Graphics LLC
2+
* Copyright 2019-2025 Diligent Graphics LLC
33
* Copyright 2015-2019 Egor Yusov
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -68,13 +68,16 @@ DILIGENT_TYPED_ENUM(INPUT_ELEMENT_FREQUENCY, Uint8)
6868
/// Description of a single element of the input layout
6969
struct LayoutElement
7070
{
71-
/// HLSL semantic. Default value ("ATTRIB") allows HLSL shaders to be converted
71+
/// HLSL semantic.
72+
73+
/// Default value (`"ATTRIB"`) allows HLSL shaders to be converted
7274
/// to GLSL and used in OpenGL backend as well as compiled to SPIRV and used
7375
/// in Vulkan backend.
7476
/// Any value other than default will only work in Direct3D11 and Direct3D12 backends.
7577
const Char* HLSLSemantic DEFAULT_INITIALIZER("ATTRIB");
7678

7779
/// Input index of the element that is specified in the vertex shader.
80+
7881
/// In Direct3D11 and Direct3D12 backends this is the semantic index.
7982
Uint32 InputIndex DEFAULT_INITIALIZER(0);
8083

@@ -87,25 +90,31 @@ struct LayoutElement
8790
/// Type of the element components, see Diligent::VALUE_TYPE for details.
8891
VALUE_TYPE ValueType DEFAULT_INITIALIZER(VT_FLOAT32);
8992

93+
/// Indicates if the value should be normalized.
94+
9095
/// For signed and unsigned integer value types
91-
/// (VT_INT8, VT_INT16, VT_INT32, VT_UINT8, VT_UINT16, VT_UINT32)
96+
/// (`VT_INT8`, `VT_INT16`, `VT_INT32`, `VT_UINT8`, `VT_UINT16`, `VT_UINT32`)
9297
/// indicates if the value should be normalized to [-1,+1] or
93-
/// [0, 1] range respectively. For floating point types
94-
/// (VT_FLOAT16 and VT_FLOAT32), this member is ignored.
98+
/// [0, 1] range respectively.
99+
///
100+
/// For floating point types (`VT_FLOAT16` and `VT_FLOAT32`), this member is ignored.
95101
Bool IsNormalized DEFAULT_INITIALIZER(True);
96102

97103
/// Relative offset, in bytes, to the element bits.
98-
/// If this value is set to LAYOUT_ELEMENT_AUTO_OFFSET (default value), the offset will
104+
105+
/// If this value is set to `LAYOUT_ELEMENT_AUTO_OFFSET` (default value), the offset will
99106
/// be computed automatically by placing the element right after the previous one.
100107
Uint32 RelativeOffset DEFAULT_INITIALIZER(LAYOUT_ELEMENT_AUTO_OFFSET);
101108

102109
/// Stride, in bytes, between two elements, for this buffer slot.
103-
/// If this value is set to LAYOUT_ELEMENT_AUTO_STRIDE, the stride will be
110+
111+
/// If this value is set to `LAYOUT_ELEMENT_AUTO_STRIDE`, the stride will be
104112
/// computed automatically assuming that all elements in the same buffer slot are
105113
/// packed one after another. If the buffer slot contains multiple layout elements,
106114
/// they all must specify the same stride or use LAYOUT_ELEMENT_AUTO_STRIDE value.
107115
Uint32 Stride DEFAULT_INITIALIZER(LAYOUT_ELEMENT_AUTO_STRIDE);
108116

117+
/// Frequency of the input data, see Diligent::INPUT_ELEMENT_FREQUENCY for details.
109118
INPUT_ELEMENT_FREQUENCY Frequency DEFAULT_INITIALIZER(INPUT_ELEMENT_FREQUENCY_PER_VERTEX);
110119

111120
/// The number of instances to draw using the same per-instance data before advancing
@@ -208,9 +217,10 @@ typedef struct LayoutElement LayoutElement;
208217
/// This structure is used by IRenderDevice::CreateGraphicsPipelineState().
209218
struct InputLayoutDesc
210219
{
211-
/// Array of layout elements
220+
/// Array of layout elements.
212221
const LayoutElement* LayoutElements DEFAULT_INITIALIZER(nullptr);
213-
/// Number of layout elements
222+
223+
/// The number of layout elements in `LayoutElements` array.
214224
Uint32 NumElements DEFAULT_INITIALIZER(0);
215225

216226
#if DILIGENT_CPP_INTERFACE

0 commit comments

Comments
 (0)