diff options
| author | assiduous <assiduous@diligentgraphics.com> | 2021-03-01 06:50:05 +0000 |
|---|---|---|
| committer | assiduous <assiduous@diligentgraphics.com> | 2021-03-19 00:38:13 +0000 |
| commit | 3a1957035682ca100699894b5fc0bdf18916437d (patch) | |
| tree | 53873a2bdf2a7d4ed0b9b8fb0edb8275e073d275 /Graphics/GraphicsEngineD3D12 | |
| parent | Resource signature: added validation that combined samplers are assigned to a... (diff) | |
| download | DiligentCore-3a1957035682ca100699894b5fc0bdf18916437d.tar.gz DiligentCore-3a1957035682ca100699894b5fc0bdf18916437d.zip | |
Added test for input attachments in the resource signature; fixed few issues in D3D12
Diffstat (limited to 'Graphics/GraphicsEngineD3D12')
4 files changed, 8 insertions, 2 deletions
diff --git a/Graphics/GraphicsEngineD3D12/src/D3D12TypeConversions.cpp b/Graphics/GraphicsEngineD3D12/src/D3D12TypeConversions.cpp index ee6669ea..a11b6339 100644 --- a/Graphics/GraphicsEngineD3D12/src/D3D12TypeConversions.cpp +++ b/Graphics/GraphicsEngineD3D12/src/D3D12TypeConversions.cpp @@ -767,8 +767,8 @@ D3D12_DESCRIPTOR_RANGE_TYPE ResourceTypeToD3D12DescriptorRangeType(SHADER_RESOUR case SHADER_RESOURCE_TYPE_BUFFER_UAV: return D3D12_DESCRIPTOR_RANGE_TYPE_UAV; case SHADER_RESOURCE_TYPE_SAMPLER: return D3D12_DESCRIPTOR_RANGE_TYPE_SAMPLER; case SHADER_RESOURCE_TYPE_ACCEL_STRUCT: return D3D12_DESCRIPTOR_RANGE_TYPE_SRV; + case SHADER_RESOURCE_TYPE_INPUT_ATTACHMENT:return D3D12_DESCRIPTOR_RANGE_TYPE_SRV; // clang-format on - case SHADER_RESOURCE_TYPE_INPUT_ATTACHMENT: default: UNEXPECTED("Unknown resource type"); return static_cast<D3D12_DESCRIPTOR_RANGE_TYPE>(-1); diff --git a/Graphics/GraphicsEngineD3D12/src/PipelineResourceSignatureD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/PipelineResourceSignatureD3D12Impl.cpp index 650226f6..acbda862 100644 --- a/Graphics/GraphicsEngineD3D12/src/PipelineResourceSignatureD3D12Impl.cpp +++ b/Graphics/GraphicsEngineD3D12/src/PipelineResourceSignatureD3D12Impl.cpp @@ -1180,6 +1180,7 @@ void BindResourceHelper::operator()(IDeviceObject* pObj) const break; case SHADER_RESOURCE_TYPE_TEXTURE_SRV: + case SHADER_RESOURCE_TYPE_INPUT_ATTACHMENT: CacheResourceView<TextureViewD3D12Impl>(pObj, TEXTURE_VIEW_SHADER_RESOURCE); break; diff --git a/Graphics/GraphicsEngineD3D12/src/PipelineStateD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/PipelineStateD3D12Impl.cpp index f89a64a0..0db2d4ac 100644 --- a/Graphics/GraphicsEngineD3D12/src/PipelineStateD3D12Impl.cpp +++ b/Graphics/GraphicsEngineD3D12/src/PipelineStateD3D12Impl.cpp @@ -725,7 +725,10 @@ void PipelineStateD3D12Impl::DvpValidateShaderResources(const ShaderD3D12Impl* p { const auto& ResDesc = pSignature->GetResourceDesc(ResAttribution.ResourceIndex); - if (Type != ResDesc.ResourceType) + auto ResourceType = ResDesc.ResourceType; + if (ResourceType == SHADER_RESOURCE_TYPE_INPUT_ATTACHMENT) + ResourceType = SHADER_RESOURCE_TYPE_TEXTURE_SRV; + if (Type != ResourceType) { LOG_ERROR_AND_THROW("Shader '", pShader->GetDesc().Name, "' contains resource with name '", Attribs.Name, "' and type '", GetShaderResourceTypeLiteralName(Type), "' that is not compatible with type '", diff --git a/Graphics/GraphicsEngineD3D12/src/ShaderResourceCacheD3D12.cpp b/Graphics/GraphicsEngineD3D12/src/ShaderResourceCacheD3D12.cpp index 0fb0def1..073fbdc9 100644 --- a/Graphics/GraphicsEngineD3D12/src/ShaderResourceCacheD3D12.cpp +++ b/Graphics/GraphicsEngineD3D12/src/ShaderResourceCacheD3D12.cpp @@ -461,6 +461,7 @@ void ShaderResourceCacheD3D12::Resource::TransitionResource(CommandContext& Ctx) break; case SHADER_RESOURCE_TYPE_TEXTURE_SRV: + case SHADER_RESOURCE_TYPE_INPUT_ATTACHMENT: { auto* pTexViewD3D12 = pObject.RawPtr<TextureViewD3D12Impl>(); auto* pTexToTransition = pTexViewD3D12->GetTexture<TextureD3D12Impl>(); @@ -558,6 +559,7 @@ void ShaderResourceCacheD3D12::Resource::DvpVerifyResourceState() break; case SHADER_RESOURCE_TYPE_TEXTURE_SRV: + case SHADER_RESOURCE_TYPE_INPUT_ATTACHMENT: { const auto* pTexViewD3D12 = pObject.RawPtr<const TextureViewD3D12Impl>(); const auto* pTexD3D12 = pTexViewD3D12->GetTexture<TextureD3D12Impl>(); |
