2 * Copyright (c) 2007-2010 SlimDX Group
\r
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
\r
5 * of this software and associated documentation files (the "Software"), to deal
\r
6 * in the Software without restriction, including without limitation the rights
\r
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
\r
8 * copies of the Software, and to permit persons to whom the Software is
\r
9 * furnished to do so, subject to the following conditions:
\r
11 * The above copyright notice and this permission notice shall be included in
\r
12 * all copies or substantial portions of the Software.
\r
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
\r
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
\r
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
\r
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
\r
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
\r
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
\r
24 #include "ShaderVariableDescriptionDC.h"
\r
26 using namespace System;
\r
30 namespace D3DCompiler
\r
32 ShaderVariableDescription::ShaderVariableDescription( const D3D11_SHADER_VARIABLE_DESC& description )
\r
34 m_Name = gcnew System::String( description.Name );
\r
35 m_StartOffset = static_cast<int>( description.StartOffset );
\r
36 m_Size = static_cast<int>( description.Size );
\r
37 m_Flags = static_cast<ShaderVariableFlags>( description.uFlags );
\r
38 defaultValue = IntPtr( description.DefaultValue );
\r
41 System::String^ ShaderVariableDescription::Name::get()
\r
46 int ShaderVariableDescription::StartOffset::get()
\r
48 return m_StartOffset;
\r
51 int ShaderVariableDescription::Size::get()
\r
56 IntPtr ShaderVariableDescription::DefaultValue::get()
\r
58 return defaultValue;
\r
61 ShaderVariableFlags ShaderVariableDescription::Flags::get()
\r
66 bool ShaderVariableDescription::operator == ( ShaderVariableDescription left, ShaderVariableDescription right )
\r
68 return ShaderVariableDescription::Equals( left, right );
\r
71 bool ShaderVariableDescription::operator != ( ShaderVariableDescription left, ShaderVariableDescription right )
\r
73 return !ShaderVariableDescription::Equals( left, right );
\r
76 int ShaderVariableDescription::GetHashCode()
\r
78 return m_Name->GetHashCode() + m_StartOffset.GetHashCode() + m_Size.GetHashCode() + m_Flags.GetHashCode();
\r
81 bool ShaderVariableDescription::Equals( Object^ value )
\r
83 if( value == nullptr )
\r
86 if( value->GetType() != GetType() )
\r
89 return Equals( safe_cast<ShaderVariableDescription>( value ) );
\r
92 bool ShaderVariableDescription::Equals( ShaderVariableDescription value )
\r
94 return ( m_Name == value.m_Name && m_StartOffset == value.m_StartOffset && m_Size == value.m_Size && m_Flags == value.m_Flags );
\r
97 bool ShaderVariableDescription::Equals( ShaderVariableDescription% value1, ShaderVariableDescription% value2 )
\r
99 return ( value1.m_Name == value2.m_Name && value1.m_StartOffset == value2.m_StartOffset && value1.m_Size == value2.m_Size && value1.m_Flags == value2.m_Flags );
\r