Skip to content
This repository was archived by the owner on Mar 30, 2019. It is now read-only.

Commit 07b60f2

Browse files
author
AndrewSt
committed
[Direct3D10] return source from [c6d8e45]
1 parent 3e2d7f0 commit 07b60f2

File tree

82 files changed

+7567
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+7567
-0
lines changed

SharpDX-Desktop.sln

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.Direct3D12", "Sourc
8888
EndProject
8989
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.Desktop", "Source\SharpDX.Desktop\SharpDX.Desktop.csproj", "{5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}"
9090
EndProject
91+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.Direct3D10", "Source\SharpDX.Direct3D10\SharpDX.Direct3D10.csproj", "{618AFA87-81A8-4B1C-8876-5457D49F2DEF}"
92+
EndProject
9193
Global
9294
GlobalSection(SolutionConfigurationPlatforms) = preSolution
9395
Debug|Any CPU = Debug|Any CPU
@@ -193,6 +195,10 @@ Global
193195
{5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}.Debug|Any CPU.Build.0 = Debug|Any CPU
194196
{5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}.Release|Any CPU.ActiveCfg = Release|Any CPU
195197
{5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}.Release|Any CPU.Build.0 = Release|Any CPU
198+
{618AFA87-81A8-4B1C-8876-5457D49F2DEF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
199+
{618AFA87-81A8-4B1C-8876-5457D49F2DEF}.Debug|Any CPU.Build.0 = Debug|Any CPU
200+
{618AFA87-81A8-4B1C-8876-5457D49F2DEF}.Release|Any CPU.ActiveCfg = Release|Any CPU
201+
{618AFA87-81A8-4B1C-8876-5457D49F2DEF}.Release|Any CPU.Build.0 = Release|Any CPU
196202
EndGlobalSection
197203
GlobalSection(SolutionProperties) = preSolution
198204
HideSolutionNode = FALSE
@@ -223,5 +229,6 @@ Global
223229
{49E4485F-3A2A-4C35-A159-12ECCFC00396} = {CC8DB471-0644-430D-9D4B-808A2475BEC0}
224230
{E5BB5D1C-6C07-495B-923B-FB80B79C535E} = {CC8DB471-0644-430D-9D4B-808A2475BEC0}
225231
{5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B} = {CC8DB471-0644-430D-9D4B-808A2475BEC0}
232+
{618AFA87-81A8-4B1C-8876-5457D49F2DEF} = {CC8DB471-0644-430D-9D4B-808A2475BEC0}
226233
EndGlobalSection
227234
EndGlobal
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Copyright (c) 2010-2014 SharpDX - Alexandre Mutel
2+
//
3+
// Permission is hereby granted, free of charge, to any person obtaining a copy
4+
// of this software and associated documentation files (the "Software"), to deal
5+
// in the Software without restriction, including without limitation the rights
6+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
// copies of the Software, and to permit persons to whom the Software is
8+
// furnished to do so, subject to the following conditions:
9+
//
10+
// The above copyright notice and this permission notice shall be included in
11+
// all copies or substantial portions of the Software.
12+
//
13+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
// THE SOFTWARE.
20+
namespace SharpDX.Direct3D10
21+
{
22+
/// <summary>
23+
/// The <see cref="A:SharpDX.Direct3D10"/> assembly provides managed Direct3D10 API.
24+
/// </summary>
25+
/// <msdn-id>bb205066</msdn-id>
26+
/// <unmanaged>Direct3D10</unmanaged>
27+
/// <unmanaged-short>Direct3D10</unmanaged-short>
28+
[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
29+
class AssemblyDoc
30+
{
31+
}
32+
}
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
// Copyright (c) 2010-2014 SharpDX - Alexandre Mutel
2+
//
3+
// Permission is hereby granted, free of charge, to any person obtaining a copy
4+
// of this software and associated documentation files (the "Software"), to deal
5+
// in the Software without restriction, including without limitation the rights
6+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
// copies of the Software, and to permit persons to whom the Software is
8+
// furnished to do so, subject to the following conditions:
9+
//
10+
// The above copyright notice and this permission notice shall be included in
11+
// all copies or substantial portions of the Software.
12+
//
13+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
// THE SOFTWARE.
20+
using System;
21+
22+
namespace SharpDX.Direct3D10
23+
{
24+
public partial class Asynchronous
25+
{
26+
27+
/// <summary>
28+
/// Get data from the GPU asynchronously.
29+
/// </summary>
30+
/// <remarks>
31+
/// GetData retrieves the data collected between calls to <see cref="SharpDX.Direct3D10.Asynchronous.Begin"/> and <see cref="SharpDX.Direct3D10.Asynchronous.End"/>. Certain queries only require a call to ID3D10Asynchronous::End in which case the data returned by GetData is accurate up to the last call to ID3D10Asynchronous::End (See <see cref="SharpDX.Direct3D10.Query"/>). If DataSize is 0, GetData is only used to check status where a return value of S_OK indicates that data is available to give to an application, and a return value of S_FALSE indicates data is not yet available. It is invalid to invoke this function on a predicate created with the flag D3D10_QUERY_MISCFLAG_PREDICATEHINT. If the asynchronous interface that calls this function is <see cref="SharpDX.Direct3D10.Query"/>, then the following table applies. Query TypeOutput Data TypeSupports Begin Method EVENTBOOLNO OCCLUSIONUINT64YES TIMESTAMPUINT64NO TIMESTAMP_DISJOINTQUERYDATA_TIMESTAMP_DISJOINTYES PIPELINE_STATISTICSQUERYDATA_PIPELINE_STATISTICSYES OCCLUSION_PREDICATEBOOLYES SO_STATISTICSQUERYDATA_SO_STATISTICSYES SO_OVERFLOW_PREDICATEBOOLYES ? If the asynchronous interface that calls this API is <see cref="SharpDX.Direct3D10.Counter"/>, then the following applies. Counter TypeOutput Data TypeUnits GPU_IDLEFLOAT32fraction of time VERTEX_PROCESSINGFLOAT32fraction of time GEOMETRY_PROCESSINGFLOAT32fraction of time PIXEL_PROCESSINGFLOAT32fraction of time OTHER_GPU_PROCESSINGFLOAT32fraction of time HOST_ADAPTER_BANDWIDTH_UTILIZATIONFLOAT32fraction of theoretical maximum LOCAL_VIDMEM_BANDWIDTH_UTILIZATIONFLOAT32fraction of theoretical maximum VERTEX_THROUGHPUT_UTILIZATIONFLOAT32fraction of theoretical maximum TRISETUP_THROUGHPUT_UTILIZATIONFLOAT32fraction of theoretical maximum FILLRATE_THROUGHPUT_UTILIZATIONFLOAT32fraction of theoretical maximum VERTEXSHADER_MEMORY_LIMITEDFLOAT32fraction of time VERTEXSHADER_COMPUTATION_LIMITEDFLOAT32fraction of time GEOMETRYSHADER_MEMORY_LIMITEDFLOAT32fraction of time GEOMETRYSHADER_COMPUTATION_LIMITEDFLOAT32fraction of time PIXELSHADER_MEMORY_LIMITEDFLOAT32fraction of time PIXELSHADER_COMPUTATION_LIMITEDFLOAT32fraction of time POST_TRANSFORM_CACHE_HIT_RATEFLOAT32fraction TEXTURE_CACHE_HIT_RATEFLOAT32fraction ? The value returned by a GPU_IDLE, VERTEX_PROCESSING, GEOMETRY_PROCESSING, PIXEL_PROCESSING, or OTHER_GPU_PROCESSING counter may be different depending on the number of parallel counters that exist on a video card, and those values can be interpreted with the following equation: ? Equation to interpret the number of parallel counters ? The number of parallel counters that a video card has is available from NumDetectableParallelUnits in <see cref="CounterMetadata"/>, and it can be retrieved by calling <see cref="Device.CheckCounter"/>.
32+
/// </remarks>
33+
/// <returns>If this function succeeds, returns a <see cref="SharpDX.DataStream"/> containing the asynchronous data sent from the GPU. </returns>
34+
/// <unmanaged>HRESULT ID3D10Asynchronous::GetData([Out, Buffer, Optional] void* pData,[In] int DataSize,[In] int GetDataFlags)</unmanaged>
35+
public DataStream GetData()
36+
{
37+
return GetData(AsynchronousFlags.None);
38+
}
39+
40+
/// <summary>
41+
/// Get data from the GPU asynchronously.
42+
/// </summary>
43+
/// <remarks>
44+
/// GetData retrieves the data collected between calls to <see cref="SharpDX.Direct3D10.Asynchronous.Begin"/> and <see cref="SharpDX.Direct3D10.Asynchronous.End"/>. Certain queries only require a call to ID3D10Asynchronous::End in which case the data returned by GetData is accurate up to the last call to ID3D10Asynchronous::End (See <see cref="SharpDX.Direct3D10.Query"/>). If DataSize is 0, GetData is only used to check status where a return value of S_OK indicates that data is available to give to an application, and a return value of S_FALSE indicates data is not yet available. It is invalid to invoke this function on a predicate created with the flag D3D10_QUERY_MISCFLAG_PREDICATEHINT. If the asynchronous interface that calls this function is <see cref="SharpDX.Direct3D10.Query"/>, then the following table applies. Query TypeOutput Data TypeSupports Begin Method EVENTBOOLNO OCCLUSIONUINT64YES TIMESTAMPUINT64NO TIMESTAMP_DISJOINTQUERYDATA_TIMESTAMP_DISJOINTYES PIPELINE_STATISTICSQUERYDATA_PIPELINE_STATISTICSYES OCCLUSION_PREDICATEBOOLYES SO_STATISTICSQUERYDATA_SO_STATISTICSYES SO_OVERFLOW_PREDICATEBOOLYES ? If the asynchronous interface that calls this API is <see cref="SharpDX.Direct3D10.Counter"/>, then the following applies. Counter TypeOutput Data TypeUnits GPU_IDLEFLOAT32fraction of time VERTEX_PROCESSINGFLOAT32fraction of time GEOMETRY_PROCESSINGFLOAT32fraction of time PIXEL_PROCESSINGFLOAT32fraction of time OTHER_GPU_PROCESSINGFLOAT32fraction of time HOST_ADAPTER_BANDWIDTH_UTILIZATIONFLOAT32fraction of theoretical maximum LOCAL_VIDMEM_BANDWIDTH_UTILIZATIONFLOAT32fraction of theoretical maximum VERTEX_THROUGHPUT_UTILIZATIONFLOAT32fraction of theoretical maximum TRISETUP_THROUGHPUT_UTILIZATIONFLOAT32fraction of theoretical maximum FILLRATE_THROUGHPUT_UTILIZATIONFLOAT32fraction of theoretical maximum VERTEXSHADER_MEMORY_LIMITEDFLOAT32fraction of time VERTEXSHADER_COMPUTATION_LIMITEDFLOAT32fraction of time GEOMETRYSHADER_MEMORY_LIMITEDFLOAT32fraction of time GEOMETRYSHADER_COMPUTATION_LIMITEDFLOAT32fraction of time PIXELSHADER_MEMORY_LIMITEDFLOAT32fraction of time PIXELSHADER_COMPUTATION_LIMITEDFLOAT32fraction of time POST_TRANSFORM_CACHE_HIT_RATEFLOAT32fraction TEXTURE_CACHE_HIT_RATEFLOAT32fraction ? The value returned by a GPU_IDLE, VERTEX_PROCESSING, GEOMETRY_PROCESSING, PIXEL_PROCESSING, or OTHER_GPU_PROCESSING counter may be different depending on the number of parallel counters that exist on a video card, and those values can be interpreted with the following equation: ? Equation to interpret the number of parallel counters ? The number of parallel counters that a video card has is available from NumDetectableParallelUnits in <see cref="CounterMetadata"/>, and it can be retrieved by calling <see cref="Device.CheckCounter"/>.
45+
/// </remarks>
46+
/// <param name="flags">Optional flags. Can be 0 or any combination of the flags enumerated by <see cref="SharpDX.Direct3D10.AsynchronousFlags"/>. </param>
47+
/// <returns>If this function succeeds, returns a <see cref="SharpDX.DataStream"/> containing the asynchronous data sent from the GPU. </returns>
48+
/// <unmanaged>HRESULT ID3D10Asynchronous::GetData([Out, Buffer, Optional] void* pData,[In] int DataSize,[In] int GetDataFlags)</unmanaged>
49+
public DataStream GetData(AsynchronousFlags flags)
50+
{
51+
int dataSize = GetDataSize();
52+
DataStream dataStream = new DataStream(dataSize, true, true);
53+
try
54+
{
55+
GetData(dataStream.DataPointer, dataSize, (int)flags);
56+
}
57+
catch (Exception)
58+
{
59+
dataStream.Dispose();
60+
throw;
61+
}
62+
return dataStream;
63+
}
64+
65+
/// <summary>
66+
/// Gets a value indicating whether or not data is available for consumption.
67+
/// </summary>
68+
public bool IsDataAvailable
69+
{
70+
get
71+
{
72+
// http://msdn.microsoft.com/en-us/library/windows/desktop/bb173503%28v=vs.85%29.aspx
73+
// any result other than S_OK will indicate that there is no data available.
74+
return GetData(IntPtr.Zero, 0, 0) == Result.Ok;
75+
}
76+
}
77+
}
78+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// Copyright (c) 2010-2014 SharpDX - Alexandre Mutel
2+
//
3+
// Permission is hereby granted, free of charge, to any person obtaining a copy
4+
// of this software and associated documentation files (the "Software"), to deal
5+
// in the Software without restriction, including without limitation the rights
6+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
// copies of the Software, and to permit persons to whom the Software is
8+
// furnished to do so, subject to the following conditions:
9+
//
10+
// The above copyright notice and this permission notice shall be included in
11+
// all copies or substantial portions of the Software.
12+
//
13+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
// THE SOFTWARE.
20+
using System;
21+
22+
namespace SharpDX.Direct3D10
23+
{
24+
public partial class BlendState
25+
{
26+
/// <summary>
27+
/// Constructs a new <see cref = "T:SharpDX.Direct3D10.BlendState" /> based on the specified description.
28+
/// </summary>
29+
/// <param name = "device">The device with which to associate the state object.</param>
30+
/// <param name = "description">The state description.</param>
31+
/// <returns>The newly created object.</returns>
32+
public BlendState(Device device, BlendStateDescription description)
33+
: base(IntPtr.Zero)
34+
{
35+
device.CreateBlendState(ref description, this);
36+
}
37+
38+
/// <summary>
39+
/// Constructs a new <see cref = "T:SharpDX.Direct3D10.BlendState" /> based on the specified description.
40+
/// </summary>
41+
/// <param name = "device">The device with which to associate the state object.</param>
42+
/// <param name = "description">The state description.</param>
43+
/// <returns>The newly created object.</returns>
44+
public BlendState(Device device, ref BlendStateDescription description)
45+
: base(IntPtr.Zero)
46+
{
47+
device.CreateBlendState(ref description, this);
48+
}
49+
}
50+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// Copyright (c) 2010-2014 SharpDX - Alexandre Mutel
2+
//
3+
// Permission is hereby granted, free of charge, to any person obtaining a copy
4+
// of this software and associated documentation files (the "Software"), to deal
5+
// in the Software without restriction, including without limitation the rights
6+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
// copies of the Software, and to permit persons to whom the Software is
8+
// furnished to do so, subject to the following conditions:
9+
//
10+
// The above copyright notice and this permission notice shall be included in
11+
// all copies or substantial portions of the Software.
12+
//
13+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
// THE SOFTWARE.
20+
using System;
21+
22+
namespace SharpDX.Direct3D10
23+
{
24+
public partial class BlendState1
25+
{
26+
/// <summary>
27+
/// Constructs a new <see cref = "T:SharpDX.Direct3D10.BlendState1" /> based on the specified description.
28+
/// </summary>
29+
/// <param name = "device">The device with which to associate the state object.</param>
30+
/// <param name = "description">The state description.</param>
31+
/// <returns>The newly created object.</returns>
32+
public BlendState1(Device1 device, BlendStateDescription1 description)
33+
: base(IntPtr.Zero)
34+
{
35+
device.CreateBlendState1(ref description, this);
36+
}
37+
38+
/// <summary>
39+
/// Constructs a new <see cref = "T:SharpDX.Direct3D10.BlendState1" /> based on the specified description.
40+
/// </summary>
41+
/// <param name = "device">The device with which to associate the state object.</param>
42+
/// <param name = "description">The state description.</param>
43+
/// <returns>The newly created object.</returns>
44+
public BlendState1(Device1 device, ref BlendStateDescription1 description)
45+
: base(IntPtr.Zero)
46+
{
47+
device.CreateBlendState1(ref description, this);
48+
}
49+
}
50+
}

0 commit comments

Comments
 (0)