diff options
| author | assiduous <assiduous@diligentgraphics.com> | 2021-02-25 03:34:36 +0000 |
|---|---|---|
| committer | assiduous <assiduous@diligentgraphics.com> | 2021-03-19 00:38:11 +0000 |
| commit | fedbe3fdf4637ba1cb06d5aa121a8ccc23b78d97 (patch) | |
| tree | 19476a9541752880be6981c900c66f9112a2470a /Graphics/GraphicsEngineD3DBase | |
| parent | Reworked ShaderVariableVkImpl and ShaderVariableD3D12Impl: removed some dupli... (diff) | |
| download | DiligentCore-fedbe3fdf4637ba1cb06d5aa121a8ccc23b78d97.tar.gz DiligentCore-fedbe3fdf4637ba1cb06d5aa121a8ccc23b78d97.zip | |
PipelineResourceSignatureD3D12Impl: added bound buffer view mode validation
Diffstat (limited to 'Graphics/GraphicsEngineD3DBase')
| -rw-r--r-- | Graphics/GraphicsEngineD3DBase/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | Graphics/GraphicsEngineD3DBase/include/ShaderVariableD3D.hpp (renamed from Graphics/GraphicsEngineD3DBase/include/ShaderVariableD3DBase.hpp) | 66 |
2 files changed, 7 insertions, 61 deletions
diff --git a/Graphics/GraphicsEngineD3DBase/CMakeLists.txt b/Graphics/GraphicsEngineD3DBase/CMakeLists.txt index 36e0c01a..c438debb 100644 --- a/Graphics/GraphicsEngineD3DBase/CMakeLists.txt +++ b/Graphics/GraphicsEngineD3DBase/CMakeLists.txt @@ -14,7 +14,7 @@ set(INCLUDE include/RenderDeviceD3DBase.hpp include/ShaderD3DBase.hpp include/ShaderResources.hpp - include/ShaderVariableD3DBase.hpp + include/ShaderVariableD3D.hpp include/SwapChainD3DBase.hpp ) diff --git a/Graphics/GraphicsEngineD3DBase/include/ShaderVariableD3DBase.hpp b/Graphics/GraphicsEngineD3DBase/include/ShaderVariableD3D.hpp index 1734588b..289b9f65 100644 --- a/Graphics/GraphicsEngineD3DBase/include/ShaderVariableD3DBase.hpp +++ b/Graphics/GraphicsEngineD3DBase/include/ShaderVariableD3D.hpp @@ -27,79 +27,25 @@ #pragma once -#include "ShaderResourceVariableBase.hpp" -#include "ShaderResourceVariableD3D.h" /// \file -/// Declaration of Diligent::ShaderVariableD3DBase class namespace Diligent { -struct D3DVariableIDComparator -{ - bool operator()(const INTERFACE_ID& IID) const - { - return IID == IID_ShaderResourceVariableD3D || IID == IID_ShaderResourceVariable || IID == IID_Unknown; - } -}; - -template <typename TShaderResourceLayout> -struct ShaderVariableD3DBase : public ShaderVariableBase<TShaderResourceLayout, IShaderResourceVariableD3D, D3DVariableIDComparator> -{ - using TBase = ShaderVariableBase<TShaderResourceLayout, IShaderResourceVariableD3D, D3DVariableIDComparator>; - - ShaderVariableD3DBase(TShaderResourceLayout& ParentResLayout, - const D3DShaderResourceAttribs& Attribs, - SHADER_RESOURCE_VARIABLE_TYPE VariableType) : - // clang-format off - TBase {ParentResLayout}, - m_Attribs {Attribs }, - m_VariableType {VariableType } - // clang-format on - { - } - - virtual SHADER_RESOURCE_VARIABLE_TYPE DILIGENT_CALL_TYPE GetType() const override final - { - return m_VariableType; - } - - virtual void DILIGENT_CALL_TYPE GetResourceDesc(ShaderResourceDesc& ResourceDesc) const override final - { - ResourceDesc = GetHLSLResourceDesc(); - } - - virtual HLSLShaderResourceDesc DILIGENT_CALL_TYPE GetHLSLResourceDesc() const override final - { - return m_Attribs.GetHLSLResourceDesc(); - } - - virtual Uint32 DILIGENT_CALL_TYPE GetIndex() const override final - { - return m_ParentResLayout.GetVariableIndex(*this); - } - - const D3DShaderResourceAttribs& m_Attribs; - -protected: - const SHADER_RESOURCE_VARIABLE_TYPE m_VariableType; -}; - - template <typename BufferViewImplType> -bool VerifyBufferViewModeD3D(BufferViewImplType* pViewD3D11, const D3DShaderResourceAttribs& Attribs, const char* ShaderName) +bool VerifyBufferViewModeD3D(BufferViewImplType* pViewD3D, const D3DShaderResourceAttribs& Attribs, const char* ShaderName) { - if (pViewD3D11 == nullptr) + if (pViewD3D == nullptr) return true; - const auto& ViewDesc = pViewD3D11->GetDesc(); - const auto& BuffDesc = pViewD3D11->GetBuffer()->GetDesc(); + const auto& ViewDesc = pViewD3D->GetDesc(); + const auto& BuffDesc = pViewD3D->GetBuffer()->GetDesc(); auto LogBufferBindingError = [&](const char* Msg) // { - LOG_ERROR_MESSAGE("Error binding buffer view '", ViewDesc.Name, "' of buffer '", BuffDesc.Name, - "' to shader variable '", Attribs.Name, "' in shader '", ShaderName, "': ", Msg); + LOG_ERROR_MESSAGE("Buffer view '", ViewDesc.Name, "' of buffer '", BuffDesc.Name, + "' bound to shader variable '", Attribs.Name, "' in shader '", ShaderName, "' is invalid: ", Msg); }; switch (Attribs.GetInputType()) |
