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

Commit

Permalink
Merge pull request #760 from andrewst/returnDirect3D10
Browse files Browse the repository at this point in the history
[Direct3D10] Return Direct3D10
  • Loading branch information
xoofx committed Jun 17, 2016
2 parents 3e2d7f0 + 5b5db25 commit e7fcf95
Show file tree
Hide file tree
Showing 89 changed files with 33,588 additions and 2 deletions.
7 changes: 7 additions & 0 deletions SharpDX-Desktop.sln
Expand Up @@ -88,6 +88,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.Direct3D12", "Sourc
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.Desktop", "Source\SharpDX.Desktop\SharpDX.Desktop.csproj", "{5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.Direct3D10", "Source\SharpDX.Direct3D10\SharpDX.Direct3D10.csproj", "{618AFA87-81A8-4B1C-8876-5457D49F2DEF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -193,6 +195,10 @@ Global
{5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}.Release|Any CPU.Build.0 = Release|Any CPU
{618AFA87-81A8-4B1C-8876-5457D49F2DEF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{618AFA87-81A8-4B1C-8876-5457D49F2DEF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{618AFA87-81A8-4B1C-8876-5457D49F2DEF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{618AFA87-81A8-4B1C-8876-5457D49F2DEF}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -223,5 +229,6 @@ Global
{49E4485F-3A2A-4C35-A159-12ECCFC00396} = {CC8DB471-0644-430D-9D4B-808A2475BEC0}
{E5BB5D1C-6C07-495B-923B-FB80B79C535E} = {CC8DB471-0644-430D-9D4B-808A2475BEC0}
{5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B} = {CC8DB471-0644-430D-9D4B-808A2475BEC0}
{618AFA87-81A8-4B1C-8876-5457D49F2DEF} = {CC8DB471-0644-430D-9D4B-808A2475BEC0}
EndGlobalSection
EndGlobal
11 changes: 9 additions & 2 deletions Source/Mapping.Direct3D1x.xml
Expand Up @@ -51,6 +51,14 @@
<context>d3d10misc</context>
<context>d3d10sdklayers</context>
<context>d3d10shader</context>
<context>d3d10effect</context>

<context>d3dx10</context>
<context>d3dx10core</context>
<context>d3dx10tex</context>
<context>d3dx10mesh</context>
<context>d3dx10async</context>


<context>d3d11</context>
<context>d3d11_1</context>
Expand Down Expand Up @@ -287,8 +295,7 @@
// *****************************************************************
-->
<map interface="ID3D1[0-3](.+)" name-tmp="$1" />
<map interface="ID3DX10(.+)" name-tmp="$1" />
<map interface="ID3DX11(.+)" name-tmp="$1" />
<map interface="ID3DX1[0-3](.+)" name-tmp="$1" />

<map method=".*::GetPrivateData" check="false"/>

Expand Down
1 change: 1 addition & 0 deletions Source/Mapping.xml
Expand Up @@ -64,6 +64,7 @@
<file>SharpDX.DXGI\Mapping.xml</file>
<file>SharpDX.D3DCompiler\Mapping.xml</file>
<file>Mapping.Direct3D1x.xml</file>
<!--<file>SharpDX.Direct3D10\Mapping.xml</file>-->
<file>SharpDX.Direct3D11\Mapping.xml</file>
<file>SharpDX.Direct3D12\Mapping.xml</file>
<file>SharpDX.Direct3D11.Effects\Mapping.xml</file>
Expand Down
32 changes: 32 additions & 0 deletions Source/SharpDX.Direct3D10/AssemblyDoc.cs
@@ -0,0 +1,32 @@
// Copyright (c) 2010-2014 SharpDX - Alexandre Mutel
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
namespace SharpDX.Direct3D10
{
/// <summary>
/// The <see cref="A:SharpDX.Direct3D10"/> assembly provides managed Direct3D10 API.
/// </summary>
/// <msdn-id>bb205066</msdn-id>
/// <unmanaged>Direct3D10</unmanaged>
/// <unmanaged-short>Direct3D10</unmanaged-short>
[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
class AssemblyDoc
{
}
}
78 changes: 78 additions & 0 deletions Source/SharpDX.Direct3D10/Asynchronous.cs
@@ -0,0 +1,78 @@
// Copyright (c) 2010-2014 SharpDX - Alexandre Mutel
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;

namespace SharpDX.Direct3D10
{
public partial class Asynchronous
{

/// <summary>
/// Get data from the GPU asynchronously.
/// </summary>
/// <remarks>
/// 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"/>.
/// </remarks>
/// <returns>If this function succeeds, returns a <see cref="SharpDX.DataStream"/> containing the asynchronous data sent from the GPU. </returns>
/// <unmanaged>HRESULT ID3D10Asynchronous::GetData([Out, Buffer, Optional] void* pData,[In] int DataSize,[In] int GetDataFlags)</unmanaged>
public DataStream GetData()
{
return GetData(AsynchronousFlags.None);
}

/// <summary>
/// Get data from the GPU asynchronously.
/// </summary>
/// <remarks>
/// 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"/>.
/// </remarks>
/// <param name="flags">Optional flags. Can be 0 or any combination of the flags enumerated by <see cref="SharpDX.Direct3D10.AsynchronousFlags"/>. </param>
/// <returns>If this function succeeds, returns a <see cref="SharpDX.DataStream"/> containing the asynchronous data sent from the GPU. </returns>
/// <unmanaged>HRESULT ID3D10Asynchronous::GetData([Out, Buffer, Optional] void* pData,[In] int DataSize,[In] int GetDataFlags)</unmanaged>
public DataStream GetData(AsynchronousFlags flags)
{
int dataSize = GetDataSize();
DataStream dataStream = new DataStream(dataSize, true, true);
try
{
GetData(dataStream.DataPointer, dataSize, (int)flags);
}
catch (Exception)
{
dataStream.Dispose();
throw;
}
return dataStream;
}

/// <summary>
/// Gets a value indicating whether or not data is available for consumption.
/// </summary>
public bool IsDataAvailable
{
get
{
// http://msdn.microsoft.com/en-us/library/windows/desktop/bb173503%28v=vs.85%29.aspx
// any result other than S_OK will indicate that there is no data available.
return GetData(IntPtr.Zero, 0, 0) == Result.Ok;
}
}
}
}
50 changes: 50 additions & 0 deletions Source/SharpDX.Direct3D10/BlendState.cs
@@ -0,0 +1,50 @@
// Copyright (c) 2010-2014 SharpDX - Alexandre Mutel
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;

namespace SharpDX.Direct3D10
{
public partial class BlendState
{
/// <summary>
/// Constructs a new <see cref = "T:SharpDX.Direct3D10.BlendState" /> based on the specified description.
/// </summary>
/// <param name = "device">The device with which to associate the state object.</param>
/// <param name = "description">The state description.</param>
/// <returns>The newly created object.</returns>
public BlendState(Device device, BlendStateDescription description)
: base(IntPtr.Zero)
{
device.CreateBlendState(ref description, this);
}

/// <summary>
/// Constructs a new <see cref = "T:SharpDX.Direct3D10.BlendState" /> based on the specified description.
/// </summary>
/// <param name = "device">The device with which to associate the state object.</param>
/// <param name = "description">The state description.</param>
/// <returns>The newly created object.</returns>
public BlendState(Device device, ref BlendStateDescription description)
: base(IntPtr.Zero)
{
device.CreateBlendState(ref description, this);
}
}
}
50 changes: 50 additions & 0 deletions Source/SharpDX.Direct3D10/BlendState1.cs
@@ -0,0 +1,50 @@
// Copyright (c) 2010-2014 SharpDX - Alexandre Mutel
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;

namespace SharpDX.Direct3D10
{
public partial class BlendState1
{
/// <summary>
/// Constructs a new <see cref = "T:SharpDX.Direct3D10.BlendState1" /> based on the specified description.
/// </summary>
/// <param name = "device">The device with which to associate the state object.</param>
/// <param name = "description">The state description.</param>
/// <returns>The newly created object.</returns>
public BlendState1(Device1 device, BlendStateDescription1 description)
: base(IntPtr.Zero)
{
device.CreateBlendState1(ref description, this);
}

/// <summary>
/// Constructs a new <see cref = "T:SharpDX.Direct3D10.BlendState1" /> based on the specified description.
/// </summary>
/// <param name = "device">The device with which to associate the state object.</param>
/// <param name = "description">The state description.</param>
/// <returns>The newly created object.</returns>
public BlendState1(Device1 device, ref BlendStateDescription1 description)
: base(IntPtr.Zero)
{
device.CreateBlendState1(ref description, this);
}
}
}

0 comments on commit e7fcf95

Please sign in to comment.