summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineD3D12
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2020-10-14 08:04:05 +0000
committerassiduous <assiduous@diligentgraphics.com>2020-10-14 08:04:05 +0000
commitb3fec8bd40e80115086281bce74774617aa95e23 (patch)
tree99c9b3250484d6a5f3283320aea8b7b90f3f30c1 /Graphics/GraphicsEngineD3D12
parentShader variable access test: fixed issue with raw buffers in GL/VK/Metal (diff)
downloadDiligentCore-b3fec8bd40e80115086281bce74774617aa95e23.tar.gz
DiligentCore-b3fec8bd40e80115086281bce74774617aa95e23.zip
Added buffer mode validation when binding buffer views
Diffstat (limited to 'Graphics/GraphicsEngineD3D12')
-rw-r--r--Graphics/GraphicsEngineD3D12/src/ShaderResourceLayoutD3D12.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/Graphics/GraphicsEngineD3D12/src/ShaderResourceLayoutD3D12.cpp b/Graphics/GraphicsEngineD3D12/src/ShaderResourceLayoutD3D12.cpp
index 6c313882..f00d62e7 100644
--- a/Graphics/GraphicsEngineD3D12/src/ShaderResourceLayoutD3D12.cpp
+++ b/Graphics/GraphicsEngineD3D12/src/ShaderResourceLayoutD3D12.cpp
@@ -38,6 +38,7 @@
#include "RootSignature.hpp"
#include "PipelineStateD3D12Impl.hpp"
#include "ShaderResourceVariableBase.hpp"
+#include "ShaderVariableD3DBase.hpp"
namespace Diligent
{
@@ -429,6 +430,11 @@ template <>
struct ResourceViewTraits<ITextureViewD3D12>
{
static const INTERFACE_ID& IID;
+
+ static bool VerifyView(ITextureViewD3D12* pViewD3D12, const D3DShaderResourceAttribs& Attribs, const char* ShaderName)
+ {
+ return true;
+ }
};
const INTERFACE_ID& ResourceViewTraits<ITextureViewD3D12>::IID = IID_TextureViewD3D12;
@@ -436,6 +442,11 @@ template <>
struct ResourceViewTraits<IBufferViewD3D12>
{
static const INTERFACE_ID& IID;
+
+ static bool VerifyView(IBufferViewD3D12* pViewD3D12, const D3DShaderResourceAttribs& Attribs, const char* ShaderName)
+ {
+ return VerifyBufferViewModeD3D(pViewD3D12, Attribs, ShaderName);
+ }
};
const INTERFACE_ID& ResourceViewTraits<IBufferViewD3D12>::IID = IID_BufferViewD3D12;
@@ -454,6 +465,7 @@ void ShaderResourceLayoutD3D12::D3D12Resource::CacheResourceView(IDeviceObject*
RefCntAutoPtr<TResourceViewType> pViewD3D12(pView, ResourceViewTraits<TResourceViewType>::IID);
#ifdef DILIGENT_DEVELOPMENT
VerifyResourceViewBinding(Attribs, GetVariableType(), ArrayIndex, pView, pViewD3D12.RawPtr(), {dbgExpectedViewType}, DstRes.pObject.RawPtr(), ParentResLayout.GetShaderName());
+ ResourceViewTraits<TResourceViewType>::VerifyView(pViewD3D12, Attribs, ParentResLayout.GetShaderName());
#endif
if (pViewD3D12)
{