Skip to content

Commit 0a73e12

Browse files
Updated pipeline state cache and query documentation
1 parent 49235a3 commit 0a73e12

File tree

3 files changed

+26
-19
lines changed

3 files changed

+26
-19
lines changed

Graphics/GraphicsEngine/include/QueryBase.hpp

Lines changed: 7 additions & 7 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,32 +74,32 @@ class QueryBase : public DeviceObjectBase<typename EngineImplTraits::QueryInterf
7474
bool bIsDeviceInternal = false) :
7575
TDeviceObjectBase{pRefCounters, pDevice, Desc, bIsDeviceInternal}
7676
{
77-
const auto& deviceFeatures = this->GetDevice()->GetFeatures();
77+
const DeviceFeatures& Features = this->GetDevice()->GetFeatures();
7878
static_assert(QUERY_TYPE_NUM_TYPES == 6, "Not all QUERY_TYPE enum values are handled below");
7979
switch (Desc.Type)
8080
{
8181
case QUERY_TYPE_OCCLUSION:
82-
if (!deviceFeatures.OcclusionQueries)
82+
if (!Features.OcclusionQueries)
8383
LOG_ERROR_AND_THROW("Occlusion queries are not supported by this device");
8484
break;
8585

8686
case QUERY_TYPE_BINARY_OCCLUSION:
87-
if (!deviceFeatures.BinaryOcclusionQueries)
87+
if (!Features.BinaryOcclusionQueries)
8888
LOG_ERROR_AND_THROW("Binary occlusion queries are not supported by this device");
8989
break;
9090

9191
case QUERY_TYPE_TIMESTAMP:
92-
if (!deviceFeatures.TimestampQueries)
92+
if (!Features.TimestampQueries)
9393
LOG_ERROR_AND_THROW("Timestamp queries are not supported by this device");
9494
break;
9595

9696
case QUERY_TYPE_PIPELINE_STATISTICS:
97-
if (!deviceFeatures.PipelineStatisticsQueries)
97+
if (!Features.PipelineStatisticsQueries)
9898
LOG_ERROR_AND_THROW("Pipeline statistics queries are not supported by this device");
9999
break;
100100

101101
case QUERY_TYPE_DURATION:
102-
if (!deviceFeatures.DurationQueries)
102+
if (!Features.DurationQueries)
103103
LOG_ERROR_AND_THROW("Duration queries are not supported by this device");
104104
break;
105105

Graphics/GraphicsEngine/interface/PipelineStateCache.h

Lines changed: 7 additions & 5 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.
@@ -68,10 +68,11 @@ struct PipelineStateCacheDesc DILIGENT_DERIVE(DeviceObjectAttribs)
6868

6969
/// Cache mode, see Diligent::PSO_CACHE_MODE.
7070

71-
/// \note Metal backend allows generating the cache on one device
72-
/// and loading PSOs from it on another.
73-
/// Vulkan PSO cache depends on the GPU device, driver version and other parameters,
74-
/// so the cache must be generated and used on the same device.
71+
/// Metal backend allows generating the cache on one device
72+
/// and loading PSOs from it on another.
73+
///
74+
/// Vulkan PSO cache depends on the GPU device, driver version and other parameters,
75+
/// so the cache must be generated and used on the same device.
7576
PSO_CACHE_MODE Mode DEFAULT_INITIALIZER(PSO_CACHE_MODE_LOAD_STORE);
7677

7778
/// PSO cache flags, see Diligent::PSO_CACHE_FLAGS.
@@ -84,6 +85,7 @@ typedef struct PipelineStateCacheDesc PipelineStateCacheDesc;
8485
/// Pipeline state pbject cache create info
8586
struct PipelineStateCacheCreateInfo
8687
{
88+
/// Pipeline state cache description
8789
PipelineStateCacheDesc Desc;
8890

8991
/// All fields can be null to create an empty cache

Graphics/GraphicsEngine/interface/Query.h

Lines changed: 12 additions & 7 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");
@@ -40,6 +40,7 @@ static DILIGENT_CONSTEXPR INTERFACE_ID IID_Query =
4040
{0x70f2a88a, 0xf8be, 0x4901, {0x8f, 0x5, 0x2f, 0x72, 0xfa, 0x69, 0x5b, 0xa0}};
4141

4242
/// Occlusion query data.
43+
4344
/// This structure is filled by IQuery::GetData() for Diligent::QUERY_TYPE_OCCLUSION query type.
4445
struct QueryDataOcclusion
4546
{
@@ -53,6 +54,7 @@ struct QueryDataOcclusion
5354
typedef struct QueryDataOcclusion QueryDataOcclusion;
5455

5556
/// Binary occlusion query data.
57+
5658
/// This structure is filled by IQuery::GetData() for Diligent::QUERY_TYPE_BINARY_OCCLUSION query type.
5759
struct QueryDataBinaryOcclusion
5860
{
@@ -66,6 +68,7 @@ struct QueryDataBinaryOcclusion
6668
typedef struct QueryDataBinaryOcclusion QueryDataBinaryOcclusion;
6769

6870
/// Timestamp query data.
71+
6972
/// This structure is filled by IQuery::GetData() for Diligent::QUERY_TYPE_TIMESTAMP query type.
7073
struct QueryDataTimestamp
7174
{
@@ -82,6 +85,7 @@ struct QueryDataTimestamp
8285
typedef struct QueryDataTimestamp QueryDataTimestamp;
8386

8487
/// Pipeline statistics query data.
88+
8589
/// This structure is filled by IQuery::GetData() for Diligent::QUERY_TYPE_PIPELINE_STATISTICS query type.
8690
///
8791
/// \warning In OpenGL backend the only field that will be populated is ClippingInvocations.
@@ -128,6 +132,7 @@ struct QueryDataPipelineStatistics
128132
typedef struct QueryDataPipelineStatistics QueryDataPipelineStatistics;
129133

130134
/// Duration query data.
135+
131136
/// This structure is filled by IQuery::GetData() for Diligent::QUERY_TYPE_DURATION query type.
132137
struct QueryDataDuration
133138
{
@@ -192,15 +197,15 @@ DILIGENT_BEGIN_INTERFACE(IQuery, IDeviceObject)
192197
/// \param [in] AutoInvalidate - Whether to invalidate the query if the results are available and release associated resources.
193198
/// An application should typically always invalidate completed queries unless
194199
/// it needs to retrieve the same data through GetData() multiple times.
195-
/// A query will not be invalidated if pData is nullptr.
200+
/// A query will not be invalidated if `pData` is `nullptr`.
196201
///
197-
/// \return true if the query data is available and false otherwise.
202+
/// \return `true` if the query data is available and `false` otherwise.
198203
///
199-
/// \note In Direct3D11 backend timestamp queries will only be available after FinishFrame is called
200-
/// for the frame in which they were collected.
204+
/// In Direct3D11 backend timestamp queries will only be available after FinishFrame is called
205+
/// for the frame in which they were collected.
201206
///
202-
/// If AutoInvalidate is set to true, and the data have been retrieved, an application
203-
/// must not call GetData() until it begins and ends the query again.
207+
/// If `AutoInvalidate` is set to true, and the data have been retrieved, an application
208+
/// must not call GetData() until it begins and ends the query again.
204209
VIRTUAL Bool METHOD(GetData)(THIS_
205210
void* pData,
206211
Uint32 DataSize,

0 commit comments

Comments
 (0)