diff --git a/src/ComputeSharp.Graphics/Resources/Abstract/Texture2D{T}.cs b/src/ComputeSharp.Graphics/Resources/Abstract/Texture2D{T}.cs index 80825945..02385adb 100644 --- a/src/ComputeSharp.Graphics/Resources/Abstract/Texture2D{T}.cs +++ b/src/ComputeSharp.Graphics/Resources/Abstract/Texture2D{T}.cs @@ -78,8 +78,6 @@ namespace ComputeSharp.Resources } GraphicsDevice = device; - Width = width; - Height = height; this.d3D12Resource = device.D3D12Device->CreateCommittedResource( resourceType, @@ -123,12 +121,12 @@ namespace ComputeSharp.Resources /// /// Gets the width of the current texture. /// - public int Width { get; } + public int Width => (int)this.d3D12PlacedSubresourceFootprint.Footprint.Width; /// /// Gets the height of the current texture. /// - public int Height { get; } + public int Height => (int)this.d3D12PlacedSubresourceFootprint.Footprint.Height; /// /// Gets the instance currently mapped. diff --git a/src/ComputeSharp.Graphics/Resources/Abstract/Texture3D{T}.cs b/src/ComputeSharp.Graphics/Resources/Abstract/Texture3D{T}.cs index 34dfe533..7b2d1af9 100644 --- a/src/ComputeSharp.Graphics/Resources/Abstract/Texture3D{T}.cs +++ b/src/ComputeSharp.Graphics/Resources/Abstract/Texture3D{T}.cs @@ -80,9 +80,6 @@ namespace ComputeSharp.Resources } GraphicsDevice = device; - Width = width; - Height = height; - Depth = depth; this.d3D12Resource = device.D3D12Device->CreateCommittedResource( resourceType, @@ -128,17 +125,17 @@ namespace ComputeSharp.Resources /// /// Gets the width of the current texture. /// - public int Width { get; } + public int Width => (int)this.d3D12PlacedSubresourceFootprint.Footprint.Width; /// /// Gets the height of the current texture. /// - public int Height { get; } + public int Height => (int)this.d3D12PlacedSubresourceFootprint.Footprint.Height; /// /// Gets the depth of the current texture. /// - public int Depth { get; } + public int Depth => (int)this.d3D12PlacedSubresourceFootprint.Footprint.Depth; /// /// Gets the instance currently mapped. diff --git a/src/ComputeSharp.Graphics/Resources/Abstract/TransferTexture2D{T}.cs b/src/ComputeSharp.Graphics/Resources/Abstract/TransferTexture2D{T}.cs index 8d825c03..41807c7e 100644 --- a/src/ComputeSharp.Graphics/Resources/Abstract/TransferTexture2D{T}.cs +++ b/src/ComputeSharp.Graphics/Resources/Abstract/TransferTexture2D{T}.cs @@ -54,8 +54,6 @@ namespace ComputeSharp.Resources } GraphicsDevice = device; - Width = width; - Height = height; GraphicsDevice.D3D12Device->GetCopyableFootprint( DXGIFormatHelper.GetForType(), @@ -77,12 +75,12 @@ namespace ComputeSharp.Resources /// /// Gets the width of the current texture. /// - public int Width { get; } + public int Width => (int)this.d3D12PlacedSubresourceFootprint.Footprint.Width; /// /// Gets the height of the current texture. /// - public int Height { get; } + public int Height => (int)this.d3D12PlacedSubresourceFootprint.Footprint.Height; /// /// Gets the instance currently mapped. diff --git a/src/ComputeSharp.Graphics/Resources/Abstract/TransferTexture3D{T}.cs b/src/ComputeSharp.Graphics/Resources/Abstract/TransferTexture3D{T}.cs index c16364a5..e26a4e54 100644 --- a/src/ComputeSharp.Graphics/Resources/Abstract/TransferTexture3D{T}.cs +++ b/src/ComputeSharp.Graphics/Resources/Abstract/TransferTexture3D{T}.cs @@ -56,9 +56,6 @@ namespace ComputeSharp.Resources } GraphicsDevice = device; - Width = width; - Height = height; - Depth = depth; GraphicsDevice.D3D12Device->GetCopyableFootprint( DXGIFormatHelper.GetForType(), @@ -81,16 +78,16 @@ namespace ComputeSharp.Resources /// /// Gets the width of the current texture. /// - public int Width { get; } + public int Width => (int)this.d3D12PlacedSubresourceFootprint.Footprint.Width; /// /// Gets the height of the current texture. /// - public int Height { get; } + public int Height => (int)this.d3D12PlacedSubresourceFootprint.Footprint.Height; /// /// Gets the depth of the current texture. /// - public int Depth { get; } + public int Depth => (int)this.d3D12PlacedSubresourceFootprint.Footprint.Depth; /// /// Gets the instance currently mapped.