3 * Copyright (c) 2007-2010 SlimDX Group
\r
5 * Permission is hereby granted, free of charge, to any person obtaining a copy
\r
6 * of this software and associated documentation files (the "Software"), to deal
\r
7 * in the Software without restriction, including without limitation the rights
\r
8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
\r
9 * copies of the Software, and to permit persons to whom the Software is
\r
10 * furnished to do so, subject to the following conditions:
\r
12 * The above copyright notice and this permission notice shall be included in
\r
13 * all copies or substantial portions of the Software.
\r
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
\r
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
\r
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
\r
18 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
\r
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
\r
20 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
\r
26 #include "PipelineStatistics11.h"
\r
30 namespace Direct3D11
\r
32 PipelineStatistics::PipelineStatistics( const D3D11_QUERY_DATA_PIPELINE_STATISTICS& native )
\r
34 InputAssemblerVertices = static_cast<long>( native.IAVertices );
\r
35 InputAssemblerPrimitives = static_cast<long>( native.IAPrimitives );
\r
36 VertexShaderInvocations = static_cast<long>( native.VSInvocations );
\r
37 GeometryShaderInvocations = static_cast<long>( native.GSInvocations );
\r
38 GeometryShaderPrimitives = static_cast<long>( native.GSPrimitives );
\r
39 RasterizedPrimitives = static_cast<long>( native.CInvocations );
\r
40 RenderedPrimitives = static_cast<long>( native.CPrimitives );
\r
41 PixelShaderInvocations = static_cast<long>( native.PSInvocations );
\r
42 HullShaderInvocations = static_cast<long>( native.HSInvocations );
\r
43 DomainShaderInvocations = static_cast<long>( native.DSInvocations );
\r
44 ComputeShaderInvocations = static_cast<long>( native.CSInvocations );
\r
47 D3D11_QUERY_DATA_PIPELINE_STATISTICS PipelineStatistics::CreateNativeVersion()
\r
49 D3D11_QUERY_DATA_PIPELINE_STATISTICS native;
\r
51 native.IAVertices = InputAssemblerVertices;
\r
52 native.IAPrimitives = InputAssemblerPrimitives;
\r
53 native.VSInvocations = VertexShaderInvocations;
\r
54 native.GSInvocations = GeometryShaderInvocations;
\r
55 native.GSPrimitives = GeometryShaderPrimitives;
\r
56 native.CInvocations = RasterizedPrimitives;
\r
57 native.CPrimitives = RenderedPrimitives;
\r
58 native.PSInvocations = PixelShaderInvocations;
\r
59 native.HSInvocations = HullShaderInvocations;
\r
60 native.DSInvocations = DomainShaderInvocations;
\r
61 native.CSInvocations = ComputeShaderInvocations;
\r
66 bool PipelineStatistics::operator == ( PipelineStatistics left, PipelineStatistics right )
\r
68 return PipelineStatistics::Equals( left, right );
\r
71 bool PipelineStatistics::operator != ( PipelineStatistics left, PipelineStatistics right )
\r
73 return !PipelineStatistics::Equals( left, right );
\r
76 int PipelineStatistics::GetHashCode()
\r
78 return InputAssemblerVertices.GetHashCode() + InputAssemblerPrimitives.GetHashCode() + VertexShaderInvocations.GetHashCode()
\r
79 + GeometryShaderInvocations.GetHashCode() + GeometryShaderPrimitives.GetHashCode() + RasterizedPrimitives.GetHashCode() +
\r
80 RenderedPrimitives.GetHashCode() + PixelShaderInvocations.GetHashCode() + DomainShaderInvocations.GetHashCode() +
\r
81 HullShaderInvocations.GetHashCode() + ComputeShaderInvocations.GetHashCode();
\r
84 bool PipelineStatistics::Equals( Object^ value )
\r
86 if( value == nullptr )
\r
89 if( value->GetType() != GetType() )
\r
92 return Equals( safe_cast<PipelineStatistics>( value ) );
\r
95 bool PipelineStatistics::Equals( PipelineStatistics value )
\r
97 return ( InputAssemblerVertices == value.InputAssemblerVertices && InputAssemblerPrimitives == value.InputAssemblerPrimitives && VertexShaderInvocations == value.VertexShaderInvocations
\r
98 && GeometryShaderInvocations == value.GeometryShaderInvocations && GeometryShaderPrimitives == value.GeometryShaderPrimitives &&
\r
99 RasterizedPrimitives == value.RasterizedPrimitives && RenderedPrimitives == value.RenderedPrimitives &&
\r
100 PixelShaderInvocations == value.PixelShaderInvocations && DomainShaderInvocations == value.DomainShaderInvocations &&
\r
101 HullShaderInvocations == value.HullShaderInvocations && ComputeShaderInvocations == value.ComputeShaderInvocations );
\r
104 bool PipelineStatistics::Equals( PipelineStatistics% value1, PipelineStatistics% value2 )
\r
106 return ( value1.InputAssemblerVertices == value2.InputAssemblerVertices && value1.InputAssemblerPrimitives == value2.InputAssemblerPrimitives && value1.VertexShaderInvocations == value2.VertexShaderInvocations
\r
107 && value1.GeometryShaderInvocations == value2.GeometryShaderInvocations && value1.GeometryShaderPrimitives == value2.GeometryShaderPrimitives &&
\r
108 value1.RasterizedPrimitives == value2.RasterizedPrimitives && value1.RenderedPrimitives == value2.RenderedPrimitives &&
\r
109 value1.PixelShaderInvocations == value2.PixelShaderInvocations && value1.DomainShaderInvocations == value2.DomainShaderInvocations &&
\r
110 value1.HullShaderInvocations == value2.HullShaderInvocations && value1.ComputeShaderInvocations == value2.ComputeShaderInvocations );
\r