From f57fc688a659087f5e85d8533f61c4a1fd914810 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Sat, 2 Mar 2019 22:43:26 -0800 Subject: Reworked ShaderD3D11Impl to comply with the updated API --- .../include/ShaderVariableD3DBase.h | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'Graphics/GraphicsEngineD3DBase') diff --git a/Graphics/GraphicsEngineD3DBase/include/ShaderVariableD3DBase.h b/Graphics/GraphicsEngineD3DBase/include/ShaderVariableD3DBase.h index 48748a6c..ae2d2728 100644 --- a/Graphics/GraphicsEngineD3DBase/include/ShaderVariableD3DBase.h +++ b/Graphics/GraphicsEngineD3DBase/include/ShaderVariableD3DBase.h @@ -33,9 +33,12 @@ namespace Diligent template struct ShaderVariableD3DBase : public IShaderResourceVariable { - ShaderVariableD3DBase(TShaderResourceLayout& ParentResLayout, const D3DShaderResourceAttribs& ResourcesAttribs) : - m_ParentResLayout(ParentResLayout), - Attribs(ResourcesAttribs) + ShaderVariableD3DBase(TShaderResourceLayout& ParentResLayout, + const D3DShaderResourceAttribs& Attribs, + SHADER_RESOURCE_VARIABLE_TYPE VariableType) : + m_ParentResLayout (ParentResLayout), + m_Attribs (Attribs), + m_VariableType (VariableType) { } @@ -60,7 +63,7 @@ namespace Diligent return; *ppInterface = nullptr; - if( IID == IID_ShaderVariable || IID == IID_Unknown ) + if( IID == IID_ShaderResourceVariable || IID == IID_Unknown ) { *ppInterface = this; (*ppInterface)->AddRef(); @@ -69,17 +72,17 @@ namespace Diligent virtual SHADER_RESOURCE_VARIABLE_TYPE GetType()const override final { - return Attribs.GetVariableType(); + return m_VariableType; } virtual Uint32 GetArraySize()const override final { - return Attribs.BindCount; + return m_Attribs.BindCount; } virtual const Char* GetName()const override final { - return Attribs.Name; + return m_Attribs.Name; } virtual Uint32 GetIndex()const override final @@ -87,9 +90,10 @@ namespace Diligent return m_ParentResLayout.GetVariableIndex(*this); } - const D3DShaderResourceAttribs& Attribs; + const D3DShaderResourceAttribs& m_Attribs; protected: - TShaderResourceLayout& m_ParentResLayout; + TShaderResourceLayout& m_ParentResLayout; + const SHADER_RESOURCE_VARIABLE_TYPE m_VariableType; }; } -- cgit v1.2.3