Skip to content

Commit 2db9e8c

Browse files
Updated Graphics Tools documentation
1 parent 47702b4 commit 2db9e8c

15 files changed

+236
-201
lines changed

Graphics/GraphicsTools/interface/BufferSuballocator.h

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019-2024 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");
@@ -73,8 +73,9 @@ struct IBufferSuballocation : public IObject
7373
/// \remarks This method is a shortcut for GetAllocator()->GetBuffer().
7474
virtual IBuffer* GetBuffer() const = 0;
7575

76-
/// Stores a pointer to the user-provided data object, which
77-
/// may later be retrieved through GetUserData().
76+
/// Stores a pointer to the user-provided data object.
77+
78+
/// The user data may later be retrieved through GetUserData().
7879
///
7980
/// \param [in] pUserData - A pointer to the user data object to store.
8081
///
@@ -125,16 +126,17 @@ struct IBufferSuballocator : public IObject
125126
/// \param[in] pContext - A pointer to the device context that will be used to
126127
/// copy existing contents to the new buffer, if necessary.
127128
///
128-
/// \remarks If the internal buffer needs to be resized, pDevice and pContext will
129-
/// be used to create a new buffer and copy existing contents to the new buffer.
130-
/// The method is not thread-safe and an application must externally synchronize the
131-
/// access.
129+
/// If the internal buffer needs to be resized, `pDevice` and `pContext` will
130+
/// be used to create a new buffer and copy existing contents to the new buffer.
131+
/// The method is not thread-safe and an application must externally synchronize the
132+
/// access.
132133
virtual IBuffer* Update(IRenderDevice* pDevice, IDeviceContext* pContext) = 0;
133134

134135
/// Returns a pointer to the internal buffer object.
136+
137+
/// If the buffer has not been created yet, the method returns null.
135138
///
136-
/// \remarks If the buffer has not been created yet, the method returns null.
137-
/// If the buffer may need to be updated, use the Update() method instead.
139+
/// If the buffer may need to be updated, use the Update() method instead.
138140
virtual IBuffer* GetBuffer() const = 0;
139141

140142

@@ -155,8 +157,9 @@ struct IBufferSuballocator : public IObject
155157
virtual void GetUsageStats(BufferSuballocatorUsageStats& UsageStats) = 0;
156158

157159

158-
/// Returns the internal buffer version. The version is incremented every time
159-
/// the buffer is expanded.
160+
/// Returns the internal buffer version.
161+
162+
/// The version is incremented every time the buffer is expanded.
160163
virtual Uint32 GetVersion() const = 0;
161164
};
162165

@@ -174,18 +177,19 @@ struct BufferSuballocatorCreateInfo
174177
Uint32 ExpansionSize = 0;
175178

176179
/// The maximum buffer size, in bytes.
177-
/// If Desc.Usage == USAGE_SPARSE, also the buffer virtual size.
180+
181+
/// If `Desc.Usage == USAGE_SPARSE`, also the buffer virtual size.
178182
///
179183
/// \remarks If MaxSize is zero, the buffer will not be expanded beyond the initial size.
180184
Uint64 MaxSize = 0;
181185

182186
/// Whether to disable debug validation of the internal buffer structure.
183187

184-
/// \remarks By default, internal buffer structure is validated in debug
185-
/// mode after each allocation and deallocation. This may be expensive
186-
/// when the buffer contains many allocations. When this flag is set
187-
/// to true, the validation is disabled.
188-
/// The flag is ignored in release builds as the validation is always disabled.
188+
/// By default, internal buffer structure is validated in debug
189+
/// mode after each allocation and deallocation. This may be expensive
190+
/// when the buffer contains many allocations. When this flag is set
191+
/// to true, the validation is disabled.
192+
/// The flag is ignored in release builds as the validation is always disabled.
189193
bool DisableDebugValidation = false;
190194
};
191195

Graphics/GraphicsTools/interface/BytecodeCache.h

Lines changed: 2 additions & 2 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.
@@ -56,7 +56,7 @@ static DILIGENT_CONSTEXPR INTERFACE_ID IID_BytecodeCache = {0xD1F8295F, 0xF9D7,
5656
DILIGENT_BEGIN_INTERFACE(IBytecodeCache, IObject)
5757
{
5858
/// Loads the cache data from the binary blob
59-
///
59+
6060
/// \param [in] pData - A pointer to the cache data.
6161
/// \return true if the data was loaded successfully, and false otherwise.
6262
VIRTUAL bool METHOD(Load)(THIS_

Graphics/GraphicsTools/interface/DurationQueryHelper.hpp

Lines changed: 9 additions & 5 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");
@@ -27,6 +27,9 @@
2727

2828
#pragma once
2929

30+
/// \file
31+
/// Definition of the Diligent::DurationQueryHelper class
32+
3033
#include <vector>
3134
#include <deque>
3235

@@ -39,6 +42,7 @@ namespace Diligent
3942
{
4043

4144
/// Helper class to manage duration queries.
45+
4246
/// One DurationQueryHelper instance must be used once per frame.
4347
class DurationQueryHelper
4448
{
@@ -59,8 +63,8 @@ class DurationQueryHelper
5963

6064
/// \param [in] pCtx - Context to record begin query command
6165
///
62-
/// \remarks There must be exactly one matching Begin() for every End() call, otherwise
63-
/// the behavior is undefined.
66+
/// \note There must be exactly one matching Begin() for every End() call, otherwise
67+
/// the behavior is undefined.
6468
void Begin(IDeviceContext* pCtx);
6569

6670

@@ -70,8 +74,8 @@ class DurationQueryHelper
7074
/// \param [out] Duration - Variable where duration will be written to.
7175
/// \return true if the data from the oldest query is available, and false otherwise.
7276
///
73-
/// \remarks There must be exactly one matching End() for every Begin() call, otherwise
74-
/// the behavior is undefined.
77+
/// \note There must be exactly one matching End() for every Begin() call, otherwise
78+
/// the behavior is undefined.
7579
bool End(IDeviceContext* pCtx, double& Duration);
7680

7781
private:

Graphics/GraphicsTools/interface/DynamicBuffer.hpp

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019-2024 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");
@@ -50,17 +50,16 @@ struct DynamicBufferCreateInfo
5050

5151
/// The size of the memory page for the sparse buffer.
5252

53-
/// \remarks
54-
/// This value is only relevant when Desc.Usage == USAGE_SPARSE and
55-
/// defines the memory page size of the device memory object that is
56-
/// backing the buffer.
53+
/// This value is only relevant when `Desc.Usage == USAGE_SPARSE` and
54+
/// defines the memory page size of the device memory object that is
55+
/// backing the buffer.
5756
///
58-
/// Memory page size should be a multiple of SparseResources.StandardBlockSize.
59-
/// If it is not, the engine automatically aligns the value up to the closest
60-
/// multiple of the block size.
57+
/// Memory page size should be a multiple of SparseResources.StandardBlockSize.
58+
/// If it is not, the engine automatically aligns the value up to the closest
59+
/// multiple of the block size.
6160
Uint32 MemoryPageSize = 64 << 10;
6261

63-
/// When Desc.Usage == USAGE_SPARSE, the virtual size of the sparse buffer;
62+
/// When `Desc.Usage == USAGE_SPARSE`, the virtual size of the sparse buffer;
6463
/// ignored otherwise.
6564
Uint64 VirtualSize = Uint64{1} << Uint64{30};
6665
};
@@ -76,8 +75,8 @@ class DynamicBuffer
7675
/// This parameter may be null (see remarks).
7776
/// \param[in] CreateInfo - Create information, see Diligent::DynamicBufferCreateInfo.
7877
///
79-
/// \remarks If pDevice is null, internal buffer creation will be postponed
80-
/// until Update() or Resize() is called.
78+
/// If `pDevice` is null, internal buffer creation will be postponed
79+
/// until Update() or Resize() is called.
8180
DynamicBuffer(IRenderDevice* pDevice, const DynamicBufferCreateInfo& CreateInfo);
8281

8382
// clang-format off
@@ -100,22 +99,22 @@ class DynamicBuffer
10099
///
101100
/// \return Pointer to the new buffer.
102101
///
103-
/// \remarks The method operation depends on which of pDevice and pContext parameters
104-
/// are not null:
105-
/// - Both pDevice and pContext are not null: the new internal buffer is created
106-
/// and existing contents is copied (for non-sparse buffer), or memory pages
107-
/// are committed (for sparse buffer). Update() may be called with
108-
/// both pDevice and pContext being null.
109-
/// - pDevice is not null, pContext is null: internal buffer is created,
110-
/// but existing contents is not copied or memory is not committed. An
111-
/// application must provide non-null device context when calling Update().
112-
/// - Both pDevice and pContext are null: internal buffer is not created.
113-
/// An application must provide non-null device and device context when calling
114-
/// Update().
102+
/// The method operation depends on which of `pDevice` and `pContext` parameters
103+
/// are not null:
104+
/// - Both `pDevice` and `pContext` are not null: the new internal buffer is created
105+
/// and existing contents is copied (for non-sparse buffer), or memory pages
106+
/// are committed (for sparse buffer). Update() may be called with
107+
/// both `pDevice` and `pContext` being null.
108+
/// - `pDevice` is not null, `pContext` is null: internal buffer is created,
109+
/// but existing contents is not copied or memory is not committed. An
110+
/// application must provide non-null device context when calling Update().
111+
/// - Both `pDevice` and `pContext` are null: internal buffer is not created.
112+
/// An application must provide non-null device and device context when calling
113+
/// Update().
115114
///
116-
/// Typically pDevice and pContext should be null when the method is called from a worker thread.
115+
/// Typically pDevice and pContext should be null when the method is called from a worker thread.
117116
///
118-
/// If NewSize is zero, internal buffer will be released.
117+
/// If `NewSize` is zero, internal buffer will be released.
119118
IBuffer* Resize(IRenderDevice* pDevice,
120119
IDeviceContext* pContext,
121120
Uint64 NewSize,
@@ -131,20 +130,20 @@ class DynamicBuffer
131130
/// (see remarks).
132131
/// \return A pointer to the buffer object.
133132
///
134-
/// \remarks If the buffer has been resized, but internal buffer object has not been
135-
/// initialized, pDevice and pContext must not be null.
133+
/// If the buffer has been resized, but internal buffer object has not been
134+
/// initialized, `pDevice` and `pContext` must not be null.
136135
///
137-
/// If buffer does not need to be updated (PendingUpdate() returns false),
138-
/// both pDevice and pContext may be null.
136+
/// If buffer does not need to be updated (PendingUpdate() returns false),
137+
/// both `pDevice` and `pContext` may be null.
139138
IBuffer* Update(IRenderDevice* pDevice,
140139
IDeviceContext* pContext);
141140

142141

143142
/// Returns a pointer to the buffer object.
144-
///
145-
/// \remarks If the buffer has not been initialized, the method returns null.
146-
/// If the buffer may need to be updated (resized or initialized), use the Update()
147-
/// method.
143+
144+
/// If the buffer has not been initialized, the method returns null.
145+
/// If the buffer may need to be updated (resized or initialized), use the Update()
146+
/// method.
148147
IBuffer* GetBuffer() const
149148
{
150149
return m_pBuffer;
@@ -167,6 +166,7 @@ class DynamicBuffer
167166

168167

169168
/// Returns the dynamic buffer version.
169+
170170
/// The version is incremented every time a new internal buffer is created.
171171
Uint32 GetVersion() const
172172
{
@@ -175,10 +175,10 @@ class DynamicBuffer
175175

176176

177177
/// Returns the logical virtual size of the sparse buffer.
178-
///
179-
/// \note The actual size of the sparse buffer may be larger
180-
/// than the logical size due to alignment requirements.
181-
/// Use GetBuffer()->GetDesc().Size to get the actual size.
178+
179+
/// The actual size of the sparse buffer may be larger
180+
/// than the logical size due to alignment requirements.
181+
/// Use GetBuffer()->GetDesc().Size to get the actual size.
182182
Uint64 GetVirtualSize() const
183183
{
184184
return m_VirtualSize;

Graphics/GraphicsTools/interface/DynamicTextureArray.hpp

Lines changed: 30 additions & 30 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.
@@ -46,17 +46,15 @@ struct DynamicTextureArrayCreateInfo
4646
{
4747
/// Texture array description.
4848

49-
/// \remarks
50-
/// - Desc.Type must be RESOURCE_DIM_TEX_2D_ARRAY
51-
/// - Desc.Format must not be TEX_FORMAT_UNKNOWN
52-
/// - Desc.Width and Desc.Height must not be zero
49+
/// - Desc.Type must be Diligent::RESOURCE_DIM_TEX_2D_ARRAY
50+
/// - Desc.Format must not be Diligent::TEX_FORMAT_UNKNOWN
51+
/// - `Desc.Width` and `Desc.Height` must not be zero
5352
TextureDesc Desc;
5453

5554
/// The number of slices in memory page.
5655

57-
/// \remarks
58-
/// This value is only relevant when Desc.Usage == USAGE_SPARSE and
59-
/// defines the number of texture array slices in one memory page.
56+
/// This value is only relevant when Desc.Usage == Diligent::USAGE_SPARSE and
57+
/// defines the number of texture array slices in one memory page.
6058
Uint32 NumSlicesInMemoryPage = 1;
6159
};
6260

@@ -70,8 +68,8 @@ class DynamicTextureArray
7068
/// This parameter may be null (see remarks).
7169
/// \param[in] CreateInfo - Texture array create information, see Diligent::DynamicTextureArrayCreateInfo.
7270
///
73-
/// \remarks If pDevice is null, internal texture creation will be postponed
74-
/// until Update() or Resize() is called.
71+
/// If `pDevice` is null, internal texture creation will be postponed
72+
/// until Update() or Resize() is called.
7573
DynamicTextureArray(IRenderDevice* pDevice, const DynamicTextureArrayCreateInfo& CreateInfo);
7674

7775
// clang-format off
@@ -95,21 +93,21 @@ class DynamicTextureArray
9593
///
9694
/// \return Pointer to the new texture object after resize.
9795
///
98-
/// \remarks The method operation depends on which of pDevice and pContext parameters
99-
/// are not null:
100-
/// - Both pDevice and pContext are not null: internal texture is created (if necessary)
101-
/// and existing contents is copied (for non-sparse textures). Update() may be called with
102-
/// both pDevice and pContext being null.
103-
/// - pDevice is not null, pContext is null: internal texture or additional memory pages
104-
/// are created, but existing contents is not copied and memory tiles are not bound.
105-
/// An application must provide non-null device context when calling Update().
106-
/// - Both pDevice and pContext are null: internal texture or memory pages are not created.
107-
/// An application must provide non-null device and device context when calling
108-
/// Update().
96+
/// The method operation depends on which of `pDevice` and `pContext` parameters
97+
/// are not null:
98+
/// - Both `pDevice` and `pContext are` not null: internal texture is created (if necessary)
99+
/// and existing contents is copied (for non-sparse textures). Update() may be called with
100+
/// both pDevice and pContext being null.
101+
/// - `pDevice` is not null, `pContext` is null: internal texture or additional memory pages
102+
/// are created, but existing contents is not copied and memory tiles are not bound.
103+
/// An application must provide non-null device context when calling Update().
104+
/// - Both `pDevice` and `pContext` are null: internal texture or memory pages are not created.
105+
/// An application must provide non-null device and device context when calling
106+
/// Update().
109107
///
110-
/// Typically pContext is null when the method is called from a worker thread.
108+
/// Typically `pContext` is null when the method is called from a worker thread.
111109
///
112-
/// If NewArraySize is zero, internal buffer will be released.
110+
/// If `NewArraySize` is zero, internal buffer will be released.
113111
ITexture* Resize(IRenderDevice* pDevice,
114112
IDeviceContext* pContext,
115113
Uint32 NewArraySize,
@@ -126,20 +124,21 @@ class DynamicTextureArray
126124
/// (see remarks).
127125
/// \return A pointer to the texture object.
128126
///
129-
/// \remarks If the texture has been resized, but internal texture object has not been
130-
/// initialized, pDevice and pContext must not be null.
127+
/// If the texture has been resized, but internal texture object has not been
128+
/// initialized, `pDevice` and `pContext` must not be null.
131129
///
132-
/// If the texture does not need to be updated (PendingUpdate() returns false),
133-
/// both pDevice and pContext may be null.
130+
/// If the texture does not need to be updated (PendingUpdate() returns false),
131+
/// both pDevice and pContext may be null.
134132
ITexture* Update(IRenderDevice* pDevice,
135133
IDeviceContext* pContext);
136134

137135

138136
/// Returns a pointer to the texture object.
139137

140-
/// \remarks If the texture has not be initialized, the method returns null.
141-
/// If the texture may need to be updated (initialized or resized),
142-
/// use the Update() method.
138+
/// If the texture has not be initialized, the method returns null.
139+
///
140+
/// If the texture may need to be updated (initialized or resized),
141+
/// use the Update() method.
143142
ITexture* GetTexture() const
144143
{
145144
return m_pTexture;
@@ -160,6 +159,7 @@ class DynamicTextureArray
160159
}
161160

162161
/// Returns dynamic texture version.
162+
163163
/// The version is incremented every time a new internal texture is created.
164164
Uint32 GetVersion() const
165165
{

0 commit comments

Comments
 (0)