Added TerraFX PipelineData type

このコミットが含まれているのは:
Sergio Pedri committed 2020-11-16 21:35:27 +01:00
1 親 3818fef1d0
コミット a292f8f017
2ファイル変更
+59 -3

検索条件に一致するファイルはありません

+3 -3
ファイルの表示
@@ -85,10 +85,10 @@ namespace ComputeSharp.Graphics.Commands
/// Sets a given <see cref="PipelineState"/> object ready to be executed.
/// </summary>
/// <param name="pipelineState">The input <see cref="PipelineState"/> to setup.</param>
public void SetPipelineState(PipelineState pipelineState)
public void SetPipelineData(PipelineData pipelineData)
{
// TODO: D3D12GraphicsCommandList->SetComputeRootSignature()
// TODO: D3D12GraphicsCommandList->SetPipelineState()
D3D12GraphicsCommandList->SetComputeRootSignature(pipelineData.D3D12RootSignature);
D3D12GraphicsCommandList->SetPipelineState(pipelineData.D3D12PipelineState);
}
/// <summary>
+56
ファイルの表示
@@ -0,0 +1,56 @@
using ComputeSharp.Core.Interop;
using TerraFX.Interop;
namespace ComputeSharp.Graphics.Commands
{
/// <summary>
/// A <see langword="class"/> representing a custom pipeline state for a compute operation.
/// </summary>
internal sealed unsafe class PipelineData : NativeObject
{
/// <summary>
/// The <see cref="ID3D12RootSignature"/> instance for the current <see cref="PipelineData"/> object.
/// </summary>
private ComPtr<ID3D12RootSignature> d3D12RootSignature;
/// <summary>
/// The <see cref="ID3D12PipelineState"/> instance for the current <see cref="PipelineData"/> object.
/// </summary>
private ComPtr<ID3D12PipelineState> d3D12PipelineState;
/// <summary>
/// Creates a new <see cref="PipelineState"/> instance with the specified parameters
/// </summary>
/// <param name="device">The <see cref="GraphicsDevice"/> to use</param>
/// <param name="rootSignature">The <see cref="ID3D12RootSignature"/> value for the current shader</param>
/// <param name="computeShader">The bytecode for the compute shader to run</param>
public PipelineData(ComPtr<ID3D12RootSignature> d3D12RootSignature, ComPtr<ID3D12PipelineState> d3D12PipelineState)
{
this.d3D12RootSignature = d3D12RootSignature;
this.d3D12PipelineState = d3D12PipelineState;
}
/// <summary>
/// Gets the <see cref="ID3D12RootSignature"/> instance for the current <see cref="PipelineData"/> object.
/// </summary>
public ID3D12RootSignature* D3D12RootSignature
{
get => this.d3D12RootSignature;
}
/// <summary>
/// Gets the <see cref="ID3D12PipelineState"/> instance for the current <see cref="PipelineData"/> object.
/// </summary>
public ID3D12PipelineState* D3D12PipelineState
{
get => this.d3D12PipelineState;
}
/// <inheritdoc/>
protected override void Dispose(bool disposing)
{
this.d3D12RootSignature.Dispose();
this.d3D12PipelineState.Dispose();
}
}
}