-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #55 from john-h-k/patch-1
Add CreateRootSignature
- Loading branch information
Showing
5 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#include <Windows.h> | ||
#include <DirectXHelpers.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
@../../settings.rsp | ||
@../../remap.rsp | ||
--file | ||
dxtk12-DirectXHelpers.h | ||
--output | ||
../../../sources/Interop/Windows/dxtk12/DirectXHelpers | ||
--test-output | ||
../../../tests/Interop/Windows/dxtk12/DirectXHelpers | ||
--traverse | ||
DirectXHelpers.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. | ||
|
||
// Ported from DirectXHelpers.h in the microsoft/DirectXTK12 tag jan2021 | ||
// Original source is Copyright © Microsoft. All rights reserved. Licensed under the University of Illinois Open Source License. |
29 changes: 29 additions & 0 deletions
29
sources/Interop/Windows/dxtk12/DirectXHelpers/Windows.Manual.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. | ||
|
||
// Ported from DirectXHelpers.h in the microsoft/DirectXTK12 tag jan2021 | ||
// Original source is Copyright © Microsoft. All rights reserved. Licensed under the University of Illinois Open Source License. | ||
|
||
using System; | ||
using static TerraFX.Interop.D3D_ROOT_SIGNATURE_VERSION; | ||
|
||
namespace TerraFX.Interop | ||
{ | ||
public static unsafe partial class Windows | ||
{ | ||
[return: NativeTypeName("HRESULT")] | ||
public static int CreateRootSignature([NativeTypeName("ID3D12Device *")] ID3D12Device* device, [NativeTypeName("const D3D12_ROOT_SIGNATURE_DESC *")] D3D12_ROOT_SIGNATURE_DESC* rootSignatureDesc, [NativeTypeName("ID3D12RootSignature **")] ID3D12RootSignature** rootSignature) | ||
{ | ||
using ComPtr<ID3DBlob> pSignature = new ComPtr<ID3DBlob>(); | ||
using ComPtr<ID3DBlob> pError = new ComPtr<ID3DBlob>(); | ||
|
||
HRESULT hr = D3D12SerializeRootSignature(rootSignatureDesc, D3D_ROOT_SIGNATURE_VERSION_1, pSignature.GetAddressOf(), pError.GetAddressOf()); | ||
|
||
if (SUCCEEDED(hr)) | ||
{ | ||
hr = device->CreateRootSignature(0, pSignature.Get()->GetBufferPointer(), pSignature.Get()->GetBufferSize(), __uuidof<ID3D12RootSignature>(), (void**)rootSignature); | ||
} | ||
|
||
return hr; | ||
} | ||
} | ||
} |