diff --git a/src/ComputeSharp.D2D1.Uwp/Loaders/D2D1ImmutableArrayResourceTextureDescriptionsLoader.cs b/src/ComputeSharp.D2D1.Uwp/Loaders/D2D1ImmutableArrayResourceTextureDescriptionsLoader.cs
index 4399ec7c..23b2a081 100644
--- a/src/ComputeSharp.D2D1.Uwp/Loaders/D2D1ImmutableArrayResourceTextureDescriptionsLoader.cs
+++ b/src/ComputeSharp.D2D1.Uwp/Loaders/D2D1ImmutableArrayResourceTextureDescriptionsLoader.cs
@@ -30,7 +30,7 @@ internal struct D2D1ImmutableArrayResourceTextureDescriptionsLoader : ID2D1Resou
}
///
- unsafe void ID2D1ResourceTextureDescriptionsLoader.LoadResourceTextureDescriptions(ReadOnlySpan data)
+ void ID2D1ResourceTextureDescriptionsLoader.LoadResourceTextureDescriptions(ReadOnlySpan data)
{
if (data.IsEmpty)
{
@@ -47,7 +47,7 @@ internal struct D2D1ImmutableArrayResourceTextureDescriptionsLoader : ID2D1Resou
indices[i] = descriptions[i].Index;
}
- this.indices = *(ImmutableArray*)&indices;
+ this.indices = Unsafe.As>(ref indices);
}
}
}
\ No newline at end of file
diff --git a/src/ComputeSharp.D2D1.Uwp/PixelShaderEffect{T}.Properties.Sources.cs b/src/ComputeSharp.D2D1.Uwp/PixelShaderEffect{T}.Properties.Sources.cs
index 3d36a9ea..167d43cf 100644
--- a/src/ComputeSharp.D2D1.Uwp/PixelShaderEffect{T}.Properties.Sources.cs
+++ b/src/ComputeSharp.D2D1.Uwp/PixelShaderEffect{T}.Properties.Sources.cs
@@ -208,7 +208,7 @@ partial class PixelShaderEffect
/// Gets the collection of valid indices for the current effect.
///
/// The collection of valid indices for the current effect.
- private static unsafe ImmutableArray GetIndices()
+ private static ImmutableArray GetIndices()
{
int inputCount = D2D1PixelShader.GetInputCount();
@@ -224,7 +224,7 @@ partial class PixelShaderEffect
indices[i] = i;
}
- return *(ImmutableArray*)&indices;
+ return Unsafe.As>(ref indices);
}
}
}
\ No newline at end of file