diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2019-04-25 05:17:09 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2019-04-25 05:17:09 +0000 |
| commit | f3698c9127d6e384eabe779b8fb3519c94e0babb (patch) | |
| tree | 9e24ffe8d89b58d464766d7c03ecabe4fe62d466 /Graphics/GraphicsEngineD3D11 | |
| parent | Added slerp; updated Quaternion in math lib (diff) | |
| download | DiligentCore-f3698c9127d6e384eabe779b8fb3519c94e0babb.tar.gz DiligentCore-f3698c9127d6e384eabe779b8fb3519c94e0babb.zip | |
Added IShaderResourceVariable::IsBound method (updated API version to 240024)
Diffstat (limited to 'Graphics/GraphicsEngineD3D11')
| -rw-r--r-- | Graphics/GraphicsEngineD3D11/include/ShaderResourceLayoutD3D11.h | 38 | ||||
| -rwxr-xr-x | Graphics/GraphicsEngineD3D11/src/ShaderResourceLayoutD3D11.cpp | 39 |
2 files changed, 32 insertions, 45 deletions
diff --git a/Graphics/GraphicsEngineD3D11/include/ShaderResourceLayoutD3D11.h b/Graphics/GraphicsEngineD3D11/include/ShaderResourceLayoutD3D11.h index bfc39727..d19a611b 100644 --- a/Graphics/GraphicsEngineD3D11/include/ShaderResourceLayoutD3D11.h +++ b/Graphics/GraphicsEngineD3D11/include/ShaderResourceLayoutD3D11.h @@ -87,7 +87,11 @@ public: BindResource(ppObjects[elem], FirstElement+elem); } - __forceinline bool IsBound(Uint32 ArrayIndex)const; + virtual bool IsBound(Uint32 ArrayIndex)const override final + { + VERIFY_EXPR(ArrayIndex < m_Attribs.BindCount); + return m_ParentResLayout.m_ResourceCache.IsCBBound(m_Attribs.BindPoint + ArrayIndex); + } }; struct TexSRVBindInfo final : ShaderVariableD3D11Base @@ -110,7 +114,12 @@ public: BindResource(ppObjects[elem], FirstElement+elem); } - __forceinline bool IsBound(Uint32 ArrayIndex)const; + virtual bool IsBound(Uint32 ArrayIndex)const override final + { + VERIFY_EXPR(ArrayIndex < m_Attribs.BindCount); + return m_ParentResLayout.m_ResourceCache.IsSRVBound(m_Attribs.BindPoint + ArrayIndex, true); + } + bool ValidSamplerAssigned() const {return SamplerIndex != InvalidSamplerIndex;} @@ -136,7 +145,11 @@ public: BindResource(ppObjects[elem], FirstElement+elem); } - __forceinline bool IsBound(Uint32 ArrayIndex)const; + __forceinline virtual bool IsBound(Uint32 ArrayIndex)const override final + { + VERIFY_EXPR(ArrayIndex < m_Attribs.BindCount); + return m_ParentResLayout.m_ResourceCache.IsUAVBound(m_Attribs.BindPoint + ArrayIndex, true); + } }; struct BuffUAVBindInfo final : ShaderVariableD3D11Base @@ -157,7 +170,12 @@ public: BindResource(ppObjects[elem], FirstElement+elem); } - __forceinline bool IsBound(Uint32 ArrayIndex)const; + virtual bool IsBound(Uint32 ArrayIndex)const override final + { + VERIFY_EXPR(ArrayIndex < m_Attribs.BindCount); + return m_ParentResLayout.m_ResourceCache.IsUAVBound(m_Attribs.BindPoint + ArrayIndex, false); + } + }; struct BuffSRVBindInfo final : ShaderVariableD3D11Base @@ -178,7 +196,11 @@ public: BindResource(ppObjects[elem], FirstElement+elem); } - __forceinline bool IsBound(Uint32 ArrayIndex)const; + virtual bool IsBound(Uint32 ArrayIndex)const override final + { + VERIFY_EXPR(ArrayIndex < m_Attribs.BindCount); + return m_ParentResLayout.m_ResourceCache.IsSRVBound(m_Attribs.BindPoint + ArrayIndex, false); + } }; struct SamplerBindInfo final : ShaderVariableD3D11Base @@ -199,7 +221,11 @@ public: BindResource(ppObjects[elem], FirstElement+elem); } - __forceinline bool IsBound(Uint32 ArrayIndex)const; + virtual bool IsBound(Uint32 ArrayIndex)const override final + { + VERIFY_EXPR(ArrayIndex < m_Attribs.BindCount); + return m_ParentResLayout.m_ResourceCache.IsSamplerBound(m_Attribs.BindPoint + ArrayIndex); + } }; // dbgResourceCache is only used for sanity check and as a remainder that the resource cache must be alive diff --git a/Graphics/GraphicsEngineD3D11/src/ShaderResourceLayoutD3D11.cpp b/Graphics/GraphicsEngineD3D11/src/ShaderResourceLayoutD3D11.cpp index 4ac61366..7f8623b0 100755 --- a/Graphics/GraphicsEngineD3D11/src/ShaderResourceLayoutD3D11.cpp +++ b/Graphics/GraphicsEngineD3D11/src/ShaderResourceLayoutD3D11.cpp @@ -441,13 +441,6 @@ void ShaderResourceLayoutD3D11::ConstBuffBindInfo::BindResource(IDeviceObject* p -bool ShaderResourceLayoutD3D11::ConstBuffBindInfo::IsBound(Uint32 ArrayIndex)const
-{
- VERIFY_EXPR(ArrayIndex < m_Attribs.BindCount);
- return m_ParentResLayout.m_ResourceCache.IsCBBound(m_Attribs.BindPoint + ArrayIndex);
-}
-
-
#ifdef DEVELOPMENT
template<typename TResourceViewType, ///< Type of the view (ITextureViewD3D11 or IBufferViewD3D11)
@@ -665,38 +658,6 @@ void ShaderResourceLayoutD3D11::BuffUAVBindInfo::BindResource(IDeviceObject* pVi }
-bool ShaderResourceLayoutD3D11::TexSRVBindInfo::IsBound(Uint32 ArrayIndex)const
-{
- VERIFY_EXPR(ArrayIndex < m_Attribs.BindCount);
- return m_ParentResLayout.m_ResourceCache.IsSRVBound(m_Attribs.BindPoint + ArrayIndex, true);
-}
-
-
-bool ShaderResourceLayoutD3D11::BuffSRVBindInfo::IsBound(Uint32 ArrayIndex)const
-{
- VERIFY_EXPR(ArrayIndex < m_Attribs.BindCount);
- return m_ParentResLayout.m_ResourceCache.IsSRVBound(m_Attribs.BindPoint + ArrayIndex, false);
-}
-
-bool ShaderResourceLayoutD3D11::TexUAVBindInfo::IsBound(Uint32 ArrayIndex)const
-{
- VERIFY_EXPR(ArrayIndex < m_Attribs.BindCount);
- return m_ParentResLayout.m_ResourceCache.IsUAVBound(m_Attribs.BindPoint + ArrayIndex, true);
-}
-
-bool ShaderResourceLayoutD3D11::BuffUAVBindInfo::IsBound(Uint32 ArrayIndex)const
-{
- VERIFY_EXPR(ArrayIndex < m_Attribs.BindCount);
- return m_ParentResLayout.m_ResourceCache.IsUAVBound(m_Attribs.BindPoint + ArrayIndex, false);
-}
-
-bool ShaderResourceLayoutD3D11::SamplerBindInfo::IsBound(Uint32 ArrayIndex)const
-{
- VERIFY_EXPR(ArrayIndex < m_Attribs.BindCount);
- return m_ParentResLayout.m_ResourceCache.IsSamplerBound(m_Attribs.BindPoint + ArrayIndex);
-}
-
-
// Helper template class that facilitates binding CBs, SRVs, and UAVs
class BindResourceHelper
|
