Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Mar 30, 2019. It is now read-only.
/SharpDXPublic archive

Commit4a066d7

Browse files
author
AndrewSt
committed
[Direct3D11] Improve support Direct3D 11.3
1 parent7f61b6b commit4a066d7

File tree

8 files changed

+385
-0
lines changed

8 files changed

+385
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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+
usingSystem;
21+
22+
namespaceSharpDX.Direct3D11
23+
{
24+
publicpartialclassDeviceContext3
25+
{
26+
/// <summary>
27+
/// Initializes a new deferred context instance of <see cref="SharpDX.Direct3D11.DeviceContext3"/> class.
28+
/// </summary>
29+
/// <param name="device"></param>
30+
publicDeviceContext3(Device3device)
31+
:base(IntPtr.Zero)
32+
{
33+
device.CreateDeferredContext3(0,this);
34+
}
35+
}
36+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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+
usingSystem;
21+
22+
namespaceSharpDX.Direct3D11
23+
{
24+
publicpartialclassQuery1
25+
{
26+
/// <summary>
27+
/// Constructs a new <see cref = "T:SharpDX.Direct3D11.Query1" /> 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 query description.</param>
31+
/// <returns>The newly created object.</returns>
32+
publicQuery1(Device3device,QueryDescription1description)
33+
:base(IntPtr.Zero)
34+
{
35+
device.CreateQuery1(description,this);
36+
}
37+
}
38+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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+
usingSystem;
21+
22+
namespaceSharpDX.Direct3D11
23+
{
24+
publicpartialclassRenderTargetView1
25+
{
26+
/// <summary>
27+
/// Creates a <see cref = "T:SharpDX.Direct3D11.RenderTargetView1" /> for accessing resource data.
28+
/// </summary>
29+
/// <param name = "device">The device to use when creating this <see cref = "T:SharpDX.Direct3D11.RenderTargetView1" />.</param>
30+
/// <param name = "resource">The resource that represents the render-target surface. This surface must have been created with the <see cref = "T:SharpDX.Direct3D11.BindFlags">RenderTarget</see> flag.</param>
31+
/// <unmanaged>ID3D11Device3::CreateRenderTargetView1</unmanaged>
32+
publicRenderTargetView1(Device3device,Resourceresource)
33+
:base(IntPtr.Zero)
34+
{
35+
device.CreateRenderTargetView1(resource,null,this);
36+
}
37+
38+
/// <summary>
39+
/// Creates a <see cref = "T:SharpDX.Direct3D11.RenderTargetView" /> for accessing resource data.
40+
/// </summary>
41+
/// <param name = "device">The device to use when creating this <see cref = "T:SharpDX.Direct3D11.RenderTargetView1" />.</param>
42+
/// <param name = "resource">The resource that represents the render-target surface. This surface must have been created with the <see cref = "T:SharpDX.Direct3D11.BindFlags">RenderTarget</see> flag.</param>
43+
/// <param name = "description">A structure describing the <see cref = "T:SharpDX.Direct3D11.RenderTargetView1" /> to be created.</param>
44+
/// <unmanaged>ID3D11Device3::CreateRenderTargetView1</unmanaged>
45+
publicRenderTargetView1(Device3device,Resourceresource,RenderTargetViewDescription1description)
46+
:base(IntPtr.Zero)
47+
{
48+
device.CreateRenderTargetView1(resource,description,this);
49+
}
50+
}
51+
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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+
usingSystem;
21+
usingSystem.IO;
22+
23+
namespaceSharpDX.Direct3D11
24+
{
25+
publicpartialclassShaderResourceView1
26+
{
27+
/// <summary>
28+
/// Creates a <see cref = "T:SharpDX.Direct3D11.ShaderResourceView1" /> for accessing resource data.
29+
/// </summary>
30+
/// <param name = "device">The device to use when creating this <see cref = "T:SharpDX.Direct3D11.ShaderResourceView1" />.</param>
31+
/// <param name = "resource">The resource that represents the render-target surface. This surface must have been created with the <see cref = "T:SharpDX.Direct3D11.BindFlags">ShaderResource</see> flag.</param>
32+
/// <msdn-id>ff476519</msdn-id>
33+
/// <unmanaged>HRESULT ID3D11Device3::CreateShaderResourceView1([In] ID3D11Resource* pResource,[In, Optional] const D3D11_SHADER_RESOURCE_VIEW_DESC1* pDesc,[Out, Fast] ID3D11ShaderResourceView1** ppSRView)</unmanaged>
34+
/// <unmanaged-short>ID3D11Device3::CreateShaderResourceView1</unmanaged-short>
35+
publicShaderResourceView1(Device3device,Resourceresource)
36+
:base(IntPtr.Zero)
37+
{
38+
device.CreateShaderResourceView1(resource,null,this);
39+
}
40+
41+
/// <summary>
42+
/// Creates a <see cref = "T:SharpDX.Direct3D11.ShaderResourceView" /> for accessing resource data.
43+
/// </summary>
44+
/// <param name = "device">The device to use when creating this <see cref = "T:SharpDX.Direct3D11.ShaderResourceView" />.</param>
45+
/// <param name = "resource">The resource that represents the render-target surface. This surface must have been created with the <see cref = "T:SharpDX.Direct3D11.BindFlags">ShaderResource</see> flag.</param>
46+
/// <param name = "description">A structure describing the <see cref = "T:SharpDX.Direct3D11.ShaderResourceView" /> to be created.</param>
47+
/// <msdn-id>ff476519</msdn-id>
48+
/// <unmanaged>HRESULT ID3D11Device3::CreateShaderResourceView1([In] ID3D11Resource* pResource,[In, Optional] const D3D11_SHADER_RESOURCE_VIEW_DESC1* pDesc,[Out, Fast] ID3D11ShaderResourceView1** ppSRView)</unmanaged>
49+
/// <unmanaged-short>ID3D11Device3::CreateShaderResourceView1</unmanaged-short>
50+
publicShaderResourceView1(Device3device,Resourceresource,ShaderResourceViewDescription1description)
51+
:base(IntPtr.Zero)
52+
{
53+
device.CreateShaderResourceView1(resource,description,this);
54+
}
55+
}
56+
}

‎Source/SharpDX.Direct3D11/SharpDX.Direct3D11.csproj‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
<CompileInclude="BlendStateDescription1.cs" />
2525
<CompileInclude="Device2.cs" />
2626
<CompileInclude="Device3.cs" />
27+
<CompileInclude="DeviceContext3.cs" />
2728
<CompileInclude="DeviceContext2.cs" />
29+
<CompileInclude="Query1.cs" />
2830
<CompileInclude="RasterizerState2.cs" />
2931
<CompileInclude="RasterizerStateDescription1.cs" />
3032
<CompileInclude="DepthStencilStateDescription.cs" />
@@ -67,18 +69,23 @@
6769
<CompileInclude="Query.cs" />
6870
<CompileInclude="RasterizerState.cs" />
6971
<CompileInclude="RenderTargetBlendDescription.cs" />
72+
<CompileInclude="RenderTargetView1.cs" />
7073
<CompileInclude="RenderTargetView.cs" />
7174
<CompileInclude="Resource.cs" />
7275
<CompileInclude="ResourceRegion.cs" />
7376
<CompileInclude="ResourceView.cs" />
7477
<CompileInclude="SamplerState.cs" />
7578
<CompileInclude="SamplerStateDescription.cs" />
79+
<CompileInclude="ShaderResourceView1.cs" />
7680
<CompileInclude="ShaderResourceView.cs" />
7781
<CompileInclude="StreamOutputBufferBinding.cs" />
7882
<CompileInclude="StreamOutputElement.cs" />
7983
<CompileInclude="Texture1D.cs" />
84+
<CompileInclude="Texture2D1.cs" />
8085
<CompileInclude="Texture2D.cs" />
86+
<CompileInclude="Texture3D1.cs" />
8187
<CompileInclude="Texture3D.cs" />
88+
<CompileInclude="UnorderedAccessView1.cs" />
8289
<CompileInclude="UnorderedAccessView.cs" />
8390
<CompileInclude="VertexBufferBinding.cs" />
8491
<CompileInclude="VertexShader.cs" />
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
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+
usingSystem;
21+
22+
namespaceSharpDX.Direct3D11
23+
{
24+
publicpartialclassTexture2D1
25+
{
26+
/// <summary>
27+
/// Initializes a new instance of the <see cref = "T:SharpDX.Direct3D11.Texture2D1" /> class.
28+
/// </summary>
29+
/// <param name = "device">The device with which to associate the texture.</param>
30+
/// <param name = "description">The description of the texture.</param>
31+
/// <msdn-id>ff476521</msdn-id>
32+
/// <unmanaged>HRESULT ID3D11Device3::CreateTexture2D1([In] const D3D11_TEXTURE2D_DESC1* pDesc,[In, Buffer, Optional] const D3D11_SUBRESOURCE_DATA* pInitialData,[Out, Fast] ID3D11Texture2D1** ppTexture2D)</unmanaged>
33+
/// <unmanaged-short>ID3D11Device3::CreateTexture2D1</unmanaged-short>
34+
publicTexture2D1(Device3device,Texture2DDescription1description)
35+
:base(IntPtr.Zero)
36+
{
37+
device.CreateTexture2D1(refdescription,null,this);
38+
}
39+
40+
/// <summary>
41+
/// Initializes a new instance of the <see cref = "T:SharpDX.Direct3D11.Texture2D1" /> class.
42+
/// </summary>
43+
/// <param name = "device">The device with which to associate the texture.</param>
44+
/// <param name = "description">The description of the texture.</param>
45+
/// <param name = "data">An array of initial texture data for each subresource.</param>
46+
/// <msdn-id>ff476521</msdn-id>
47+
/// <unmanaged>HRESULT ID3D11Device3::CreateTexture2D1([In] const D3D11_TEXTURE2D_DESC1* pDesc,[In, Buffer, Optional] const D3D11_SUBRESOURCE_DATA* pInitialData,[Out, Fast] ID3D11Texture2D1** ppTexture2D)</unmanaged>
48+
/// <unmanaged-short>ID3D11Device3::CreateTexture2D1</unmanaged-short>
49+
publicTexture2D1(Device3device,Texture2DDescription1description,paramsDataRectangle[]data)
50+
:base(IntPtr.Zero)
51+
{
52+
DataBox[]subResourceDatas=null;
53+
54+
if(data!=null&&data.Length>0)
55+
{
56+
subResourceDatas=newDataBox[data.Length];
57+
for(inti=0;i<subResourceDatas.Length;i++)
58+
{
59+
subResourceDatas[i].DataPointer=data[i].DataPointer;
60+
subResourceDatas[i].RowPitch=data[i].Pitch;
61+
}
62+
}
63+
64+
device.CreateTexture2D1(refdescription,subResourceDatas,this);
65+
}
66+
67+
/// <summary>
68+
/// Initializes a new instance of the <see cref = "T:SharpDX.Direct3D11.Texture2D1" /> class.
69+
/// </summary>
70+
/// <param name = "device">The device with which to associate the texture.</param>
71+
/// <param name = "description">The description of the texture.</param>
72+
/// <param name = "data">An array of initial texture data for each subresource.</param>
73+
/// <msdn-id>ff476521</msdn-id>
74+
/// <unmanaged>HRESULT ID3D11Device3::CreateTexture2D1([In] const D3D11_TEXTURE2D_DESC1* pDesc,[In, Buffer, Optional] const D3D11_SUBRESOURCE_DATA* pInitialData,[Out, Fast] ID3D11Texture2D** ppTexture2D)</unmanaged>
75+
/// <unmanaged-short>ID3D11Device3::CreateTexture2D1</unmanaged-short>
76+
publicTexture2D1(Device3device,Texture2DDescription1description,DataBox[]data)
77+
:base(IntPtr.Zero)
78+
{
79+
device.CreateTexture2D1(refdescription,data,this);
80+
}
81+
82+
/// <inheritdoc/>
83+
publicoverrideintCalculateSubResourceIndex(intmipSlice,intarraySlice,outintmipSize)
84+
{
85+
vardesc=Description;
86+
mipSize=CalculateMipSize(mipSlice,desc.Height);
87+
returnCalculateSubResourceIndex(mipSlice,arraySlice,desc.MipLevels);
88+
}
89+
}
90+
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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+
usingSystem;
21+
22+
namespaceSharpDX.Direct3D11
23+
{
24+
publicpartialclassTexture3D1
25+
{
26+
/// <summary>
27+
/// Initializes a new instance of the <see cref = "T:SharpDX.Direct3D11.Texture3D1" /> class.
28+
/// </summary>
29+
/// <param name = "device">The device with which to associate the texture.</param>
30+
/// <param name = "description">The description of the texture.</param>
31+
publicTexture3D1(Device3device,Texture3DDescription1description)
32+
:base(IntPtr.Zero)
33+
{
34+
device.CreateTexture3D1(refdescription,null,this);
35+
}
36+
37+
/// <summary>
38+
/// Initializes a new instance of the <see cref = "T:SharpDX.Direct3D11.Texture3D1" /> class.
39+
/// </summary>
40+
/// <param name = "device">The device with which to associate the texture.</param>
41+
/// <param name = "description">The description of the texture.</param>
42+
/// <param name = "data">An array of initial texture data for each subresource.</param>
43+
publicTexture3D1(Device3device,Texture3DDescription1description,DataBox[]data):base(IntPtr.Zero)
44+
{
45+
device.CreateTexture3D1(refdescription,data,this);
46+
}
47+
48+
/// <inheritdoc/>
49+
publicoverrideintCalculateSubResourceIndex(intmipSlice,intarraySlice,outintmipSize)
50+
{
51+
vardesc=Description;
52+
mipSize=CalculateMipSize(mipSlice,desc.Depth);
53+
returnCalculateSubResourceIndex(mipSlice,arraySlice,desc.MipLevels);
54+
}
55+
}
56+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp