From a5aa4f7f3b82a097c73712cade508cf7a9274e67 Mon Sep 17 00:00:00 2001 From: assiduous Date: Mon, 1 Mar 2021 11:45:04 -0800 Subject: Added resource signature creation failure test; fxied validation of resource flags. --- .../GraphicsEngineD3D12/src/PipelineResourceSignatureD3D12Impl.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Graphics/GraphicsEngineD3D12') diff --git a/Graphics/GraphicsEngineD3D12/src/PipelineResourceSignatureD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/PipelineResourceSignatureD3D12Impl.cpp index acbda862..edfbeda7 100644 --- a/Graphics/GraphicsEngineD3D12/src/PipelineResourceSignatureD3D12Impl.cpp +++ b/Graphics/GraphicsEngineD3D12/src/PipelineResourceSignatureD3D12Impl.cpp @@ -333,6 +333,9 @@ void PipelineResourceSignatureD3D12Impl::AllocateRootParameters(StaticResCacheTb NumResources[d3d12DescriptorRangeType] += ResDesc.ArraySize; } + const auto dbgValidResourceFlags = GetValidPipelineResourceFlags(ResDesc.ResourceType); + VERIFY((ResDesc.Flags & ~dbgValidResourceFlags) == 0, "Invalid resource flags. This error should've been caught by ValidatePipelineResourceSignatureDesc."); + const auto UseDynamicOffset = (ResDesc.Flags & PIPELINE_RESOURCE_FLAG_NO_DYNAMIC_BUFFERS) == 0; const auto IsFormattedBuffer = (ResDesc.Flags & PIPELINE_RESOURCE_FLAG_FORMATTED_BUFFER) != 0; const auto IsArray = ResDesc.ArraySize != 1; @@ -341,7 +344,7 @@ void PipelineResourceSignatureD3D12Impl::AllocateRootParameters(StaticResCacheTb switch (ResDesc.ResourceType) { case SHADER_RESOURCE_TYPE_CONSTANT_BUFFER: - VERIFY(!IsFormattedBuffer, "Constant buffers can't be labeled as formatted. This error should've been cuaght by ValidatePipelineResourceSignatureDesc()."); + VERIFY(!IsFormattedBuffer, "Constant buffers can't be labeled as formatted. This error should've been caught by ValidatePipelineResourceSignatureDesc()."); d3d12RootParamType = UseDynamicOffset && !IsArray ? D3D12_ROOT_PARAMETER_TYPE_CBV : D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE; break; -- cgit v1.2.3