Code refactoring to CommandList APIs

このコミットが含まれているのは:
Sergio Pedri committed 2021-02-05 16:00:36 +01:00
1 親 0f6fb3f49e
コミット c58f1e13da
8ファイル変更
+82 -162

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

+14 -14
ファイルの表示
@@ -94,10 +94,10 @@ namespace ComputeSharp.Resources
switch (resourceType)
{
case ResourceType.ReadOnly:
device.D3D12Device->CreateShaderResourceView(this.d3D12Resource, DXGIFormatHelper.GetForType<T>(), D3D12_SRV_DIMENSION_TEXTURE2D, D3D12CpuDescriptorHandle);
device.D3D12Device->CreateShaderResourceView(this.d3D12Resource.Get(), DXGIFormatHelper.GetForType<T>(), D3D12_SRV_DIMENSION_TEXTURE2D, D3D12CpuDescriptorHandle);
break;
case ResourceType.ReadWrite:
device.D3D12Device->CreateUnorderedAccessView(this.d3D12Resource, DXGIFormatHelper.GetForType<T>(), D3D12_UAV_DIMENSION_TEXTURE2D, D3D12CpuDescriptorHandle);
device.D3D12Device->CreateUnorderedAccessView(this.d3D12Resource.Get(), DXGIFormatHelper.GetForType<T>(), D3D12_UAV_DIMENSION_TEXTURE2D, D3D12CpuDescriptorHandle);
break;
}
}
@@ -159,10 +159,10 @@ namespace ComputeSharp.Resources
{
if (copyCommandList.D3D12CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE)
{
copyCommandList.ResourceBarrier(D3D12Resource, this.d3D12ResourceState, D3D12_RESOURCE_STATE_COPY_SOURCE);
copyCommandList.D3D12GraphicsCommandList->ResourceBarrier(D3D12Resource, this.d3D12ResourceState, D3D12_RESOURCE_STATE_COPY_SOURCE);
}
copyCommandList.CopyTextureRegion(
copyCommandList.D3D12GraphicsCommandList->CopyTextureRegion(
d3D12Resource.Get(),
&d3D12PlacedSubresourceFootprint,
D3D12Resource,
@@ -175,7 +175,7 @@ namespace ComputeSharp.Resources
if (copyCommandList.D3D12CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE)
{
copyCommandList.ResourceBarrier(D3D12Resource, D3D12_RESOURCE_STATE_COPY_SOURCE, this.d3D12ResourceState);
copyCommandList.D3D12GraphicsCommandList->ResourceBarrier(D3D12Resource, D3D12_RESOURCE_STATE_COPY_SOURCE, this.d3D12ResourceState);
}
copyCommandList.ExecuteAndWaitForCompletion();
@@ -232,10 +232,10 @@ namespace ComputeSharp.Resources
if (copyCommandList.D3D12CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE)
{
copyCommandList.ResourceBarrier(D3D12Resource, this.d3D12ResourceState, D3D12_RESOURCE_STATE_COPY_SOURCE);
copyCommandList.D3D12GraphicsCommandList->ResourceBarrier(D3D12Resource, this.d3D12ResourceState, D3D12_RESOURCE_STATE_COPY_SOURCE);
}
copyCommandList.CopyTextureRegion(
copyCommandList.D3D12GraphicsCommandList->CopyTextureRegion(
destination.D3D12Resource,
&d3D12PlacedSubresourceFootprint,
D3D12Resource,
@@ -248,7 +248,7 @@ namespace ComputeSharp.Resources
if (copyCommandList.D3D12CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE)
{
copyCommandList.ResourceBarrier(D3D12Resource, D3D12_RESOURCE_STATE_COPY_SOURCE, this.d3D12ResourceState);
copyCommandList.D3D12GraphicsCommandList->ResourceBarrier(D3D12Resource, D3D12_RESOURCE_STATE_COPY_SOURCE, this.d3D12ResourceState);
}
copyCommandList.ExecuteAndWaitForCompletion();
@@ -302,10 +302,10 @@ namespace ComputeSharp.Resources
if (copyCommandList.D3D12CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE)
{
copyCommandList.ResourceBarrier(D3D12Resource, this.d3D12ResourceState, D3D12_RESOURCE_STATE_COPY_DEST);
copyCommandList.D3D12GraphicsCommandList->ResourceBarrier(D3D12Resource, this.d3D12ResourceState, D3D12_RESOURCE_STATE_COPY_DEST);
}
copyCommandList.CopyTextureRegion(
copyCommandList.D3D12GraphicsCommandList->CopyTextureRegion(
D3D12Resource,
(uint)x,
(uint)y,
@@ -315,7 +315,7 @@ namespace ComputeSharp.Resources
if (copyCommandList.D3D12CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE)
{
copyCommandList.ResourceBarrier(D3D12Resource, D3D12_RESOURCE_STATE_COPY_DEST, this.d3D12ResourceState);
copyCommandList.D3D12GraphicsCommandList->ResourceBarrier(D3D12Resource, D3D12_RESOURCE_STATE_COPY_DEST, this.d3D12ResourceState);
}
copyCommandList.ExecuteAndWaitForCompletion();
@@ -359,10 +359,10 @@ namespace ComputeSharp.Resources
if (copyCommandList.D3D12CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE)
{
copyCommandList.ResourceBarrier(D3D12Resource, this.d3D12ResourceState, D3D12_RESOURCE_STATE_COPY_DEST);
copyCommandList.D3D12GraphicsCommandList->ResourceBarrier(D3D12Resource, this.d3D12ResourceState, D3D12_RESOURCE_STATE_COPY_DEST);
}
copyCommandList.CopyTextureRegion(
copyCommandList.D3D12GraphicsCommandList->CopyTextureRegion(
D3D12Resource,
(uint)x,
(uint)y,
@@ -372,7 +372,7 @@ namespace ComputeSharp.Resources
if (copyCommandList.D3D12CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE)
{
copyCommandList.ResourceBarrier(D3D12Resource, D3D12_RESOURCE_STATE_COPY_DEST, this.d3D12ResourceState);
copyCommandList.D3D12GraphicsCommandList->ResourceBarrier(D3D12Resource, D3D12_RESOURCE_STATE_COPY_DEST, this.d3D12ResourceState);
}
copyCommandList.ExecuteAndWaitForCompletion();