summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngine
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2021-03-04 16:33:14 +0000
committerassiduous <assiduous@diligentgraphics.com>2021-03-19 00:38:15 +0000
commite3019c64cc94d68e5924b024e4073d60cc6dfed6 (patch)
treea440b5207efc7a8a5a75a094dbd1cf64448791cf /Graphics/GraphicsEngine
parentOpenGL: added SRB memory allocator, some minor improvements (diff)
downloadDiligentCore-e3019c64cc94d68e5924b024e4073d60cc6dfed6.tar.gz
DiligentCore-e3019c64cc94d68e5924b024e4073d60cc6dfed6.zip
Minor updates to ValidatePipelineResourceSignatureDesc
Diffstat (limited to 'Graphics/GraphicsEngine')
-rw-r--r--Graphics/GraphicsEngine/include/PipelineResourceSignatureBase.hpp7
-rw-r--r--Graphics/GraphicsEngine/src/PipelineResourceSignatureBase.cpp9
2 files changed, 6 insertions, 10 deletions
diff --git a/Graphics/GraphicsEngine/include/PipelineResourceSignatureBase.hpp b/Graphics/GraphicsEngine/include/PipelineResourceSignatureBase.hpp
index 457fc7bd..9311a4c0 100644
--- a/Graphics/GraphicsEngine/include/PipelineResourceSignatureBase.hpp
+++ b/Graphics/GraphicsEngine/include/PipelineResourceSignatureBase.hpp
@@ -48,8 +48,7 @@ namespace Diligent
/// Validates pipeline resource signature description and throws an exception in case of an error.
void ValidatePipelineResourceSignatureDesc(const PipelineResourceSignatureDesc& Desc,
- bool ShaderResourceRuntimeArraySupported,
- bool AccelStructSupported) noexcept(false);
+ const DeviceFeatures& Features) noexcept(false);
static constexpr Uint32 InvalidImmutableSamplerIndex = ~0u;
/// Finds an immutable sampler for the resource name 'ResourceName' that is defined in shader stages 'ShaderStages'.
@@ -96,9 +95,7 @@ public:
this->m_Desc.ImmutableSamplers = nullptr;
this->m_Desc.CombinedSamplerSuffix = nullptr;
- ValidatePipelineResourceSignatureDesc(Desc,
- pDevice->GetDeviceCaps().Features.ShaderResourceRuntimeArray,
- pDevice->GetDeviceCaps().Features.RayTracing);
+ ValidatePipelineResourceSignatureDesc(Desc, pDevice->GetDeviceCaps().Features);
// Determine shader stages that have any resources as well as
// shader stages that have static resources.
diff --git a/Graphics/GraphicsEngine/src/PipelineResourceSignatureBase.cpp b/Graphics/GraphicsEngine/src/PipelineResourceSignatureBase.cpp
index dff3fa0a..ae41e2ba 100644
--- a/Graphics/GraphicsEngine/src/PipelineResourceSignatureBase.cpp
+++ b/Graphics/GraphicsEngine/src/PipelineResourceSignatureBase.cpp
@@ -38,8 +38,7 @@ namespace Diligent
#define LOG_PRS_ERROR_AND_THROW(...) LOG_ERROR_AND_THROW("Description of a pipeline resource signature '", (Desc.Name ? Desc.Name : ""), "' is invalid: ", ##__VA_ARGS__)
void ValidatePipelineResourceSignatureDesc(const PipelineResourceSignatureDesc& Desc,
- bool ShaderResourceRuntimeArraySupported,
- bool AccelStructSupported) noexcept(false)
+ const DeviceFeatures& Features) noexcept(false)
{
if (Desc.BindingIndex >= MAX_RESOURCE_SIGNATURES)
LOG_PRS_ERROR_AND_THROW("Desc.BindingIndex (", Uint32{Desc.BindingIndex}, ") exceeds the maximum allowed value (", MAX_RESOURCE_SIGNATURES - 1, ").");
@@ -85,14 +84,14 @@ void ValidatePipelineResourceSignatureDesc(const PipelineResourceSignatureDesc&
}
UsedStages |= Res.ShaderStages;
- if ((Res.Flags & PIPELINE_RESOURCE_FLAG_RUNTIME_ARRAY) != 0 && !ShaderResourceRuntimeArraySupported)
+ if ((Res.Flags & PIPELINE_RESOURCE_FLAG_RUNTIME_ARRAY) != 0 && !Features.ShaderResourceRuntimeArray)
{
LOG_PRS_ERROR_AND_THROW("Incorrect Desc.Resources[", i, "].Flags (RUNTIME_ARRAY) can only be used if ShaderResourceRuntimeArray device feature is enabled.");
}
- if (Res.ResourceType == SHADER_RESOURCE_TYPE_ACCEL_STRUCT && !AccelStructSupported)
+ if (Res.ResourceType == SHADER_RESOURCE_TYPE_ACCEL_STRUCT && !Features.RayTracing)
{
- LOG_PRS_ERROR_AND_THROW("Incorrect Desc.Resources[", i, "].ResourceType (ACCEL_STRUCT): acceleration structure is not supported by device.");
+ LOG_PRS_ERROR_AND_THROW("Incorrect Desc.Resources[", i, "].ResourceType (ACCEL_STRUCT): ray tracing is not supported by device.");
}
static_assert(SHADER_RESOURCE_TYPE_LAST == 8, "Please add the new resource type to the switch below");