Restore disposal checks in readonly wrappers

このコミットが含まれているのは:
Sergio Pedri committed 2022-08-03 22:47:23 +02:00
1 親 28abda5396
コミット 4cf14e9ccf
4ファイル変更
+15

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

+6
ファイルの表示
@@ -76,6 +76,9 @@ partial class ReadWriteTexture2D<T, TPixel>
/// <param name="owner">The owning <see cref="ReadWriteTexture2D{T, TPixel}"/> instance to wrap.</param>
public ReadOnly(ReadWriteTexture2D<T, TPixel> owner)
{
// This call is required to ensure the underlying resource is kept alive as long as this resource
// is not disposed, given that the underlying native resource is the same. Additional checks are
// still performed below so that exceptions are thrown early, but this is needed to ensure safety.
owner.DangerousAddRef();
this.owner = owner;
@@ -110,6 +113,7 @@ partial class ReadWriteTexture2D<T, TPixel>
D3D12_GPU_DESCRIPTOR_HANDLE GraphicsResourceHelper.IGraphicsResource.ValidateAndGetGpuDescriptorHandle(GraphicsDevice device)
{
using var _0 = GetReferenceTrackingLease();
using var _1 = this.owner.GetReferenceTrackingLease();
this.owner.ThrowIfDeviceMismatch(device);
@@ -127,6 +131,8 @@ partial class ReadWriteTexture2D<T, TPixel>
{
lease = GetReferenceTrackingLease();
using var _1 = this.owner.GetReferenceTrackingLease();
this.owner.ThrowIfDeviceMismatch(device);
return this.owner.D3D12Resource;
+3
ファイルの表示
@@ -113,6 +113,7 @@ partial class ReadWriteTexture2D<T>
D3D12_GPU_DESCRIPTOR_HANDLE GraphicsResourceHelper.IGraphicsResource.ValidateAndGetGpuDescriptorHandle(GraphicsDevice device)
{
using var _0 = GetReferenceTrackingLease();
using var _1 = this.owner.GetReferenceTrackingLease();
this.owner.ThrowIfDeviceMismatch(device);
@@ -130,6 +131,8 @@ partial class ReadWriteTexture2D<T>
{
lease = GetReferenceTrackingLease();
using var _1 = this.owner.GetReferenceTrackingLease();
this.owner.ThrowIfDeviceMismatch(device);
return this.owner.D3D12Resource;
+3
ファイルの表示
@@ -113,6 +113,7 @@ partial class ReadWriteTexture3D<T, TPixel>
D3D12_GPU_DESCRIPTOR_HANDLE GraphicsResourceHelper.IGraphicsResource.ValidateAndGetGpuDescriptorHandle(GraphicsDevice device)
{
using var _0 = GetReferenceTrackingLease();
using var _1 = this.owner.GetReferenceTrackingLease();
this.owner.ThrowIfDeviceMismatch(device);
@@ -130,6 +131,8 @@ partial class ReadWriteTexture3D<T, TPixel>
{
lease = GetReferenceTrackingLease();
using var _1 = this.owner.GetReferenceTrackingLease();
this.owner.ThrowIfDeviceMismatch(device);
return this.owner.D3D12Resource;
+3
ファイルの表示
@@ -113,6 +113,7 @@ partial class ReadWriteTexture3D<T>
D3D12_GPU_DESCRIPTOR_HANDLE GraphicsResourceHelper.IGraphicsResource.ValidateAndGetGpuDescriptorHandle(GraphicsDevice device)
{
using var _0 = GetReferenceTrackingLease();
using var _1 = this.owner.GetReferenceTrackingLease();
this.owner.ThrowIfDeviceMismatch(device);
@@ -130,6 +131,8 @@ partial class ReadWriteTexture3D<T>
{
lease = GetReferenceTrackingLease();
using var _1 = this.owner.GetReferenceTrackingLease();
this.owner.ThrowIfDeviceMismatch(device);
return this.owner.D3D12Resource;