Minor code style tweaks

このコミットが含まれているのは:
Sergio Pedri committed 2020-11-17 23:39:47 +01:00
1 親 01a69420ac
コミット 034e7825f6
3ファイル変更
+6 -25

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

+1 -4
ファイルの表示
@@ -191,10 +191,7 @@ namespace ComputeSharp.Shaders
private static unsafe void CreatePipelineData(GraphicsDevice device, in CachedShader<T> shaderData, out PipelineData pipelineData)
{
using ComPtr<ID3D12RootSignature> d3D12RootSignature = device.D3D12Device->CreateRootSignature(shaderData.Loader.D3D12DescriptorRanges1);
D3D12_SHADER_BYTECODE d3D12ShaderBytecode = new((ID3DBlob*)shaderData.Bytecode.DxcBlob);
using ComPtr<ID3D12PipelineState> d3D12PipelineState = device.D3D12Device->CreateComputePipelineState(d3D12RootSignature.Get(), d3D12ShaderBytecode);
using ComPtr<ID3D12PipelineState> d3D12PipelineState = device.D3D12Device->CreateComputePipelineState(d3D12RootSignature.Get(), shaderData.Bytecode.D3D12ShaderBytecode);
pipelineData = new PipelineData(d3D12RootSignature.Move(), d3D12PipelineState.Move());
+1 -1
ファイルの表示
@@ -25,7 +25,7 @@ namespace ComputeSharp.Shaders.Translation.Interop
/// <summary>
/// Gets a raw pointer to the <see cref="IDxcBlob"/> instance in use.
/// </summary>
public IDxcBlob* DxcBlob => this.dxcBlob;
public D3D12_SHADER_BYTECODE D3D12ShaderBytecode => new((ID3DBlob*)this.dxcBlob.Get());
/// <inheritdoc/>
protected override void OnDispose()
+4 -20
ファイルの表示
@@ -151,11 +151,7 @@ namespace ComputeSharp.Shaders.Translation
if (shaderFields.Count == 0) throw new InvalidOperationException("Empty shader body");
// Descriptor for the buffer for captured scalar/vector variables
D3D12_DESCRIPTOR_RANGE1.Init(
out D3D12_DESCRIPTOR_RANGE1 d3D12DescriptorRange1,
D3D12_DESCRIPTOR_RANGE_TYPE_CBV,
1,
this.constantBuffersCount++);
D3D12_DESCRIPTOR_RANGE1 d3D12DescriptorRange1 = new(D3D12_DESCRIPTOR_RANGE_TYPE_CBV, 1, this.constantBuffersCount++);
this.d3D12DescriptorRanges1.Add(d3D12DescriptorRange1);
@@ -180,11 +176,7 @@ namespace ComputeSharp.Shaders.Translation
// Constant buffer
if (HlslKnownTypes.IsConstantBufferType(fieldType))
{
D3D12_DESCRIPTOR_RANGE1.Init(
out D3D12_DESCRIPTOR_RANGE1 d3D12DescriptorRange1,
D3D12_DESCRIPTOR_RANGE_TYPE_CBV,
1,
this.constantBuffersCount++);
D3D12_DESCRIPTOR_RANGE1 d3D12DescriptorRange1 = new(D3D12_DESCRIPTOR_RANGE_TYPE_CBV, 1, this.constantBuffersCount++);
this.d3D12DescriptorRanges1.Add(d3D12DescriptorRange1);
@@ -197,11 +189,7 @@ namespace ComputeSharp.Shaders.Translation
else if (HlslKnownTypes.IsReadOnlyBufferType(fieldType))
{
// Root parameter for a readonly buffer
D3D12_DESCRIPTOR_RANGE1.Init(
out D3D12_DESCRIPTOR_RANGE1 d3D12DescriptorRange1,
D3D12_DESCRIPTOR_RANGE_TYPE_SRV,
1,
this.readOnlyBuffersCount++);
D3D12_DESCRIPTOR_RANGE1 d3D12DescriptorRange1 = new(D3D12_DESCRIPTOR_RANGE_TYPE_SRV, 1, this.readOnlyBuffersCount++);
this.d3D12DescriptorRanges1.Add(d3D12DescriptorRange1);
@@ -214,11 +202,7 @@ namespace ComputeSharp.Shaders.Translation
else if (HlslKnownTypes.IsReadWriteBufferType(fieldType))
{
// Root parameter for a read write buffer
D3D12_DESCRIPTOR_RANGE1.Init(
out D3D12_DESCRIPTOR_RANGE1 d3D12DescriptorRange1,
D3D12_DESCRIPTOR_RANGE_TYPE_UAV,
1,
this.readWriteBuffersCount++);
D3D12_DESCRIPTOR_RANGE1 d3D12DescriptorRange1 = new(D3D12_DESCRIPTOR_RANGE_TYPE_UAV, 1, this.readWriteBuffersCount++);
this.d3D12DescriptorRanges1.Add(d3D12DescriptorRange1);