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 "EffectPassDescription.h"
\r
27 #include "../d3dcompiler/ShaderSignatureDC.h"
\r
29 using namespace System;
\r
33 namespace Direct3D10
\r
35 EffectPassDescription::EffectPassDescription( const D3D10_PASS_DESC& native )
\r
37 m_Name = gcnew String( native.Name );
\r
38 m_Annotations = native.Annotations;
\r
39 m_Signature = gcnew D3DCompiler::ShaderSignature( gcnew DataStream( native.pIAInputSignature, native.IAInputSignatureSize, true, false ) );
\r
40 m_StencilRef = native.StencilRef;
\r
41 m_SampleMask = native.SampleMask;
\r
42 m_BlendFactor = Color4( native.BlendFactor[ 3 ], native.BlendFactor[ 0 ], native.BlendFactor[ 1 ], native.BlendFactor[ 2 ] );
\r
45 String^ EffectPassDescription::Name::get()
\r
50 int EffectPassDescription::AnnotationCount::get()
\r
52 return m_Annotations;
\r
55 D3DCompiler::ShaderSignature^ EffectPassDescription::Signature::get()
\r
60 int EffectPassDescription::StencilReference::get()
\r
62 return m_StencilRef;
\r
65 int EffectPassDescription::SampleMask::get()
\r
67 return m_SampleMask;
\r
70 Color4 EffectPassDescription::BlendFactor::get()
\r
72 return m_BlendFactor;
\r
75 bool EffectPassDescription::operator == ( EffectPassDescription left, EffectPassDescription right )
\r
77 return EffectPassDescription::Equals( left, right );
\r
80 bool EffectPassDescription::operator != ( EffectPassDescription left, EffectPassDescription right )
\r
82 return !EffectPassDescription::Equals( left, right );
\r
85 int EffectPassDescription::GetHashCode()
\r
87 return m_Name->GetHashCode() + m_Annotations.GetHashCode() + m_Signature->GetHashCode() + m_StencilRef.GetHashCode() + m_SampleMask.GetHashCode() + m_BlendFactor.GetHashCode();
\r
90 bool EffectPassDescription::Equals( Object^ value )
\r
92 if( value == nullptr )
\r
95 if( value->GetType() != GetType() )
\r
98 return Equals( safe_cast<EffectPassDescription>( value ) );
\r
101 bool EffectPassDescription::Equals( EffectPassDescription value )
\r
103 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
106 bool EffectPassDescription::Equals( EffectPassDescription% value1, EffectPassDescription% value2 )
\r
108 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