summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngine
diff options
context:
space:
mode:
Diffstat (limited to 'Graphics/GraphicsEngine')
-rw-r--r--Graphics/GraphicsEngine/include/QueryBase.hpp15
-rw-r--r--Graphics/GraphicsEngine/interface/DeviceCaps.h3
2 files changed, 18 insertions, 0 deletions
diff --git a/Graphics/GraphicsEngine/include/QueryBase.hpp b/Graphics/GraphicsEngine/include/QueryBase.hpp
index 322fbf54..5b066b29 100644
--- a/Graphics/GraphicsEngine/include/QueryBase.hpp
+++ b/Graphics/GraphicsEngine/include/QueryBase.hpp
@@ -69,6 +69,7 @@ public:
TDeviceObjectBase{pRefCounters, pDevice, Desc, bIsDeviceInternal}
{
const auto& deviceFeatures = pDevice->GetDeviceCaps().Features;
+ static_assert(QUERY_TYPE_NUM_TYPES == 6, "Not all QUERY_TYPE enum values are handled below");
switch (Desc.Type)
{
case QUERY_TYPE_OCCLUSION:
@@ -91,6 +92,11 @@ public:
LOG_ERROR_AND_THROW("Pipeline statistics queries are not supported by this device");
break;
+ case QUERY_TYPE_DURATION:
+ if (!deviceFeatures.DurationQueries)
+ LOG_ERROR_AND_THROW("Duration queries are not supported by this device");
+ break;
+
default:
UNEXPECTED("Unexpected device type");
}
@@ -185,6 +191,7 @@ public:
return false;
}
+ static_assert(QUERY_TYPE_NUM_TYPES == 6, "Not all QUERY_TYPE enum values are handled below");
switch (this->m_Desc.Type)
{
case QUERY_TYPE_UNDEFINED:
@@ -223,6 +230,14 @@ public:
}
break;
+ case QUERY_TYPE_DURATION:
+ if (DataSize != sizeof(QueryDataDuration))
+ {
+ LOG_ERROR_MESSAGE("The size of query data (", DataSize, ") is incorrect: ", sizeof(QueryDataDuration), " (aka sizeof(QueryDataDuration)) is expected");
+ return false;
+ }
+ break;
+
default:
UNEXPECTED("Unexpected query type");
return false;
diff --git a/Graphics/GraphicsEngine/interface/DeviceCaps.h b/Graphics/GraphicsEngine/interface/DeviceCaps.h
index 1f0dc257..efb657df 100644
--- a/Graphics/GraphicsEngine/interface/DeviceCaps.h
+++ b/Graphics/GraphicsEngine/interface/DeviceCaps.h
@@ -136,6 +136,9 @@ struct DeviceFeatures
/// Indicates if device supports pipeline statistics queries (see Diligent::QUERY_TYPE_PIPELINE_STATISTICS).
Bool PipelineStatisticsQueries DEFAULT_INITIALIZER(False);
+ /// Indicates if device supports duration queries (see Diligent::QUERY_TYPE_DURATION).
+ Bool DurationQueries DEFAULT_INITIALIZER(False);
+
/// Indicates if device supports depth bias clamping
Bool DepthBiasClamp DEFAULT_INITIALIZER(False);