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 "../DataStream.h"
\r
26 #include "EffectPassDescription11.h"
\r
28 using namespace System;
\r
32 namespace Direct3D11
\r
34 EffectPassDescription::EffectPassDescription( const D3DX11_PASS_DESC& native )
\r
36 m_Name = gcnew String( native.Name );
\r
37 m_Annotations = native.Annotations;
\r
38 m_Signature = gcnew SlimDX::D3DCompiler::ShaderSignature( gcnew DataStream( native.pIAInputSignature, native.IAInputSignatureSize, true, false, false ) );
\r
39 m_StencilRef = native.StencilRef;
\r
40 m_SampleMask = native.SampleMask;
\r
41 m_BlendFactor = Color4( native.BlendFactor[ 3 ], native.BlendFactor[ 0 ], native.BlendFactor[ 1 ], native.BlendFactor[ 2 ] );
\r
44 String^ EffectPassDescription::Name::get()
\r
49 int EffectPassDescription::AnnotationCount::get()
\r
51 return m_Annotations;
\r
54 SlimDX::D3DCompiler::ShaderSignature^ EffectPassDescription::Signature::get()
\r
59 int EffectPassDescription::StencilReference::get()
\r
61 return m_StencilRef;
\r
64 int EffectPassDescription::SampleMask::get()
\r
66 return m_SampleMask;
\r
69 Color4 EffectPassDescription::BlendFactor::get()
\r
71 return m_BlendFactor;
\r
74 bool EffectPassDescription::operator == ( EffectPassDescription left, EffectPassDescription right )
\r
76 return EffectPassDescription::Equals( left, right );
\r
79 bool EffectPassDescription::operator != ( EffectPassDescription left, EffectPassDescription right )
\r
81 return !EffectPassDescription::Equals( left, right );
\r
84 int EffectPassDescription::GetHashCode()
\r
86 return m_Name->GetHashCode() + m_Annotations.GetHashCode() + m_Signature->GetHashCode() + m_StencilRef.GetHashCode() + m_SampleMask.GetHashCode() + m_BlendFactor.GetHashCode();
\r
89 bool EffectPassDescription::Equals( Object^ value )
\r
91 if( value == nullptr )
\r
94 if( value->GetType() != GetType() )
\r
97 return Equals( safe_cast<EffectPassDescription>( value ) );
\r
100 bool EffectPassDescription::Equals( EffectPassDescription value )
\r
102 return ( m_Name == value.m_Name && m_Annotations == value.m_Annotations && m_Signature == value.m_Signature && m_StencilRef == value.m_StencilRef && m_SampleMask == value.m_SampleMask && m_BlendFactor == value.m_BlendFactor );
\r
105 bool EffectPassDescription::Equals( EffectPassDescription% value1, EffectPassDescription% value2 )
\r
107 return ( value1.m_Name == value2.m_Name && value1.m_Annotations == value2.m_Annotations && value1.m_Signature == value2.m_Signature && value1.m_StencilRef == value2.m_StencilRef && value1.m_SampleMask == value2.m_SampleMask && value1.m_BlendFactor == value2.m_BlendFactor );
\r