summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineD3D11
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2020-12-15 19:32:55 +0000
committerassiduous <assiduous@diligentgraphics.com>2020-12-15 19:32:55 +0000
commit2cbe12c8541f63719ae3662cda827ed53004c0b2 (patch)
tree6ff68d7ee7d386d1c0e30c00fcd551fcbf819c6c /Graphics/GraphicsEngineD3D11
parentMath Lib: added Matrix4x4 constructor from float4 rows (diff)
parentBasicMath: minor code formatting (diff)
downloadDiligentCore-2cbe12c8541f63719ae3662cda827ed53004c0b2.tar.gz
DiligentCore-2cbe12c8541f63719ae3662cda827ed53004c0b2.zip
Merge branch 'azhirnov-ray_tracing_2'
Diffstat (limited to 'Graphics/GraphicsEngineD3D11')
-rw-r--r--Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.hpp25
-rw-r--r--Graphics/GraphicsEngineD3D11/include/PipelineStateD3D11Impl.hpp3
-rw-r--r--Graphics/GraphicsEngineD3D11/include/RenderDeviceD3D11Impl.hpp16
-rw-r--r--Graphics/GraphicsEngineD3D11/include/ShaderResourceBindingD3D11Impl.hpp3
-rw-r--r--Graphics/GraphicsEngineD3D11/src/BufferD3D11Impl.cpp4
-rwxr-xr-xGraphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp93
-rw-r--r--Graphics/GraphicsEngineD3D11/src/PipelineStateD3D11Impl.cpp4
-rw-r--r--Graphics/GraphicsEngineD3D11/src/RenderDeviceD3D11Impl.cpp37
-rw-r--r--Graphics/GraphicsEngineD3D11/src/ShaderResourceBindingD3D11Impl.cpp4
-rwxr-xr-xGraphics/GraphicsEngineD3D11/src/ShaderResourceLayoutD3D11.cpp5
-rwxr-xr-xGraphics/GraphicsEngineD3D11/src/ShaderResourcesD3D11.cpp10
-rw-r--r--Graphics/GraphicsEngineD3D11/src/TextureBaseD3D11.cpp2
12 files changed, 167 insertions, 39 deletions
diff --git a/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.hpp b/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.hpp
index dbb74361..addf3d92 100644
--- a/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.hpp
+++ b/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.hpp
@@ -41,6 +41,8 @@
#include "FramebufferD3D11Impl.hpp"
#include "RenderPassD3D11Impl.hpp"
#include "DisjointQueryPool.hpp"
+#include "BottomLevelASBase.hpp"
+#include "TopLevelASBase.hpp"
#ifdef DILIGENT_DEBUG
# define VERIFY_CONTEXT_BINDINGS
@@ -58,6 +60,8 @@ struct DeviceContextD3D11ImplTraits
using QueryType = QueryD3D11Impl;
using FramebufferType = FramebufferD3D11Impl;
using RenderPassType = RenderPassD3D11Impl;
+ using BottomLevelASType = BottomLevelASBase<IBottomLevelAS, RenderDeviceD3D11Impl>;
+ using TopLevelASType = TopLevelASBase<ITopLevelAS, BottomLevelASType, RenderDeviceD3D11Impl>;
};
/// Device context implementation in Direct3D11 backend.
@@ -246,6 +250,27 @@ public:
/// Implementation of IDeviceContext::Flush() in Direct3D11 backend.
virtual void DILIGENT_CALL_TYPE Flush() override final;
+ /// Implementation of IDeviceContext::BuildBLAS().
+ virtual void DILIGENT_CALL_TYPE BuildBLAS(const BuildBLASAttribs& Attribs) override final;
+
+ /// Implementation of IDeviceContext::BuildTLAS().
+ virtual void DILIGENT_CALL_TYPE BuildTLAS(const BuildTLASAttribs& Attribs) override final;
+
+ /// Implementation of IDeviceContext::CopyBLAS().
+ virtual void DILIGENT_CALL_TYPE CopyBLAS(const CopyBLASAttribs& Attribs) override final;
+
+ /// Implementation of IDeviceContext::CopyTLAS().
+ virtual void DILIGENT_CALL_TYPE CopyTLAS(const CopyTLASAttribs& Attribs) override final;
+
+ /// Implementation of IDeviceContext::WriteBLASCompactedSize().
+ virtual void DILIGENT_CALL_TYPE WriteBLASCompactedSize(const WriteBLASCompactedSizeAttribs& Attribs) override final;
+
+ /// Implementation of IDeviceContext::WriteTLASCompactedSize().
+ virtual void DILIGENT_CALL_TYPE WriteTLASCompactedSize(const WriteTLASCompactedSizeAttribs& Attribs) override final;
+
+ /// Implementation of IDeviceContext::TraceRays().
+ virtual void DILIGENT_CALL_TYPE TraceRays(const TraceRaysAttribs& Attribs) override final;
+
/// Implementation of IDeviceContextD3D11::GetD3D11DeviceContext().
virtual ID3D11DeviceContext* DILIGENT_CALL_TYPE GetD3D11DeviceContext() override final { return m_pd3d11DeviceContext; }
diff --git a/Graphics/GraphicsEngineD3D11/include/PipelineStateD3D11Impl.hpp b/Graphics/GraphicsEngineD3D11/include/PipelineStateD3D11Impl.hpp
index 520e9bb0..9614ebab 100644
--- a/Graphics/GraphicsEngineD3D11/include/PipelineStateD3D11Impl.hpp
+++ b/Graphics/GraphicsEngineD3D11/include/PipelineStateD3D11Impl.hpp
@@ -166,7 +166,8 @@ private:
// Resource layout index in m_pStaticResourceLayouts array for every shader stage,
// indexed by the shader type pipeline index (returned by GetShaderTypePipelineIndex)
- std::array<Int8, MAX_SHADERS_IN_PIPELINE> m_ResourceLayoutIndex = {-1, -1, -1, -1, -1};
+ std::array<Int8, MAX_SHADERS_IN_PIPELINE> m_ResourceLayoutIndex = {-1, -1, -1, -1, -1, -1};
+ static_assert(MAX_SHADERS_IN_PIPELINE == 6, "Please update the initializer list above");
std::array<Uint16, MAX_SHADERS_IN_PIPELINE + 1> m_ImmutableSamplerOffsets = {};
struct ImmutableSamplerInfo
diff --git a/Graphics/GraphicsEngineD3D11/include/RenderDeviceD3D11Impl.hpp b/Graphics/GraphicsEngineD3D11/include/RenderDeviceD3D11Impl.hpp
index c2a1285c..3e5ef8f1 100644
--- a/Graphics/GraphicsEngineD3D11/include/RenderDeviceD3D11Impl.hpp
+++ b/Graphics/GraphicsEngineD3D11/include/RenderDeviceD3D11Impl.hpp
@@ -77,6 +77,10 @@ public:
virtual void DILIGENT_CALL_TYPE CreateComputePipelineState(const ComputePipelineStateCreateInfo& PSOCreateInfo,
IPipelineState** ppPipelineState) override final;
+ /// Implementation of IRenderDevice::CreateRayTracingPipelineState() in Direct3D11 backend.
+ virtual void DILIGENT_CALL_TYPE CreateRayTracingPipelineState(const RayTracingPipelineStateCreateInfo& PSOCreateInfo,
+ IPipelineState** ppPipelineState) override final;
+
/// Implementation of IRenderDevice::CreateFence() in Direct3D11 backend.
virtual void DILIGENT_CALL_TYPE CreateFence(const FenceDesc& Desc,
IFence** ppFence) override final;
@@ -93,6 +97,18 @@ public:
virtual void DILIGENT_CALL_TYPE CreateFramebuffer(const FramebufferDesc& Desc,
IFramebuffer** ppFramebuffer) override final;
+ /// Implementation of IRenderDevice::CreateBLAS() in Direct3D11 backend.
+ virtual void DILIGENT_CALL_TYPE CreateBLAS(const BottomLevelASDesc& Desc,
+ IBottomLevelAS** ppBLAS) override final;
+
+ /// Implementation of IRenderDevice::CreateTLAS() in Direct3D11 backend.
+ virtual void DILIGENT_CALL_TYPE CreateTLAS(const TopLevelASDesc& Desc,
+ ITopLevelAS** ppTLAS) override final;
+
+ /// Implementation of IRenderDevice::CreateSBT() in Direct3D11 backend.
+ virtual void DILIGENT_CALL_TYPE CreateSBT(const ShaderBindingTableDesc& Desc,
+ IShaderBindingTable** ppSBT) override final;
+
/// Implementation of IRenderDeviceD3D11::GetD3D11Device() in Direct3D11 backend.
ID3D11Device* DILIGENT_CALL_TYPE GetD3D11Device() override final { return m_pd3d11Device; }
diff --git a/Graphics/GraphicsEngineD3D11/include/ShaderResourceBindingD3D11Impl.hpp b/Graphics/GraphicsEngineD3D11/include/ShaderResourceBindingD3D11Impl.hpp
index 21437e0f..cd595f86 100644
--- a/Graphics/GraphicsEngineD3D11/include/ShaderResourceBindingD3D11Impl.hpp
+++ b/Graphics/GraphicsEngineD3D11/include/ShaderResourceBindingD3D11Impl.hpp
@@ -110,7 +110,8 @@ private:
// Resource layout index in m_pResourceLayouts array for every shader stage,
// indexed by the shader type pipeline index (returned by GetShaderTypePipelineIndex)
- std::array<Int8, MAX_SHADERS_IN_PIPELINE> m_ResourceLayoutIndex = {-1, -1, -1, -1, -1};
+ std::array<Int8, MAX_SHADERS_IN_PIPELINE> m_ResourceLayoutIndex = {-1, -1, -1, -1, -1, -1};
+ static_assert(MAX_SHADERS_IN_PIPELINE == 6, "Please update the initializer list above");
Uint8 m_NumActiveShaders = 0;
diff --git a/Graphics/GraphicsEngineD3D11/src/BufferD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/BufferD3D11Impl.cpp
index 16e77806..438bafff 100644
--- a/Graphics/GraphicsEngineD3D11/src/BufferD3D11Impl.cpp
+++ b/Graphics/GraphicsEngineD3D11/src/BufferD3D11Impl.cpp
@@ -259,7 +259,7 @@ void BufferD3D11Impl::CreateViewInternal(const BufferViewDesc& OrigViewDesc, IBu
void BufferD3D11Impl::CreateUAV(BufferViewDesc& UAVDesc, ID3D11UnorderedAccessView** ppD3D11UAV)
{
- CorrectBufferViewDesc(UAVDesc);
+ ValidateAndCorrectBufferViewDesc(m_Desc, UAVDesc);
D3D11_UNORDERED_ACCESS_VIEW_DESC D3D11_UAVDesc;
BufferViewDesc_to_D3D11_UAV_DESC(m_Desc, UAVDesc, D3D11_UAVDesc);
@@ -271,7 +271,7 @@ void BufferD3D11Impl::CreateUAV(BufferViewDesc& UAVDesc, ID3D11UnorderedAccessVi
void BufferD3D11Impl::CreateSRV(struct BufferViewDesc& SRVDesc, ID3D11ShaderResourceView** ppD3D11SRV)
{
- CorrectBufferViewDesc(SRVDesc);
+ ValidateAndCorrectBufferViewDesc(m_Desc, SRVDesc);
D3D11_SHADER_RESOURCE_VIEW_DESC D3D11_SRVDesc;
BufferViewDesc_to_D3D11_SRV_DESC(m_Desc, SRVDesc, D3D11_SRVDesc);
diff --git a/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp
index 7bd31e8b..3ebddc85 100755
--- a/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp
+++ b/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp
@@ -2159,7 +2159,6 @@ void DeviceContextD3D11Impl::TransitionResourceStates(Uint32 BarrierCount, State
#ifdef DILIGENT_DEVELOPMENT
DvpVerifyStateTransitionDesc(Barrier);
#endif
- DEV_CHECK_ERR((Barrier.pTexture != nullptr) ^ (Barrier.pBuffer != nullptr), "Exactly one of pTexture or pBuffer must not be null");
DEV_CHECK_ERR(Barrier.NewState != RESOURCE_STATE_UNKNOWN, "New resource state can't be unknown");
if (Barrier.TransitionType == STATE_TRANSITION_TYPE_BEGIN)
@@ -2170,28 +2169,27 @@ void DeviceContextD3D11Impl::TransitionResourceStates(Uint32 BarrierCount, State
}
VERIFY(Barrier.TransitionType == STATE_TRANSITION_TYPE_IMMEDIATE || Barrier.TransitionType == STATE_TRANSITION_TYPE_END, "Unexpected barrier type");
- if (Barrier.pTexture)
+ if (RefCntAutoPtr<TextureBaseD3D11> pTexture{Barrier.pResource, IID_TextureD3D11})
{
- auto* pTextureD3D11Impl = ValidatedCast<TextureBaseD3D11>(Barrier.pTexture);
- auto OldState = Barrier.OldState;
+ auto OldState = Barrier.OldState;
if (OldState == RESOURCE_STATE_UNKNOWN)
{
- if (pTextureD3D11Impl->IsInKnownState())
+ if (pTexture->IsInKnownState())
{
- OldState = pTextureD3D11Impl->GetState();
+ OldState = pTexture->GetState();
}
else
{
- LOG_ERROR_MESSAGE("Failed to transition the state of texture '", pTextureD3D11Impl->GetDesc().Name, "' because the buffer state is unknown and is not explicitly specified");
+ LOG_ERROR_MESSAGE("Failed to transition the state of texture '", pTexture->GetDesc().Name, "' because the buffer state is unknown and is not explicitly specified");
continue;
}
}
else
{
- if (pTextureD3D11Impl->IsInKnownState() && pTextureD3D11Impl->GetState() != OldState)
+ if (pTexture->IsInKnownState() && pTexture->GetState() != OldState)
{
- LOG_ERROR_MESSAGE("The state ", GetResourceStateString(pTextureD3D11Impl->GetState()), " of texture '",
- pTextureD3D11Impl->GetDesc().Name, "' does not match the old state ", GetResourceStateString(OldState),
+ LOG_ERROR_MESSAGE("The state ", GetResourceStateString(pTexture->GetState()), " of texture '",
+ pTexture->GetDesc().Name, "' does not match the old state ", GetResourceStateString(OldState),
" specified by the barrier");
}
}
@@ -2199,52 +2197,50 @@ void DeviceContextD3D11Impl::TransitionResourceStates(Uint32 BarrierCount, State
if ((Barrier.NewState & RESOURCE_STATE_UNORDERED_ACCESS) != 0)
{
DEV_CHECK_ERR((Barrier.NewState & (RESOURCE_STATE_GENERIC_READ | RESOURCE_STATE_INPUT_ATTACHMENT)) == 0, "Unordered access state is not compatible with any input state");
- UnbindTextureFromInput(pTextureD3D11Impl, pTextureD3D11Impl->GetD3D11Texture());
+ UnbindTextureFromInput(pTexture, pTexture->GetD3D11Texture());
}
if ((Barrier.NewState & (RESOURCE_STATE_GENERIC_READ | RESOURCE_STATE_INPUT_ATTACHMENT)) != 0)
{
if ((OldState & RESOURCE_STATE_RENDER_TARGET) != 0)
- UnbindTextureFromRenderTarget(pTextureD3D11Impl);
+ UnbindTextureFromRenderTarget(pTexture);
if ((OldState & RESOURCE_STATE_DEPTH_WRITE) != 0)
- UnbindTextureFromDepthStencil(pTextureD3D11Impl);
+ UnbindTextureFromDepthStencil(pTexture);
if ((OldState & RESOURCE_STATE_UNORDERED_ACCESS) != 0)
{
- UnbindResourceFromUAV(pTextureD3D11Impl, pTextureD3D11Impl->GetD3D11Texture());
- pTextureD3D11Impl->ClearState(RESOURCE_STATE_UNORDERED_ACCESS);
+ UnbindResourceFromUAV(pTexture, pTexture->GetD3D11Texture());
+ pTexture->ClearState(RESOURCE_STATE_UNORDERED_ACCESS);
}
}
if (Barrier.UpdateResourceState)
{
- pTextureD3D11Impl->SetState(Barrier.NewState);
+ pTexture->SetState(Barrier.NewState);
}
}
- else
+ else if (RefCntAutoPtr<BufferD3D11Impl> pBuffer{Barrier.pResource, IID_BufferD3D11})
{
- VERIFY_EXPR(Barrier.pBuffer);
- auto* pBufferD3D11Impl = ValidatedCast<BufferD3D11Impl>(Barrier.pBuffer);
- auto OldState = Barrier.OldState;
+ auto OldState = Barrier.OldState;
if (OldState == RESOURCE_STATE_UNKNOWN)
{
- if (pBufferD3D11Impl->IsInKnownState())
+ if (pBuffer->IsInKnownState())
{
- OldState = pBufferD3D11Impl->GetState();
+ OldState = pBuffer->GetState();
}
else
{
- LOG_ERROR_MESSAGE("Failed to transition the state of buffer '", pBufferD3D11Impl->GetDesc().Name, "' because the buffer state is unknown and is not explicitly specified");
+ LOG_ERROR_MESSAGE("Failed to transition the state of buffer '", pBuffer->GetDesc().Name, "' because the buffer state is unknown and is not explicitly specified");
continue;
}
}
else
{
- if (pBufferD3D11Impl->IsInKnownState() && pBufferD3D11Impl->GetState() != OldState)
+ if (pBuffer->IsInKnownState() && pBuffer->GetState() != OldState)
{
- LOG_ERROR_MESSAGE("The state ", GetResourceStateString(pBufferD3D11Impl->GetState()), " of buffer '",
- pBufferD3D11Impl->GetDesc().Name, "' does not match the old state ", GetResourceStateString(OldState),
+ LOG_ERROR_MESSAGE("The state ", GetResourceStateString(pBuffer->GetState()), " of buffer '",
+ pBuffer->GetDesc().Name, "' does not match the old state ", GetResourceStateString(OldState),
" specified by the barrier");
}
}
@@ -2252,19 +2248,23 @@ void DeviceContextD3D11Impl::TransitionResourceStates(Uint32 BarrierCount, State
if ((Barrier.NewState & RESOURCE_STATE_UNORDERED_ACCESS) != 0)
{
DEV_CHECK_ERR((Barrier.NewState & RESOURCE_STATE_GENERIC_READ) == 0, "Unordered access state is not compatible with any input state");
- UnbindBufferFromInput(pBufferD3D11Impl, pBufferD3D11Impl->m_pd3d11Buffer);
+ UnbindBufferFromInput(pBuffer, pBuffer->m_pd3d11Buffer);
}
if ((Barrier.NewState & RESOURCE_STATE_GENERIC_READ) != 0)
{
- UnbindResourceFromUAV(pBufferD3D11Impl, pBufferD3D11Impl->m_pd3d11Buffer);
+ UnbindResourceFromUAV(pBuffer, pBuffer->m_pd3d11Buffer);
}
if (Barrier.UpdateResourceState)
{
- pBufferD3D11Impl->SetState(Barrier.NewState);
+ pBuffer->SetState(Barrier.NewState);
}
}
+ else
+ {
+ UNEXPECTED("The type of resource '", Barrier.pResource->GetDesc().Name, "' is not support in D3D11");
+ }
}
}
@@ -2301,6 +2301,41 @@ void DeviceContextD3D11Impl::ResolveTextureSubresource(ITexture*
m_pd3d11DeviceContext->ResolveSubresource(pDstTexD3D11->GetD3D11Texture(), DstSubresIndex, pSrcTexD3D11->GetD3D11Texture(), SrcSubresIndex, DXGIFmt);
}
+void DeviceContextD3D11Impl::BuildBLAS(const BuildBLASAttribs& Attribs)
+{
+ UNSUPPORTED("BuildBLAS is not supported in DirectX 11");
+}
+
+void DeviceContextD3D11Impl::BuildTLAS(const BuildTLASAttribs& Attribs)
+{
+ UNSUPPORTED("BuildTLAS is not supported in DirectX 11");
+}
+
+void DeviceContextD3D11Impl::CopyBLAS(const CopyBLASAttribs& Attribs)
+{
+ UNSUPPORTED("CopyBLAS is not supported in DirectX 11");
+}
+
+void DeviceContextD3D11Impl::CopyTLAS(const CopyTLASAttribs& Attribs)
+{
+ UNSUPPORTED("CopyTLAS is not supported in DirectX 11");
+}
+
+void DeviceContextD3D11Impl::WriteBLASCompactedSize(const WriteBLASCompactedSizeAttribs& Attribs)
+{
+ UNSUPPORTED("CopyTLAS is not supported in DirectX 11");
+}
+
+void DeviceContextD3D11Impl::WriteTLASCompactedSize(const WriteTLASCompactedSizeAttribs& Attribs)
+{
+ UNSUPPORTED("CopyTLAS is not supported in DirectX 11");
+}
+
+void DeviceContextD3D11Impl::TraceRays(const TraceRaysAttribs& Attribs)
+{
+ UNSUPPORTED("TraceRays is not supported in DirectX 11");
+}
+
// clang-format off
#ifdef VERIFY_CONTEXT_BINDINGS
DEFINE_D3D11CTX_FUNC_POINTERS(GetCBMethods, GetConstantBuffers)
diff --git a/Graphics/GraphicsEngineD3D11/src/PipelineStateD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/PipelineStateD3D11Impl.cpp
index 108f149c..dd3566b8 100644
--- a/Graphics/GraphicsEngineD3D11/src/PipelineStateD3D11Impl.cpp
+++ b/Graphics/GraphicsEngineD3D11/src/PipelineStateD3D11Impl.cpp
@@ -46,7 +46,7 @@ void PipelineStateD3D11Impl::InitInternalObjects(const PSOCreateInfoType& Create
const auto NumShaderStages = GetNumShaderStages();
VERIFY_EXPR(NumShaderStages > 0 && NumShaderStages == ShaderStages.size());
- LinearAllocator MemPool{GetRawAllocator()};
+ FixedLinearAllocator MemPool{GetRawAllocator()};
MemPool.AddSpace<ShaderResourceCacheD3D11>(NumShaderStages);
MemPool.AddSpace<ShaderResourceLayoutD3D11>(NumShaderStages);
@@ -203,6 +203,8 @@ PipelineStateD3D11Impl::~PipelineStateD3D11Impl()
void PipelineStateD3D11Impl::Destruct()
{
+ TPipelineStateBase::Destruct();
+
if (m_pStaticResourceLayouts != nullptr)
{
for (Uint32 l = 0; l < GetNumShaderStages(); ++l)
diff --git a/Graphics/GraphicsEngineD3D11/src/RenderDeviceD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/RenderDeviceD3D11Impl.cpp
index 8d45e547..91ab6592 100644
--- a/Graphics/GraphicsEngineD3D11/src/RenderDeviceD3D11Impl.cpp
+++ b/Graphics/GraphicsEngineD3D11/src/RenderDeviceD3D11Impl.cpp
@@ -101,13 +101,18 @@ RenderDeviceD3D11Impl::RenderDeviceD3D11Impl(IReferenceCounters* pRefCo
sizeof(FenceD3D11Impl),
sizeof(QueryD3D11Impl),
sizeof(RenderPassD3D11Impl),
- sizeof(FramebufferD3D11Impl)
+ sizeof(FramebufferD3D11Impl),
+ 0,
+ 0,
+ 0
}
},
m_EngineAttribs{EngineAttribs},
m_pd3d11Device {pd3d11Device }
// clang-format on
{
+ static_assert(sizeof(DeviceObjectSizes) == sizeof(size_t) * 15, "Please add new objects to DeviceObjectSizes constructor");
+
m_DeviceCaps.DevType = RENDER_DEVICE_TYPE_D3D11;
auto FeatureLevel = m_pd3d11Device->GetFeatureLevel();
switch (FeatureLevel)
@@ -147,6 +152,7 @@ RenderDeviceD3D11Impl::RenderDeviceD3D11Impl(IReferenceCounters* pRefCo
UNSUPPORTED_FEATURE(BindlessResources, "Bindless resources are");
UNSUPPORTED_FEATURE(VertexPipelineUAVWritesAndAtomics, "Vertex pipeline UAV writes and atomics are");
UNSUPPORTED_FEATURE(MeshShaders, "Mesh shaders are");
+ UNSUPPORTED_FEATURE(RayTracing, "Ray tracing is");
{
bool ShaderFloat16Supported = false;
@@ -176,7 +182,7 @@ RenderDeviceD3D11Impl::RenderDeviceD3D11Impl(IReferenceCounters* pRefCo
#undef UNSUPPORTED_FEATURE
#if defined(_MSC_VER) && defined(_WIN64)
- static_assert(sizeof(DeviceFeatures) == 31, "Did you add a new feature to DeviceFeatures? Please handle its satus here.");
+ static_assert(sizeof(DeviceFeatures) == 32, "Did you add a new feature to DeviceFeatures? Please handle its satus here.");
#endif
auto& TexCaps = m_DeviceCaps.TexCaps;
@@ -408,6 +414,12 @@ void RenderDeviceD3D11Impl::CreateComputePipelineState(const ComputePipelineStat
CreatePipelineState(PSOCreateInfo, ppPipelineState);
}
+void RenderDeviceD3D11Impl::CreateRayTracingPipelineState(const RayTracingPipelineStateCreateInfo& PSOCreateInfo, IPipelineState** ppPipelineState)
+{
+ UNSUPPORTED("Ray tracing is not supported in DirectX 11");
+ *ppPipelineState = nullptr;
+}
+
void RenderDeviceD3D11Impl::CreateFence(const FenceDesc& Desc, IFence** ppFence)
{
CreateDeviceObject("Fence", Desc, ppFence,
@@ -452,6 +464,27 @@ void RenderDeviceD3D11Impl::CreateFramebuffer(const FramebufferDesc& Desc, IFram
});
}
+void RenderDeviceD3D11Impl::CreateBLAS(const BottomLevelASDesc& Desc,
+ IBottomLevelAS** ppBLAS)
+{
+ UNSUPPORTED("CreateBLAS is not supported in DirectX 11");
+ *ppBLAS = nullptr;
+}
+
+void RenderDeviceD3D11Impl::CreateTLAS(const TopLevelASDesc& Desc,
+ ITopLevelAS** ppTLAS)
+{
+ UNSUPPORTED("CreateTLAS is not supported in DirectX 11");
+ *ppTLAS = nullptr;
+}
+
+void RenderDeviceD3D11Impl::CreateSBT(const ShaderBindingTableDesc& Desc,
+ IShaderBindingTable** ppSBT)
+{
+ UNSUPPORTED("CreateSBT is not supported in DirectX 11");
+ *ppSBT = nullptr;
+}
+
void RenderDeviceD3D11Impl::IdleGPU()
{
if (auto pImmediateCtx = m_wpImmediateContext.Lock())
diff --git a/Graphics/GraphicsEngineD3D11/src/ShaderResourceBindingD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/ShaderResourceBindingD3D11Impl.cpp
index 46833c81..c33ba26e 100644
--- a/Graphics/GraphicsEngineD3D11/src/ShaderResourceBindingD3D11Impl.cpp
+++ b/Graphics/GraphicsEngineD3D11/src/ShaderResourceBindingD3D11Impl.cpp
@@ -31,7 +31,7 @@
#include "DeviceContextD3D11Impl.hpp"
#include "RenderDeviceD3D11Impl.hpp"
#include "ShaderD3D11Impl.hpp"
-#include "LinearAllocator.hpp"
+#include "FixedLinearAllocator.hpp"
namespace Diligent
{
@@ -55,7 +55,7 @@ ShaderResourceBindingD3D11Impl::ShaderResourceBindingD3D11Impl(IReferenceCounter
m_ResourceLayoutIndex.fill(-1);
m_NumActiveShaders = static_cast<Uint8>(pPSO->GetNumShaderStages());
- LinearAllocator MemPool{GetRawAllocator()};
+ FixedLinearAllocator MemPool{GetRawAllocator()};
MemPool.AddSpace<ShaderResourceCacheD3D11>(m_NumActiveShaders);
MemPool.AddSpace<ShaderResourceLayoutD3D11>(m_NumActiveShaders);
diff --git a/Graphics/GraphicsEngineD3D11/src/ShaderResourceLayoutD3D11.cpp b/Graphics/GraphicsEngineD3D11/src/ShaderResourceLayoutD3D11.cpp
index f7c1958d..0c4c38c7 100755
--- a/Graphics/GraphicsEngineD3D11/src/ShaderResourceLayoutD3D11.cpp
+++ b/Graphics/GraphicsEngineD3D11/src/ShaderResourceLayoutD3D11.cpp
@@ -292,6 +292,11 @@ void ShaderResourceLayoutD3D11::Initialize(std::shared_ptr<const ShaderResources
new (&GetResource<BuffUAVBindInfo>(bufUav++)) BuffUAVBindInfo(BuffUAV, *this, VarType);
NumUAVSlots = std::max(NumUAVSlots, Uint32{BuffUAV.BindPoint} + Uint32{BuffUAV.BindCount});
}
+ },
+
+ [&](const D3DShaderResourceAttribs&, Uint32) //
+ {
+ UNEXPECTED("acceleration structure is not supported in DirectX 11");
});
// clang-format off
diff --git a/Graphics/GraphicsEngineD3D11/src/ShaderResourcesD3D11.cpp b/Graphics/GraphicsEngineD3D11/src/ShaderResourcesD3D11.cpp
index 21a65108..071d2f59 100755
--- a/Graphics/GraphicsEngineD3D11/src/ShaderResourcesD3D11.cpp
+++ b/Graphics/GraphicsEngineD3D11/src/ShaderResourcesD3D11.cpp
@@ -94,6 +94,11 @@ ShaderResourcesD3D11::ShaderResourcesD3D11(RenderDeviceD3D11Impl* pDeviceD3D11Im
Resources.m_MaxSRVBindPoint = std::max(Resources.m_MaxSRVBindPoint, static_cast<MaxBindPointType>(TexAttribs.BindPoint + TexAttribs.BindCount - 1));
}
+ void OnNewAccelStruct(const D3DShaderResourceAttribs& ASAttribs)
+ {
+ UNEXPECTED("Acceleration structure is not supported in DirectX 11");
+ }
+
~NewResourceHandler()
{
}
@@ -439,6 +444,11 @@ void ShaderResourcesD3D11::dvpVerifyCommittedResources(ID3D11Buffer*
return;
}
}
+ },
+
+ [&](const D3DShaderResourceAttribs&, Uint32) //
+ {
+ UNEXPECTED("Acceleration structure is not supported in DirectX 11");
} // clang-format off
); // clang-format on
}
diff --git a/Graphics/GraphicsEngineD3D11/src/TextureBaseD3D11.cpp b/Graphics/GraphicsEngineD3D11/src/TextureBaseD3D11.cpp
index 0e9b217b..cb83f194 100644
--- a/Graphics/GraphicsEngineD3D11/src/TextureBaseD3D11.cpp
+++ b/Graphics/GraphicsEngineD3D11/src/TextureBaseD3D11.cpp
@@ -70,7 +70,7 @@ void TextureBaseD3D11::CreateViewInternal(const struct TextureViewDesc& ViewDesc
try
{
auto UpdatedViewDesc = ViewDesc;
- CorrectTextureViewDesc(UpdatedViewDesc);
+ ValidatedAndCorrectTextureViewDesc(m_Desc, UpdatedViewDesc);
RefCntAutoPtr<ID3D11View> pD3D11View;
switch (ViewDesc.ViewType)