Rename pixel interfaces to IRead[Only|Write]NormalizedTextureMD<TPixel>

このコミットが含まれているのは:
Sergio Pedri committed 2022-01-22 15:01:06 +01:00
1 親 f906dbaae0
コミット 9b05770168
40ファイル変更
+117 -117

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

+3 -3
ファイルの表示
@@ -315,7 +315,7 @@ public sealed partial class HlslBokehBlurProcessor
[AutoConstructor]
internal partial struct VerticalConvolutionProcessor : IComputeShader
{
public IReadWriteTexture2D<float4> source;
public IReadWriteNormalizedTexture2D<float4> source;
public ReadWriteTexture2D<float4> reals;
public ReadWriteTexture2D<float4> imaginaries;
public ReadOnlyBuffer<Complex64> kernel;
@@ -392,7 +392,7 @@ public sealed partial class HlslBokehBlurProcessor
[AutoConstructor]
internal readonly partial struct GammaHighlightProcessor : IComputeShader
{
public readonly IReadWriteTexture2D<float4> source;
public readonly IReadWriteNormalizedTexture2D<float4> source;
/// <inheritdoc/>
public void Execute()
@@ -417,7 +417,7 @@ public sealed partial class HlslBokehBlurProcessor
internal readonly partial struct InverseGammaHighlightProcessor : IComputeShader
{
public readonly ReadWriteTexture2D<float4> source;
public readonly IReadWriteTexture2D<float4> target;
public readonly IReadWriteNormalizedTexture2D<float4> target;
/// <inheritdoc/>
public void Execute()
+4 -4
ファイルの表示
@@ -121,8 +121,8 @@ public sealed partial class HlslGaussianBlurProcessor
[AutoConstructor]
internal readonly partial struct VerticalConvolutionProcessor : IComputeShader
{
public readonly IReadWriteTexture2D<float4> source;
public readonly IReadWriteTexture2D<float4> target;
public readonly IReadWriteNormalizedTexture2D<float4> source;
public readonly IReadWriteNormalizedTexture2D<float4> target;
public readonly ReadOnlyBuffer<float> kernel;
/// <inheritdoc/>
@@ -153,8 +153,8 @@ public sealed partial class HlslGaussianBlurProcessor
[AutoConstructor]
internal readonly partial struct HorizontalConvolutionProcessor : IComputeShader
{
public readonly IReadWriteTexture2D<float4> source;
public readonly IReadWriteTexture2D<float4> target;
public readonly IReadWriteNormalizedTexture2D<float4> source;
public readonly IReadWriteNormalizedTexture2D<float4> target;
public readonly ReadOnlyBuffer<float> kernel;
/// <inheritdoc/>
+1 -1
ファイルの表示
@@ -23,7 +23,7 @@ public sealed class ContouredLayersRunner : IShaderRunner
private ReadOnlyTexture2D<Rgba32, Float4>? texture;
/// <inheritdoc/>
public bool TryExecute(IReadWriteTexture2D<Float4> texture, TimeSpan timespan, object? parameter)
public bool TryExecute(IReadWriteNormalizedTexture2D<Float4> texture, TimeSpan timespan, object? parameter)
{
if (this.texture is null ||
this.texture.GraphicsDevice != texture.GraphicsDevice)
+1 -1
ファイルの表示
@@ -19,7 +19,7 @@ internal readonly partial struct ContouredLayers : IPixelShader<float4>
/// <summary>
/// The background texture to sample.
/// </summary>
public readonly IReadOnlyTexture2D<float4> texture;
public readonly IReadOnlyNormalizedTexture2D<float4> texture;
// float3 to float hash.
private static float Hash21(float2 p)
+1 -1
ファイルの表示
@@ -12,7 +12,7 @@ class Program
/// <summary>
/// A texture for <c>\Textures\RustyMetal.png</c>.
/// </summary>
private static readonly IReadOnlyTexture2D<float4> RustyMetal = LoadTexture();
private static readonly IReadOnlyNormalizedTexture2D<float4> RustyMetal = LoadTexture();
/// <summary>
/// The mapping of available samples to choose from.
+18 -18
ファイルの表示
@@ -22,14 +22,14 @@ internal static class HlslKnownMembers
[$"ComputeSharp.ReadOnlyTexture2D`2.this[{typeof(int).FullName}, {typeof(int).FullName}]"] = "int2",
[$"ComputeSharp.ReadWriteTexture2D`1.this[{typeof(int).FullName}, {typeof(int).FullName}]"] = "int2",
[$"ComputeSharp.ReadWriteTexture2D`2.this[{typeof(int).FullName}, {typeof(int).FullName}]"] = "int2",
[$"ComputeSharp.IReadOnlyTexture2D`1.this[{typeof(int).FullName}, {typeof(int).FullName}]"] = "int2",
[$"ComputeSharp.IReadWriteTexture2D`1.this[{typeof(int).FullName}, {typeof(int).FullName}]"] = "int2",
[$"ComputeSharp.IReadOnlyNormalizedTexture2D`1.this[{typeof(int).FullName}, {typeof(int).FullName}]"] = "int2",
[$"ComputeSharp.IReadWriteNormalizedTexture2D`1.this[{typeof(int).FullName}, {typeof(int).FullName}]"] = "int2",
[$"ComputeSharp.ReadOnlyTexture3D`1.this[{typeof(int).FullName}, {typeof(int).FullName}, {typeof(int).FullName}]"] = "int3",
[$"ComputeSharp.ReadOnlyTexture3D`2.this[{typeof(int).FullName}, {typeof(int).FullName}, {typeof(int).FullName}]"] = "int3",
[$"ComputeSharp.ReadWriteTexture3D`1.this[{typeof(int).FullName}, {typeof(int).FullName}, {typeof(int).FullName}]"] = "int3",
[$"ComputeSharp.ReadWriteTexture3D`2.this[{typeof(int).FullName}, {typeof(int).FullName}, {typeof(int).FullName}]"] = "int3",
[$"ComputeSharp.IReadOnlyTexture3D`1.this[{typeof(int).FullName}, {typeof(int).FullName}, {typeof(int).FullName}]"] = "int3",
[$"ComputeSharp.IReadWriteTexture3D`1.this[{typeof(int).FullName}, {typeof(int).FullName}, {typeof(int).FullName}]"] = "int3"
[$"ComputeSharp.IReadOnlyNormalizedTexture3D`1.this[{typeof(int).FullName}, {typeof(int).FullName}, {typeof(int).FullName}]"] = "int3",
[$"ComputeSharp.IReadWriteNormalizedTexture3D`1.this[{typeof(int).FullName}, {typeof(int).FullName}, {typeof(int).FullName}]"] = "int3"
};
/// <summary>
@@ -39,12 +39,12 @@ internal static class HlslKnownMembers
{
[$"ComputeSharp.ReadOnlyTexture2D`2.this[{typeof(float).FullName}, {typeof(float).FullName}]"] = "float2",
[$"ComputeSharp.ReadOnlyTexture2D`2.this[{typeof(Float2).FullName}]"] = null,
[$"ComputeSharp.IReadOnlyTexture2D`1.this[{typeof(float).FullName}, {typeof(float).FullName}]"] = "float2",
[$"ComputeSharp.IReadOnlyTexture2D`1.this[{typeof(Float2).FullName}]"] = null,
[$"ComputeSharp.IReadOnlyNormalizedTexture2D`1.this[{typeof(float).FullName}, {typeof(float).FullName}]"] = "float2",
[$"ComputeSharp.IReadOnlyNormalizedTexture2D`1.this[{typeof(Float2).FullName}]"] = null,
[$"ComputeSharp.ReadOnlyTexture3D`2.this[{typeof(float).FullName}, {typeof(float).FullName}, {typeof(float).FullName}]"] = "float3",
[$"ComputeSharp.ReadOnlyTexture3D`2.this[{typeof(Float3).FullName}]"] = null,
[$"ComputeSharp.IReadOnlyTexture3D`1.this[{typeof(float).FullName}, {typeof(float).FullName}, {typeof(float).FullName}]"] = "float3",
[$"ComputeSharp.IReadOnlyTexture3D`1.this[{typeof(Float3).FullName}]"] = null
[$"ComputeSharp.IReadOnlyNormalizedTexture3D`1.this[{typeof(float).FullName}, {typeof(float).FullName}, {typeof(float).FullName}]"] = "float3",
[$"ComputeSharp.IReadOnlyNormalizedTexture3D`1.this[{typeof(Float3).FullName}]"] = null
};
/// <summary>
@@ -58,16 +58,16 @@ internal static class HlslKnownMembers
["ComputeSharp.Resources.Texture3D`1.Width"] = (3, 0),
["ComputeSharp.Resources.Texture3D`1.Height"] = (3, 1),
["ComputeSharp.Resources.Texture3D`1.Depth"] = (3, 2),
["ComputeSharp.IReadOnlyTexture2D`1.Width"] = (2, 0),
["ComputeSharp.IReadOnlyTexture2D`1.Height"] = (2, 1),
["ComputeSharp.IReadOnlyTexture3D`1.Width"] = (3, 0),
["ComputeSharp.IReadOnlyTexture3D`1.Height"] = (3, 1),
["ComputeSharp.IReadOnlyTexture3D`1.Depth"] = (3, 2),
["ComputeSharp.IReadWriteTexture2D`1.Width"] = (2, 0),
["ComputeSharp.IReadWriteTexture2D`1.Height"] = (2, 1),
["ComputeSharp.IReadWriteTexture3D`1.Width"] = (3, 0),
["ComputeSharp.IReadWriteTexture3D`1.Height"] = (3, 1),
["ComputeSharp.IReadWriteTexture3D`1.Depth"] = (3, 2)
["ComputeSharp.IReadOnlyNormalizedTexture2D`1.Width"] = (2, 0),
["ComputeSharp.IReadOnlyNormalizedTexture2D`1.Height"] = (2, 1),
["ComputeSharp.IReadOnlyNormalizedTexture3D`1.Width"] = (3, 0),
["ComputeSharp.IReadOnlyNormalizedTexture3D`1.Height"] = (3, 1),
["ComputeSharp.IReadOnlyNormalizedTexture3D`1.Depth"] = (3, 2),
["ComputeSharp.IReadWriteNormalizedTexture2D`1.Width"] = (2, 0),
["ComputeSharp.IReadWriteNormalizedTexture2D`1.Height"] = (2, 1),
["ComputeSharp.IReadWriteNormalizedTexture3D`1.Width"] = (3, 0),
["ComputeSharp.IReadWriteNormalizedTexture3D`1.Height"] = (3, 1),
["ComputeSharp.IReadWriteNormalizedTexture3D`1.Depth"] = (3, 2)
};
/// <summary>
+12 -12
ファイルの表示
@@ -141,8 +141,8 @@ internal static class HlslKnownTypes
"ComputeSharp.ReadOnlyTexture2D`2" or
"ComputeSharp.ReadOnlyTexture3D`1" or
"ComputeSharp.ReadOnlyTexture3D`2" or
"ComputeSharp.IReadOnlyTexture2D`1" or
"ComputeSharp.IReadOnlyTexture3D`1" => true,
"ComputeSharp.IReadOnlyNormalizedTexture2D`1" or
"ComputeSharp.IReadOnlyNormalizedTexture3D`1" => true,
_ => false,
};
}
@@ -161,8 +161,8 @@ internal static class HlslKnownTypes
"ComputeSharp.ReadWriteTexture2D`2" or
"ComputeSharp.ReadWriteTexture3D`1" or
"ComputeSharp.ReadWriteTexture3D`2" or
"ComputeSharp.IReadWriteTexture2D`1" or
"ComputeSharp.IReadWriteTexture3D`1" => true,
"ComputeSharp.IReadWriteNormalizedTexture2D`1" or
"ComputeSharp.IReadWriteNormalizedTexture3D`1" => true,
_ => false,
};
}
@@ -187,10 +187,10 @@ internal static class HlslKnownTypes
"ComputeSharp.ReadOnlyTexture3D`2" or
"ComputeSharp.ReadWriteTexture3D`1" or
"ComputeSharp.ReadWriteTexture3D`2" or
"ComputeSharp.IReadOnlyTexture2D`1" or
"ComputeSharp.IReadWriteTexture2D`1" or
"ComputeSharp.IReadOnlyTexture3D`1" or
"ComputeSharp.IReadWriteTexture3D`1" => true,
"ComputeSharp.IReadOnlyNormalizedTexture2D`1" or
"ComputeSharp.IReadWriteNormalizedTexture2D`1" or
"ComputeSharp.IReadOnlyNormalizedTexture3D`1" or
"ComputeSharp.IReadWriteNormalizedTexture3D`1" => true,
_ => false,
};
}
@@ -294,10 +294,10 @@ internal static class HlslKnownTypes
"ComputeSharp.ReadOnlyTexture3D`2" => $"Texture3D<unorm {mappedElementType}>",
"ComputeSharp.ReadWriteTexture3D`1" => $"RWTexture3D<{mappedElementType}>",
"ComputeSharp.ReadWriteTexture3D`2" => $"RWTexture3D<unorm {mappedElementType}>",
"ComputeSharp.IReadOnlyTexture2D`1" => $"Texture2D<unorm {mappedElementType}>",
"ComputeSharp.IReadWriteTexture2D`1" => $"RWTexture2D<unorm {mappedElementType}>",
"ComputeSharp.IReadOnlyTexture3D`1" => $"Texture3D<unorm {mappedElementType}>",
"ComputeSharp.IReadWriteTexture3D`1" => $"RWTexture3D<unorm {mappedElementType}>",
"ComputeSharp.IReadOnlyNormalizedTexture2D`1" => $"Texture2D<unorm {mappedElementType}>",
"ComputeSharp.IReadWriteNormalizedTexture2D`1" => $"RWTexture2D<unorm {mappedElementType}>",
"ComputeSharp.IReadOnlyNormalizedTexture3D`1" => $"Texture3D<unorm {mappedElementType}>",
"ComputeSharp.IReadWriteNormalizedTexture3D`1" => $"RWTexture3D<unorm {mappedElementType}>",
_ => throw new ArgumentException()
};
}
+1 -1
ファイルの表示
@@ -22,5 +22,5 @@ public interface IShaderRunner
/// Any exceptions thrown by the runner will result in <see cref="ComputeShaderPanel.RenderingFailed"/>
/// or <see cref="AnimatedComputeShaderPanel.RenderingFailed"/> to be raised.
/// </remarks>
bool TryExecute(IReadWriteTexture2D<Float4> texture, TimeSpan timespan, object? parameter);
bool TryExecute(IReadWriteNormalizedTexture2D<Float4> texture, TimeSpan timespan, object? parameter);
}
+1 -1
ファイルの表示
@@ -57,7 +57,7 @@ public sealed class ShaderRunner<T> : IShaderRunner
}
/// <inheritdoc/>
public bool TryExecute(IReadWriteTexture2D<Float4> texture, TimeSpan time, object? parameter)
public bool TryExecute(IReadWriteNormalizedTexture2D<Float4> texture, TimeSpan time, object? parameter)
{
if (this.shaderFactory is Func<TimeSpan, T> shaderFactory)
{
+3 -3
ファイルの表示
@@ -35,9 +35,9 @@ public enum DispatchAxis
/// Indicates a shader dispatch along the X and Y axes.
/// </summary>
/// <remarks>
/// This applies to using <see cref="GraphicsDeviceExtensions.For{T}(GraphicsDevice, int, int, in T)"/>, <see cref="GraphicsDeviceExtensions.ForEach{T, TPixel}(GraphicsDevice, IReadWriteTexture2D{TPixel})"/>,
/// <see cref="GraphicsDeviceExtensions.ForEach{T, TPixel}(GraphicsDevice, IReadWriteTexture2D{TPixel}, in T)"/>, <see cref="ComputeContextExtensions.For{T}(in ComputeContext, int, int, in T)"/>,
/// <see cref="ComputeContextExtensions.ForEach{T, TPixel}(in ComputeContext, IReadWriteTexture2D{TPixel})"/> or <see cref="ComputeContextExtensions.ForEach{T, TPixel}(in ComputeContext, IReadWriteTexture2D{TPixel}, in T)"/>.
/// This applies to using <see cref="GraphicsDeviceExtensions.For{T}(GraphicsDevice, int, int, in T)"/>, <see cref="GraphicsDeviceExtensions.ForEach{T, TPixel}(GraphicsDevice, IReadWriteNormalizedTexture2D{TPixel})"/>,
/// <see cref="GraphicsDeviceExtensions.ForEach{T, TPixel}(GraphicsDevice, IReadWriteNormalizedTexture2D{TPixel}, in T)"/>, <see cref="ComputeContextExtensions.For{T}(in ComputeContext, int, int, in T)"/>,
/// <see cref="ComputeContextExtensions.ForEach{T, TPixel}(in ComputeContext, IReadWriteNormalizedTexture2D{TPixel})"/> or <see cref="ComputeContextExtensions.ForEach{T, TPixel}(in ComputeContext, IReadWriteNormalizedTexture2D{TPixel}, in T)"/>.
/// </remarks>
XY,
+2 -2
ファイルの表示
@@ -15,8 +15,8 @@ public interface IPixel<T, TPixel>
/// <returns>The <typeparamref name="TPixel"/> representation for the current value.</returns>
/// <remarks>
/// This method is primarily meant to be used to support
/// <see cref="ComputeContextExtensions.Fill{TPixel}(in ComputeContext, IReadWriteTexture2D{TPixel}, TPixel)"/>
/// and <see cref="ComputeContextExtensions.Fill{TPixel}(in ComputeContext, IReadWriteTexture3D{TPixel}, TPixel)"/>.
/// <see cref="ComputeContextExtensions.Fill{TPixel}(in ComputeContext, IReadWriteNormalizedTexture2D{TPixel}, TPixel)"/>
/// and <see cref="ComputeContextExtensions.Fill{TPixel}(in ComputeContext, IReadWriteNormalizedTexture3D{TPixel}, TPixel)"/>.
/// </remarks>
TPixel ToPixel();
}
+2 -2
ファイルの表示
@@ -75,7 +75,7 @@ public static partial class GraphicsDeviceExtensions
/// <typeparam name="TPixel">The type of pixels being processed by the shader.</typeparam>
/// <param name="device">The <see cref="GraphicsDevice"/> to use to run the shader.</param>
/// <param name="texture">The target texture to apply the pixel shader to.</param>
public static void ForEach<T, TPixel>(this GraphicsDevice device, IReadWriteTexture2D<TPixel> texture)
public static void ForEach<T, TPixel>(this GraphicsDevice device, IReadWriteNormalizedTexture2D<TPixel> texture)
where T : struct, IPixelShader<TPixel>
where TPixel : unmanaged
{
@@ -90,7 +90,7 @@ public static partial class GraphicsDeviceExtensions
/// <param name="device">The <see cref="GraphicsDevice"/> to use to run the shader.</param>
/// <param name="texture">The target texture to apply the pixel shader to.</param>
/// <param name="shader">The input <typeparamref name="T"/> instance representing the pixel shader to run.</param>
public static void ForEach<T, TPixel>(this GraphicsDevice device, IReadWriteTexture2D<TPixel> texture, in T shader)
public static void ForEach<T, TPixel>(this GraphicsDevice device, IReadWriteNormalizedTexture2D<TPixel> texture, in T shader)
where T : struct, IPixelShader<TPixel>
where TPixel : unmanaged
{
+8 -8
ファイルの表示
@@ -112,11 +112,11 @@ public static class GraphicsResourceHelper
/// Validates the given texture for usage with a specified device, and retrieves its GPU descriptor handle.
/// </summary>
/// <typeparam name="TPixel">The type of normalized values stored in the input texture.</typeparam>
/// <param name="texture">The input <see cref="IReadOnlyTexture2D{TPixel}"/> instance to check.</param>
/// <param name="texture">The input <see cref="IReadOnlyNormalizedTexture2D{TPixel}"/> instance to check.</param>
/// <param name="device">The target <see cref="GraphicsDevice"/> instance in use.</param>
/// <returns>The GPU descriptor handle for the texture.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static unsafe ulong ValidateAndGetGpuDescriptorHandle<TPixel>(IReadOnlyTexture2D<TPixel> texture, GraphicsDevice device)
public static unsafe ulong ValidateAndGetGpuDescriptorHandle<TPixel>(IReadOnlyNormalizedTexture2D<TPixel> texture, GraphicsDevice device)
where TPixel : unmanaged
{
if (texture is IGraphicsResource resource)
@@ -133,11 +133,11 @@ public static class GraphicsResourceHelper
/// Validates the given texture for usage with a specified device, and retrieves its GPU descriptor handle.
/// </summary>
/// <typeparam name="TPixel">The type of normalized values stored in the input texture.</typeparam>
/// <param name="texture">The input <see cref="IReadWriteTexture2D{TPixel}"/> instance to check.</param>
/// <param name="texture">The input <see cref="IReadWriteNormalizedTexture2D{TPixel}"/> instance to check.</param>
/// <param name="device">The target <see cref="GraphicsDevice"/> instance in use.</param>
/// <returns>The GPU descriptor handle for the texture.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static unsafe ulong ValidateAndGetGpuDescriptorHandle<TPixel>(IReadWriteTexture2D<TPixel> texture, GraphicsDevice device)
public static unsafe ulong ValidateAndGetGpuDescriptorHandle<TPixel>(IReadWriteNormalizedTexture2D<TPixel> texture, GraphicsDevice device)
where TPixel : unmanaged
{
if (texture is IGraphicsResource resource)
@@ -192,11 +192,11 @@ public static class GraphicsResourceHelper
/// Validates the given texture for usage with a specified device, and retrieves its GPU descriptor handle.
/// </summary>
/// <typeparam name="TPixel">The type of normalized values stored in the input texture.</typeparam>
/// <param name="texture">The input <see cref="IReadOnlyTexture3D{TPixel}"/> instance to check.</param>
/// <param name="texture">The input <see cref="IReadOnlyNormalizedTexture3D{TPixel}"/> instance to check.</param>
/// <param name="device">The target <see cref="GraphicsDevice"/> instance in use.</param>
/// <returns>The GPU descriptor handle for the texture.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static unsafe ulong ValidateAndGetGpuDescriptorHandle<TPixel>(IReadOnlyTexture3D<TPixel> texture, GraphicsDevice device)
public static unsafe ulong ValidateAndGetGpuDescriptorHandle<TPixel>(IReadOnlyNormalizedTexture3D<TPixel> texture, GraphicsDevice device)
where TPixel : unmanaged
{
if (texture is IGraphicsResource resource)
@@ -213,11 +213,11 @@ public static class GraphicsResourceHelper
/// Validates the given texture for usage with a specified device, and retrieves its GPU descriptor handle.
/// </summary>
/// <typeparam name="TPixel">The type of normalized values stored in the input texture.</typeparam>
/// <param name="texture">The input <see cref="IReadWriteTexture3D{TPixel}"/> instance to check.</param>
/// <param name="texture">The input <see cref="IReadWriteNormalizedTexture3D{TPixel}"/> instance to check.</param>
/// <param name="device">The target <see cref="GraphicsDevice"/> instance in use.</param>
/// <returns>The GPU descriptor handle for the texture.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static unsafe ulong ValidateAndGetGpuDescriptorHandle<TPixel>(IReadWriteTexture3D<TPixel> texture, GraphicsDevice device)
public static unsafe ulong ValidateAndGetGpuDescriptorHandle<TPixel>(IReadWriteNormalizedTexture3D<TPixel> texture, GraphicsDevice device)
where TPixel : unmanaged
{
if (texture is IGraphicsResource resource)
@@ -5,7 +5,7 @@
/// This interface can only be used to wrap <see cref="ReadOnlyTexture2D{T, TPixel}"/> instances.
/// </summary>
/// <typeparam name="TPixel">The type of normalized pixels used on the GPU side.</typeparam>
public interface IReadOnlyTexture2D<TPixel> : IGraphicsResource
public interface IReadOnlyNormalizedTexture2D<TPixel> : IGraphicsResource
where TPixel : unmanaged
{
/// <summary>
@@ -5,7 +5,7 @@
/// This interface can only be used to wrap <see cref="ReadOnlyTexture3D{T, TPixel}"/> instances.
/// </summary>
/// <typeparam name="TPixel">The type of normalized pixels used on the GPU side.</typeparam>
public interface IReadOnlyTexture3D<TPixel> : IGraphicsResource
public interface IReadOnlyNormalizedTexture3D<TPixel> : IGraphicsResource
where TPixel : unmanaged
{
/// <summary>
@@ -5,7 +5,7 @@
/// This interface can only be used to wrap <see cref="ReadWriteTexture2D{T, TPixel}"/> instances.
/// </summary>
/// <typeparam name="TPixel">The type of normalized pixels used on the GPU side.</typeparam>
public interface IReadWriteTexture2D<TPixel> : IGraphicsResource
public interface IReadWriteNormalizedTexture2D<TPixel> : IGraphicsResource
where TPixel : unmanaged
{
/// <summary>
@@ -5,7 +5,7 @@
/// This interface can only be used to wrap <see cref="ReadWriteTexture3D{T, TPixel}"/> instances.
/// </summary>
/// <typeparam name="TPixel">The type of normalized pixels used on the GPU side.</typeparam>
public interface IReadWriteTexture3D<TPixel> : IGraphicsResource
public interface IReadWriteNormalizedTexture3D<TPixel> : IGraphicsResource
where TPixel : unmanaged
{
/// <summary>
+1 -1
ファイルの表示
@@ -14,7 +14,7 @@ namespace ComputeSharp;
/// <typeparam name="TPixel">The type of pixels used on the GPU side.</typeparam>
[DebuggerTypeProxy(typeof(Texture2DDebugView<>))]
[DebuggerDisplay("{ToString(),raw}")]
public sealed class ReadOnlyTexture2D<T, TPixel> : Texture2D<T>, IReadOnlyTexture2D<TPixel>
public sealed class ReadOnlyTexture2D<T, TPixel> : Texture2D<T>, IReadOnlyNormalizedTexture2D<TPixel>
where T : unmanaged, IPixel<T, TPixel>
where TPixel : unmanaged
{
+1 -1
ファイルの表示
@@ -14,7 +14,7 @@ namespace ComputeSharp;
/// <typeparam name="TPixel">The type of pixels used on the GPU side.</typeparam>
[DebuggerTypeProxy(typeof(Texture3DDebugView<>))]
[DebuggerDisplay("{ToString(),raw}")]
public sealed class ReadOnlyTexture3D<T, TPixel> : Texture3D<T>, IReadOnlyTexture3D<TPixel>
public sealed class ReadOnlyTexture3D<T, TPixel> : Texture3D<T>, IReadOnlyNormalizedTexture3D<TPixel>
where T : unmanaged, IPixel<T, TPixel>
where TPixel : unmanaged
{
+4 -4
ファイルの表示
@@ -22,9 +22,9 @@ partial class ReadWriteTexture2D<T, TPixel>
private ReadOnly? readOnlyWrapper;
/// <summary>
/// Retrieves a wrapping <see cref="IReadOnlyTexture2D{TPixel}"/> instance for the current resource.
/// Retrieves a wrapping <see cref="IReadOnlyNormalizedTexture2D{TPixel}"/> instance for the current resource.
/// </summary>
/// <returns>An <see cref="IReadOnlyTexture2D{TPixel}"/> instance wrapping the current resource.</returns>
/// <returns>An <see cref="IReadOnlyNormalizedTexture2D{TPixel}"/> instance wrapping the current resource.</returns>
/// <remarks>
/// <para>The returned instance can be used in a shader to enable texture sampling.</para>
/// <para>
@@ -39,7 +39,7 @@ partial class ReadWriteTexture2D<T, TPixel>
/// </remarks>
/// <exception cref="ObjectDisposedException">Thrown if the current instance or its associated device are disposed.</exception>
/// <exception cref="InvalidOperationException">Thrown if the current instance is not in a readonly state.</exception>
public IReadOnlyTexture2D<TPixel> AsReadOnly()
public IReadOnlyNormalizedTexture2D<TPixel> AsReadOnly()
{
GraphicsDevice.ThrowIfDisposed();
@@ -76,7 +76,7 @@ partial class ReadWriteTexture2D<T, TPixel>
/// <summary>
/// A wrapper for a <see cref="ReadWriteTexture2D{T, TPixel}"/> resource that has been temporarily transitioned to readonly.
/// </summary>
private sealed unsafe class ReadOnly : NativeObject, IReadOnlyTexture2D<TPixel>, GraphicsResourceHelper.IGraphicsResource
private sealed unsafe class ReadOnly : NativeObject, IReadOnlyNormalizedTexture2D<TPixel>, GraphicsResourceHelper.IGraphicsResource
{
/// <summary>
/// The owning <see cref="ReadWriteTexture2D{T, TPixel}"/> instance being wrapped.
+1 -1
ファイルの表示
@@ -14,7 +14,7 @@ namespace ComputeSharp;
/// <typeparam name="TPixel">The type of pixels used on the GPU side.</typeparam>
[DebuggerTypeProxy(typeof(Texture2DDebugView<>))]
[DebuggerDisplay("{ToString(),raw}")]
public sealed partial class ReadWriteTexture2D<T, TPixel> : Texture2D<T>, IReadWriteTexture2D<TPixel>
public sealed partial class ReadWriteTexture2D<T, TPixel> : Texture2D<T>, IReadWriteNormalizedTexture2D<TPixel>
where T : unmanaged, IPixel<T, TPixel>
where TPixel : unmanaged
{
+4 -4
ファイルの表示
@@ -22,9 +22,9 @@ partial class ReadWriteTexture3D<T, TPixel>
private ReadOnly? readOnlyWrapper;
/// <summary>
/// Retrieves a wrapping <see cref="IReadOnlyTexture3D{TPixel}"/> instance for the current resource.
/// Retrieves a wrapping <see cref="IReadOnlyNormalizedTexture3D{TPixel}"/> instance for the current resource.
/// </summary>
/// <returns>An <see cref="IReadOnlyTexture3D{TPixel}"/> instance wrapping the current resource.</returns>
/// <returns>An <see cref="IReadOnlyNormalizedTexture3D{TPixel}"/> instance wrapping the current resource.</returns>
/// <remarks>
/// <para>The returned instance can be used in a shader to enable texture sampling.</para>
/// <para>
@@ -39,7 +39,7 @@ partial class ReadWriteTexture3D<T, TPixel>
/// </remarks>
/// <exception cref="ObjectDisposedException">Thrown if the current instance or its associated device are disposed.</exception>
/// <exception cref="InvalidOperationException">Thrown if the current instance is not in a readonly state.</exception>
public IReadOnlyTexture3D<TPixel> AsReadOnly()
public IReadOnlyNormalizedTexture3D<TPixel> AsReadOnly()
{
GraphicsDevice.ThrowIfDisposed();
@@ -73,7 +73,7 @@ partial class ReadWriteTexture3D<T, TPixel>
/// <summary>
/// A wrapper for a <see cref="ReadWriteTexture3D{T, TPixel}"/> resource that has been temporarily transitioned to readonly.
/// </summary>
private sealed unsafe class ReadOnly : NativeObject, IReadOnlyTexture3D<TPixel>, GraphicsResourceHelper.IGraphicsResource
private sealed unsafe class ReadOnly : NativeObject, IReadOnlyNormalizedTexture3D<TPixel>, GraphicsResourceHelper.IGraphicsResource
{
/// <summary>
/// The owning <see cref="ReadWriteTexture3D{T, TPixel}"/> instance being wrapped.
+1 -1
ファイルの表示
@@ -14,7 +14,7 @@ namespace ComputeSharp;
/// <typeparam name="TPixel">The type of pixels used on the GPU side.</typeparam>
[DebuggerTypeProxy(typeof(Texture3DDebugView<>))]
[DebuggerDisplay("{ToString(),raw}")]
public sealed partial class ReadWriteTexture3D<T, TPixel> : Texture3D<T>, IReadWriteTexture3D<TPixel>
public sealed partial class ReadWriteTexture3D<T, TPixel> : Texture3D<T>, IReadWriteNormalizedTexture3D<TPixel>
where T : unmanaged, IPixel<T, TPixel>
where TPixel : unmanaged
{
+1 -1
ファイルの表示
@@ -218,7 +218,7 @@ public struct ComputeContext : IDisposable, IAsyncDisposable
/// <typeparam name="TPixel">The type of pixel to work on.</typeparam>
/// <param name="texture">The target texture to invoke the pixel shader upon.</param>
/// <param name="shader">The input <typeparamref name="T"/> instance representing the pixel shader to run.</param>
internal readonly unsafe void Run<T, TPixel>(IReadWriteTexture2D<TPixel> texture, ref T shader)
internal readonly unsafe void Run<T, TPixel>(IReadWriteNormalizedTexture2D<TPixel> texture, ref T shader)
where T : struct, IPixelShader<TPixel>
where TPixel : unmanaged
{
+14 -14
ファイルの表示
@@ -81,8 +81,8 @@ public static class ComputeContextExtensions
/// </summary>
/// <typeparam name="TPixel">The type of pixels stored on the texture.</typeparam>
/// <param name="context">The <see cref="ComputeContext"/> to use to insert the resource barrier.</param>
/// <param name="texture">The input <see cref="IReadWriteTexture2D{TPixel}"/> instance to insert the barrier for.</param>
public static unsafe void Barrier<TPixel>(this in ComputeContext context, IReadWriteTexture2D<TPixel> texture)
/// <param name="texture">The input <see cref="IReadWriteNormalizedTexture2D{TPixel}"/> instance to insert the barrier for.</param>
public static unsafe void Barrier<TPixel>(this in ComputeContext context, IReadWriteNormalizedTexture2D<TPixel> texture)
where TPixel : unmanaged
{
context.Barrier(((GraphicsResourceHelper.IGraphicsResource)texture).ValidateAndGetID3D12Resource(context.GraphicsDevice));
@@ -93,8 +93,8 @@ public static class ComputeContextExtensions
/// </summary>
/// <typeparam name="TPixel">The type of pixels stored on the texture.</typeparam>
/// <param name="context">The <see cref="ComputeContext"/> to use to insert the resource barrier.</param>
/// <param name="texture">The input <see cref="IReadWriteTexture3D{TPixel}"/> instance to insert the barrier for.</param>
public static unsafe void Barrier<TPixel>(this in ComputeContext context, IReadWriteTexture3D<TPixel> texture)
/// <param name="texture">The input <see cref="IReadWriteNormalizedTexture3D{TPixel}"/> instance to insert the barrier for.</param>
public static unsafe void Barrier<TPixel>(this in ComputeContext context, IReadWriteNormalizedTexture3D<TPixel> texture)
where TPixel : unmanaged
{
context.Barrier(((GraphicsResourceHelper.IGraphicsResource)texture).ValidateAndGetID3D12Resource(context.GraphicsDevice));
@@ -179,8 +179,8 @@ public static class ComputeContextExtensions
/// </summary>
/// <typeparam name="TPixel">The type of pixels stored on the texture.</typeparam>
/// <param name="context">The <see cref="ComputeContext"/> to use to clear the resource.</param>
/// <param name="texture">The input <see cref="IReadWriteTexture2D{TPixel}"/> instance to clear.</param>
public static unsafe void Clear<TPixel>(this in ComputeContext context, IReadWriteTexture2D<TPixel> texture)
/// <param name="texture">The input <see cref="IReadWriteNormalizedTexture2D{TPixel}"/> instance to clear.</param>
public static unsafe void Clear<TPixel>(this in ComputeContext context, IReadWriteNormalizedTexture2D<TPixel> texture)
where TPixel : unmanaged
{
var handles = ((GraphicsResourceHelper.IGraphicsResource)texture).ValidateAndGetGpuAndCpuDescriptorHandlesForClear(context.GraphicsDevice, out _);
@@ -193,8 +193,8 @@ public static class ComputeContextExtensions
/// </summary>
/// <typeparam name="TPixel">The type of pixels stored on the texture.</typeparam>
/// <param name="context">The <see cref="ComputeContext"/> to use to clear the resource.</param>
/// <param name="texture">The input <see cref="IReadWriteTexture3D{TPixel}"/> instance to clear.</param>
public static unsafe void Clear<TPixel>(this in ComputeContext context, IReadWriteTexture3D<TPixel> texture)
/// <param name="texture">The input <see cref="IReadWriteNormalizedTexture3D{TPixel}"/> instance to clear.</param>
public static unsafe void Clear<TPixel>(this in ComputeContext context, IReadWriteNormalizedTexture3D<TPixel> texture)
where TPixel : unmanaged
{
var handles = ((GraphicsResourceHelper.IGraphicsResource)texture).ValidateAndGetGpuAndCpuDescriptorHandlesForClear(context.GraphicsDevice, out _);
@@ -241,9 +241,9 @@ public static class ComputeContextExtensions
/// </summary>
/// <typeparam name="TPixel">The type of pixels stored on the texture.</typeparam>
/// <param name="context">The <see cref="ComputeContext"/> to use to fill the resource.</param>
/// <param name="texture">The input <see cref="IReadWriteTexture2D{TPixel}"/> instance to fill.</param>
/// <param name="texture">The input <see cref="IReadWriteNormalizedTexture2D{TPixel}"/> instance to fill.</param>
/// <param name="value">The value to use to fill <paramref name="texture"/>.</param>
public static unsafe void Fill<TPixel>(this in ComputeContext context, IReadWriteTexture2D<TPixel> texture, TPixel value)
public static unsafe void Fill<TPixel>(this in ComputeContext context, IReadWriteNormalizedTexture2D<TPixel> texture, TPixel value)
where TPixel : unmanaged
{
var handles = ((GraphicsResourceHelper.IGraphicsResource)texture).ValidateAndGetGpuAndCpuDescriptorHandlesForClear(context.GraphicsDevice, out _);
@@ -260,9 +260,9 @@ public static class ComputeContextExtensions
/// </summary>
/// <typeparam name="TPixel">The type of pixels stored on the texture.</typeparam>
/// <param name="context">The <see cref="ComputeContext"/> to use to fill the resource.</param>
/// <param name="texture">The input <see cref="IReadWriteTexture3D{TPixel}"/> instance to fill.</param>
/// <param name="texture">The input <see cref="IReadWriteNormalizedTexture3D{TPixel}"/> instance to fill.</param>
/// <param name="value">The value to use to fill <paramref name="texture"/>.</param>
public static unsafe void Fill<TPixel>(this in ComputeContext context, IReadWriteTexture3D<TPixel> texture, TPixel value)
public static unsafe void Fill<TPixel>(this in ComputeContext context, IReadWriteNormalizedTexture3D<TPixel> texture, TPixel value)
where TPixel : unmanaged
{
var handles = ((GraphicsResourceHelper.IGraphicsResource)texture).ValidateAndGetGpuAndCpuDescriptorHandlesForClear(context.GraphicsDevice, out _);
@@ -341,7 +341,7 @@ public static class ComputeContextExtensions
/// <typeparam name="TPixel">The type of pixels being processed by the shader.</typeparam>
/// <param name="context">The <see cref="ComputeContext"/> to use to run the shader.</param>
/// <param name="texture">The target texture to apply the pixel shader to.</param>
public static void ForEach<T, TPixel>(this in ComputeContext context, IReadWriteTexture2D<TPixel> texture)
public static void ForEach<T, TPixel>(this in ComputeContext context, IReadWriteNormalizedTexture2D<TPixel> texture)
where T : struct, IPixelShader<TPixel>
where TPixel : unmanaged
{
@@ -356,7 +356,7 @@ public static class ComputeContextExtensions
/// <param name="context">The <see cref="ComputeContext"/> to use to run the shader.</param>
/// <param name="texture">The target texture to apply the pixel shader to.</param>
/// <param name="shader">The input <typeparamref name="T"/> instance representing the pixel shader to run.</param>
public static void ForEach<T, TPixel>(this in ComputeContext context, IReadWriteTexture2D<TPixel> texture, in T shader)
public static void ForEach<T, TPixel>(this in ComputeContext context, IReadWriteNormalizedTexture2D<TPixel> texture, in T shader)
where T : struct, IPixelShader<TPixel>
where TPixel : unmanaged
{
+1 -1
ファイルの表示
@@ -145,7 +145,7 @@ internal static class ShaderRunner<T>
/// <param name="device">The <see cref="GraphicsDevice"/> to use to run the shader.</param>
/// <param name="texture">The target texture to invoke the pixel shader upon.</param>
/// <param name="shader">The input <typeparamref name="T"/> instance representing the pixel shader to run.</param>
public static unsafe void Run<TPixel>(GraphicsDevice device, IReadWriteTexture2D<TPixel> texture, ref T shader)
public static unsafe void Run<TPixel>(GraphicsDevice device, IReadWriteNormalizedTexture2D<TPixel> texture, ref T shader)
where TPixel : unmanaged
{
device.ThrowIfDisposed();
+9 -9
ファイルの表示
@@ -283,7 +283,7 @@ public partial class ComputeContextTests
using (ComputeContext context = device.Get().CreateComputeContext())
{
context.Clear((IReadWriteTexture2D<TPixel>)texture);
context.Clear((IReadWriteNormalizedTexture2D<TPixel>)texture);
}
texture.CopyTo(array);
@@ -325,7 +325,7 @@ public partial class ComputeContextTests
using (ComputeContext context = device.Get().CreateComputeContext())
{
context.Clear((IReadWriteTexture3D<TPixel>)texture);
context.Clear((IReadWriteNormalizedTexture3D<TPixel>)texture);
}
texture.CopyTo(array);
@@ -491,7 +491,7 @@ public partial class ComputeContextTests
using (ComputeContext context = device.Get().CreateComputeContext())
{
context.Fill((IReadWriteTexture2D<TPixel>)texture, color.ToPixel());
context.Fill((IReadWriteNormalizedTexture2D<TPixel>)texture, color.ToPixel());
}
T[,] result = texture.ToArray();
@@ -531,7 +531,7 @@ public partial class ComputeContextTests
using (ComputeContext context = device.Get().CreateComputeContext())
{
context.Fill((IReadWriteTexture3D<TPixel>)texture, color.ToPixel());
context.Fill((IReadWriteNormalizedTexture3D<TPixel>)texture, color.ToPixel());
}
T[,,] result = texture.ToArray();
@@ -1203,7 +1203,7 @@ public partial class ComputeContextTests
[AutoConstructor]
internal readonly partial struct LinearSampling2DPixelShader : IPixelShader<float4>
{
public readonly IReadOnlyTexture2D<float4> source;
public readonly IReadOnlyNormalizedTexture2D<float4> source;
/// <inheritdoc/>
public float4 Execute()
@@ -1215,8 +1215,8 @@ public partial class ComputeContextTests
[AutoConstructor]
internal readonly partial struct LinearSampling3DComputeShader : IComputeShader
{
public readonly IReadOnlyTexture3D<float4> source;
public readonly IReadWriteTexture3D<float4> destination;
public readonly IReadOnlyNormalizedTexture3D<float4> source;
public readonly IReadWriteNormalizedTexture3D<float4> destination;
/// <inheritdoc/>
public void Execute()
@@ -1228,7 +1228,7 @@ public partial class ComputeContextTests
[AutoConstructor]
internal readonly partial struct Dotted2DPixelShader : IComputeShader
{
public readonly IReadWriteTexture2D<float4> source;
public readonly IReadWriteNormalizedTexture2D<float4> source;
/// <inheritdoc/>
public void Execute()
@@ -1256,7 +1256,7 @@ public partial class ComputeContextTests
[AutoConstructor]
internal readonly partial struct Dotted3DPixelShader : IComputeShader
{
public readonly IReadWriteTexture3D<float4> source;
public readonly IReadWriteNormalizedTexture3D<float4> source;
/// <inheritdoc/>
public void Execute()
+1 -1
ファイルの表示
@@ -12,7 +12,7 @@ internal readonly partial struct ColorfulInfinity : IComputeShader
/// <summary>
/// The target texture.
/// </summary>
public readonly IReadWriteTexture2D<float4> texture;
public readonly IReadWriteNormalizedTexture2D<float4> texture;
/// <summary>
/// The current time since the start of the application.
+2 -2
ファイルの表示
@@ -11,7 +11,7 @@ internal readonly partial struct ContouredLayers : IComputeShader
/// <summary>
/// The target texture.
/// </summary>
public readonly IReadWriteTexture2D<float4> destination;
public readonly IReadWriteNormalizedTexture2D<float4> destination;
/// <summary>
/// The current time Hlsl.Since the start of the application.
@@ -21,7 +21,7 @@ internal readonly partial struct ContouredLayers : IComputeShader
/// <summary>
/// The sampling texture.
/// </summary>
public readonly IReadOnlyTexture2D<float4> texture;
public readonly IReadOnlyNormalizedTexture2D<float4> texture;
// float3 to float hash.
private static float Hash21(float2 p)
+1 -1
ファイルの表示
@@ -11,7 +11,7 @@ internal readonly partial struct ExtrudedTruchetPattern : IComputeShader
/// <summary>
/// The target texture.
/// </summary>
public readonly IReadWriteTexture2D<float4> texture;
public readonly IReadWriteNormalizedTexture2D<float4> texture;
/// <summary>
/// The current time since the start of the application.
+1 -1
ファイルの表示
@@ -12,7 +12,7 @@ internal readonly partial struct FourColorGradient : IComputeShader
/// <summary>
/// The target texture.
/// </summary>
public readonly IReadWriteTexture2D<float4> texture;
public readonly IReadWriteNormalizedTexture2D<float4> texture;
/// <summary>
/// The current time since the start of the application.
+1 -1
ファイルの表示
@@ -12,7 +12,7 @@ internal readonly partial struct FractalTiling : IComputeShader
/// <summary>
/// The target texture.
/// </summary>
public readonly IReadWriteTexture2D<float4> texture;
public readonly IReadWriteNormalizedTexture2D<float4> texture;
/// <summary>
/// The current time since the start of the application.
+1 -1
ファイルの表示
@@ -11,7 +11,7 @@ internal readonly partial struct MengerJourney : IComputeShader
/// <summary>
/// The target texture.
/// </summary>
public readonly IReadWriteTexture2D<float4> texture;
public readonly IReadWriteNormalizedTexture2D<float4> texture;
/// <summary>
/// The current time since the start of the application.
+1 -1
ファイルの表示
@@ -11,7 +11,7 @@ internal readonly partial struct Octagrams : IComputeShader
/// <summary>
/// The target texture.
/// </summary>
public readonly IReadWriteTexture2D<float4> texture;
public readonly IReadWriteNormalizedTexture2D<float4> texture;
/// <summary>
/// The current time since the start of the application.
+1 -1
ファイルの表示
@@ -12,7 +12,7 @@ internal readonly partial struct ProteanClouds : IComputeShader
/// <summary>
/// The target texture.
/// </summary>
public readonly IReadWriteTexture2D<float4> texture;
public readonly IReadWriteNormalizedTexture2D<float4> texture;
/// <summary>
/// The current time Hlsl.Since the start of the application.
+1 -1
ファイルの表示
@@ -12,7 +12,7 @@ internal readonly partial struct PyramidPattern : IComputeShader
/// <summary>
/// The target texture.
/// </summary>
public readonly IReadWriteTexture2D<float4> texture;
public readonly IReadWriteNormalizedTexture2D<float4> texture;
/// <summary>
/// The current time Hlsl.Since the start of the application.
+1 -1
ファイルの表示
@@ -11,7 +11,7 @@ internal readonly partial struct TriangleGridContouring : IComputeShader
/// <summary>
/// The target texture.
/// </summary>
public readonly IReadWriteTexture2D<float4> texture;
public readonly IReadWriteNormalizedTexture2D<float4> texture;
/// <summary>
/// The current time Hlsl.Since the start of the application.
+1 -1
ファイルの表示
@@ -11,7 +11,7 @@ internal readonly partial struct TwoTiledTruchet : IComputeShader
/// <summary>
/// The target texture.
/// </summary>
public readonly IReadWriteTexture2D<float4> texture;
public readonly IReadWriteNormalizedTexture2D<float4> texture;
/// <summary>
/// The current time since the start of the application.
+5 -5
ファイルの表示
@@ -74,8 +74,8 @@ public partial class Texture2DTests
[AutoConstructor]
public readonly partial struct SamplingComputeShader : IComputeShader
{
public readonly IReadOnlyTexture2D<float4> source;
public readonly IReadWriteTexture2D<float4> destination;
public readonly IReadOnlyNormalizedTexture2D<float4> source;
public readonly IReadWriteNormalizedTexture2D<float4> destination;
public void Execute()
{
@@ -107,7 +107,7 @@ public partial class Texture2DTests
[AutoConstructor]
public readonly partial struct SamplingPixelShader : IPixelShader<float4>
{
public readonly IReadOnlyTexture2D<float4> texture;
public readonly IReadOnlyNormalizedTexture2D<float4> texture;
public float4 Execute()
{
@@ -136,11 +136,11 @@ public partial class Texture2DTests
{
context.Transition(texture, ResourceState.ReadOnly);
IReadOnlyTexture2D<TPixel> wrapper1 = texture.AsReadOnly();
IReadOnlyNormalizedTexture2D<TPixel> wrapper1 = texture.AsReadOnly();
Assert.IsNotNull(wrapper1);
IReadOnlyTexture2D<TPixel> wrapper2 = texture.AsReadOnly();
IReadOnlyNormalizedTexture2D<TPixel> wrapper2 = texture.AsReadOnly();
Assert.IsNotNull(wrapper2);
Assert.AreSame(wrapper1, wrapper2);
+2 -2
ファイルの表示
@@ -69,11 +69,11 @@ public partial class Texture3DTests
{
context.Transition(texture, ResourceState.ReadOnly);
IReadOnlyTexture3D<TPixel> wrapper1 = texture.AsReadOnly();
IReadOnlyNormalizedTexture3D<TPixel> wrapper1 = texture.AsReadOnly();
Assert.IsNotNull(wrapper1);
IReadOnlyTexture3D<TPixel> wrapper2 = texture.AsReadOnly();
IReadOnlyNormalizedTexture3D<TPixel> wrapper2 = texture.AsReadOnly();
Assert.IsNotNull(wrapper2);
Assert.AreSame(wrapper1, wrapper2);