Skip to content

Commit f71f631

Browse files
MikhailGorobetsTheMostDiligent
authored andcommitted
Added a few more macros for API constants, updated comments (close #395)
1 parent 48b2432 commit f71f631

File tree

4 files changed

+16
-10
lines changed

4 files changed

+16
-10
lines changed

Graphics/GraphicsEngine/interface/Constants.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ DILIGENT_BEGIN_NAMESPACE(Diligent)
5050
/// The maximum number of queues in graphics adapter description.
5151
#define DILIGENT_MAX_ADAPTER_QUEUES 16
5252

53-
/// The special constant for a default adapter index.
53+
/// Special constant for the default adapter index.
5454
#define DILIGENT_DEFAULT_ADAPTER_ID 0xFFFFFFFFU
5555

56-
/// The special constant for a default queue index.
56+
/// Special constant for the default queue index.
5757
#define DILIGENT_DEFAULT_QUEUE_ID 0xFF
5858

5959
/// The maximum number of shading rate modes.

Graphics/GraphicsEngine/interface/DeviceContext.h

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1264,7 +1264,10 @@ typedef struct BuildBLASAttribs BuildBLASAttribs;
12641264
/// Instance.ContributionToHitGroupIndex = InstanceOffset;
12651265
/// if (BindingMode == HIT_GROUP_BINDING_MODE_PER_GEOMETRY) InstanceOffset += Instance.pBLAS->GeometryCount() * HitGroupStride;
12661266
/// if (BindingMode == HIT_GROUP_BINDING_MODE_PER_INSTANCE) InstanceOffset += HitGroupStride;
1267-
static const Uint32 TLAS_INSTANCE_OFFSET_AUTO = ~0u;
1267+
1268+
#define DILIGENT_TLAS_INSTANCE_OFFSET_AUTO 0xFFFFFFFFU
1269+
1270+
static const Uint32 TLAS_INSTANCE_OFFSET_AUTO = DILIGENT_TLAS_INSTANCE_OFFSET_AUTO;
12681271

12691272

12701273
/// Row-major matrix
@@ -1354,7 +1357,10 @@ typedef struct TLASBuildInstanceData TLASBuildInstanceData;
13541357

13551358
/// Top-level AS instance size in bytes in GPU side.
13561359
/// Used to calculate size of BuildTLASAttribs::pInstanceBuffer.
1357-
static const Uint32 TLAS_INSTANCE_DATA_SIZE = 64;
1360+
1361+
#define DILIGENT_TLAS_INSTANCE_DATA_SIZE 64
1362+
1363+
static const Uint32 TLAS_INSTANCE_DATA_SIZE = DILIGENT_TLAS_INSTANCE_DATA_SIZE;
13581364

13591365

13601366
/// This structure is used by IDeviceContext::BuildTLAS().
@@ -1861,10 +1867,10 @@ struct BindSparseResourceMemoryAttribs
18611867
};
18621868
typedef struct BindSparseResourceMemoryAttribs BindSparseResourceMemoryAttribs;
18631869

1864-
/// The special constant for all remaining mipmap levels.
1870+
/// Special constant for all remaining mipmap levels.
18651871
#define DILIGENT_REMAINING_MIP_LEVELS 0xFFFFFFFFU
18661872

1867-
/// The special constant for all remaining array slices.
1873+
/// Special constant for all remaining array slices.
18681874
#define DILIGENT_REMAINING_ARRAY_SLICES 0xFFFFFFFFU
18691875

18701876
static const Uint32 REMAINING_MIP_LEVELS = DILIGENT_REMAINING_MIP_LEVELS;

Graphics/GraphicsEngine/interface/InputLayout.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ DILIGENT_BEGIN_NAMESPACE(Diligent)
3939
/// The maximum number of layout elements.
4040
#define DILIGENT_MAX_LAYOUT_ELEMENTS 16
4141

42-
/// See Diligent::LayoutElement::RelativeOffset for details.
42+
/// Compute layout element offset automatically, see Diligent::LayoutElement::RelativeOffset for details.
4343
#define DILIGENT_LAYOUT_ELEMENT_AUTO_OFFSET 0xFFFFFFFFU
4444

45-
/// See Diligen::LayoutElement::Stride for details.
45+
/// Compute layout element stride automatically, see Diligen::LayoutElement::Stride for details.
4646
#define DILIGENT_LAYOUT_ELEMENT_AUTO_STRIDE 0xFFFFFFFFU
4747

4848
static const Uint32 MAX_LAYOUT_ELEMENTS = DILIGENT_MAX_LAYOUT_ELEMENTS;

Graphics/GraphicsEngine/interface/RenderPass.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ struct RenderPassAttachmentDesc
149149
};
150150
typedef struct RenderPassAttachmentDesc RenderPassAttachmentDesc;
151151

152-
/// The special constant indicating that a render pass attachment is not used.
152+
/// Special constant indicating that the render pass attachment is not used.
153153
#define DILIGENT_ATTACHMENT_UNUSED 0xFFFFFFFFU
154154

155155
static const Uint32 ATTACHMENT_UNUSED = DILIGENT_ATTACHMENT_UNUSED;
@@ -355,7 +355,7 @@ struct SubpassDesc
355355
};
356356
typedef struct SubpassDesc SubpassDesc;
357357

358-
/// The special subpass index value expanding synchronization scope outside a subpass.
358+
/// Special subpass index value expanding synchronization scope outside a subpass.
359359
#define DILIGENT_SUBPASS_EXTERNAL 0xFFFFFFFFU
360360

361361
static const Uint32 SUBPASS_EXTERNAL = DILIGENT_SUBPASS_EXTERNAL;

0 commit comments

Comments
 (0)