Added unorm texture interface types

このコミットが含まれているのは:
Sergio Pedri committed 2021-01-06 16:09:36 +01:00
1 親 a126052185
コミット c2f6e81e76
8ファイル変更
+118 -50

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

+26
ファイルの表示
@@ -0,0 +1,26 @@
namespace ComputeSharp
{
/// <summary>
/// An interface representing a typed readonly 2D texture containing normalized pixel data stored on GPU memory.
/// 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>
where TPixel : unmanaged
{
/// <summary>
/// Gets a single <typeparamref name="TPixel"/> value from the current readonly texture.
/// </summary>
/// <param name="x">The horizontal offset of the value to get.</param>
/// <param name="y">The vertical offset of the value to get.</param>
/// <remarks>This API can only be used from a compute shader, and will always throw if used anywhere else.</remarks>
public TPixel this[int x, int y] { get; }
/// <summary>
/// Gets a single <typeparamref name="TPixel"/> value from the current readonly texture.
/// </summary>
/// <param name="xy">The coordinates of the value to get.</param>
/// <remarks>This API can only be used from a compute shader, and will always throw if used anywhere else.</remarks>
public TPixel this[Int2 xy] { get; }
}
}
+27
ファイルの表示
@@ -0,0 +1,27 @@
namespace ComputeSharp
{
/// <summary>
/// An interface representing a typed readonly 3D texture containing normalized pixel data stored on GPU memory.
/// 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>
where TPixel : unmanaged
{
/// <summary>
/// Gets a single <typeparamref name="TPixel"/> value from the current readonly texture.
/// </summary>
/// <param name="x">The horizontal offset of the value to get.</param>
/// <param name="y">The vertical offset of the value to get.</param>
/// <param name="y">The depthwise offset of the value to get.</param>
/// <remarks>This API can only be used from a compute shader, and will always throw if used anywhere else.</remarks>
public TPixel this[int x, int y, int z] { get; }
/// <summary>
/// Gets a single <typeparamref name="TPixel"/> value from the current readonly texture.
/// </summary>
/// <param name="xyz">The coordinates of the value to get.</param>
/// <remarks>This API can only be used from a compute shader, and will always throw if used anywhere else.</remarks>
public TPixel this[Int3 xyz] { get; }
}
}
+26
ファイルの表示
@@ -0,0 +1,26 @@
namespace ComputeSharp
{
/// <summary>
/// An interface representing a typed writeable 2D texture containing normalized pixel data stored on GPU memory.
/// 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>
where TPixel : unmanaged
{
/// <summary>
/// Gets a single <typeparamref name="TPixel"/> value from the current writeable texture.
/// </summary>
/// <param name="x">The horizontal offset of the value to get.</param>
/// <param name="y">The vertical offset of the value to get.</param>
/// <remarks>This API can only be used from a compute shader, and will always throw if used anywhere else.</remarks>
public ref TPixel this[int x, int y] { get; }
/// <summary>
/// Gets or sets a single <typeparamref name="TPixel"/> value from the current writeable texture.
/// </summary>
/// <param name="xy">The coordinates of the value to get.</param>
/// <remarks>This API can only be used from a compute shader, and will always throw if used anywhere else.</remarks>
public ref TPixel this[Int2 xy] { get; }
}
}
+27
ファイルの表示
@@ -0,0 +1,27 @@
namespace ComputeSharp
{
/// <summary>
/// An interface representing a typed writeable 2D texture containing normalized pixel data stored on GPU memory.
/// 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>
where TPixel : unmanaged
{
/// <summary>
/// Gets a single <typeparamref name="TPixel"/> value from the current writeable texture.
/// </summary>
/// <param name="x">The horizontal offset of the value to get.</param>
/// <param name="y">The vertical offset of the value to get.</param>
/// <param name="z">The depthwise offset of the value to get.</param>
/// <remarks>This API can only be used from a compute shader, and will always throw if used anywhere else.</remarks>
public ref TPixel this[int x, int y, int z] { get; }
/// <summary>
/// Gets a single <typeparamref name="TPixel"/> value from the current writeable texture.
/// </summary>
/// <param name="xyz">The coordinates of the value to get.</param>
/// <remarks>This API can only be used from a compute shader, and will always throw if used anywhere else.</remarks>
public ref TPixel this[Int3 xyz] { get; }
}
}
+3 -12
ファイルの表示
@@ -16,7 +16,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>
public sealed class ReadOnlyTexture2D<T, TPixel> : Texture2D<T>, IReadOnlyTexture2D<TPixel>
where T : unmanaged, IUnorm<TPixel>
where TPixel : unmanaged
{
@@ -31,19 +31,10 @@ namespace ComputeSharp
{
}
/// <summary>
/// Gets a single <typeparamref name="TPixel"/> value from the current readonly texture.
/// </summary>
/// <param name="x">The horizontal offset of the value to get.</param>
/// <param name="y">The vertical offset of the value to get.</param>
/// <remarks>This API can only be used from a compute shader, and will always throw if used anywhere else.</remarks>
/// <inheritdoc/>
public TPixel this[int x, int y] => throw new InvalidExecutionContextException($"{nameof(ReadOnlyTexture2D<T, TPixel>)}<T>[int,int]");
/// <summary>
/// Gets a single <typeparamref name="TPixel"/> value from the current readonly texture.
/// </summary>
/// <param name="xy">The coordinates of the value to get.</param>
/// <remarks>This API can only be used from a compute shader, and will always throw if used anywhere else.</remarks>
/// <inheritdoc/>
public TPixel this[Int2 xy] => throw new InvalidExecutionContextException($"{nameof(ReadOnlyTexture2D<T,TPixel>)}<T>[Int2]");
/// <inheritdoc/>
+3 -13
ファイルの表示
@@ -16,7 +16,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>
public sealed class ReadOnlyTexture3D<T, TPixel> : Texture3D<T>, IReadOnlyTexture3D<TPixel>
where T : unmanaged, IUnorm<TPixel>
where TPixel : unmanaged
{
@@ -32,20 +32,10 @@ namespace ComputeSharp
{
}
/// <summary>
/// Gets a single <typeparamref name="TPixel"/> value from the current readonly texture.
/// </summary>
/// <param name="x">The horizontal offset of the value to get.</param>
/// <param name="y">The vertical offset of the value to get.</param>
/// <param name="y">The depthwise offset of the value to get.</param>
/// <remarks>This API can only be used from a compute shader, and will always throw if used anywhere else.</remarks>
/// <inheritdoc/>
public TPixel this[int x, int y, int z] => throw new InvalidExecutionContextException($"{nameof(ReadOnlyTexture3D<T, TPixel>)}<T>[int,int,int]");
/// <summary>
/// Gets a single <typeparamref name="TPixel"/> value from the current readonly texture.
/// </summary>
/// <param name="xyz">The coordinates of the value to get.</param>
/// <remarks>This API can only be used from a compute shader, and will always throw if used anywhere else.</remarks>
/// <inheritdoc/>
public TPixel this[Int3 xyz] => throw new InvalidExecutionContextException($"{nameof(ReadOnlyTexture3D<T, TPixel>)}<T>[Int3]");
/// <inheritdoc/>
+3 -12
ファイルの表示
@@ -16,7 +16,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 ReadWriteTexture2D<T, TPixel> : Texture2D<T>
public sealed class ReadWriteTexture2D<T, TPixel> : Texture2D<T>, IReadWriteTexture2D<TPixel>
where T : unmanaged, IUnorm<TPixel>
where TPixel : unmanaged
{
@@ -31,19 +31,10 @@ namespace ComputeSharp
{
}
/// <summary>
/// Gets a single <typeparamref name="TPixel"/> value from the current writeable texture.
/// </summary>
/// <param name="x">The horizontal offset of the value to get.</param>
/// <param name="y">The vertical offset of the value to get.</param>
/// <remarks>This API can only be used from a compute shader, and will always throw if used anywhere else.</remarks>
/// <inheritdoc/>
public ref TPixel this[int x, int y] => throw new InvalidExecutionContextException($"{nameof(ReadWriteTexture2D<T, TPixel>)}<T>[int,int]");
/// <summary>
/// Gets or sets a single <typeparamref name="TPixel"/> value from the current writeable texture.
/// </summary>
/// <param name="xy">The coordinates of the value to get.</param>
/// <remarks>This API can only be used from a compute shader, and will always throw if used anywhere else.</remarks>
/// <inheritdoc/>
public ref TPixel this[Int2 xy] => throw new InvalidExecutionContextException($"{nameof(ReadWriteTexture2D<T, TPixel>)}<T>[Int2]");
/// <inheritdoc/>
+3 -13
ファイルの表示
@@ -16,7 +16,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 ReadWriteTexture3D<T, TPixel> : Texture3D<T>
public sealed class ReadWriteTexture3D<T, TPixel> : Texture3D<T>, IReadWriteTexture3D<TPixel>
where T : unmanaged, IUnorm<TPixel>
where TPixel : unmanaged
{
@@ -32,20 +32,10 @@ namespace ComputeSharp
{
}
/// <summary>
/// Gets a single <typeparamref name="TPixel"/> value from the current writeable texture.
/// </summary>
/// <param name="x">The horizontal offset of the value to get.</param>
/// <param name="y">The vertical offset of the value to get.</param>
/// <param name="z">The depthwise offset of the value to get.</param>
/// <remarks>This API can only be used from a compute shader, and will always throw if used anywhere else.</remarks>
/// <inheritdoc/>
public ref TPixel this[int x, int y, int z] => throw new InvalidExecutionContextException($"{nameof(ReadWriteTexture3D<T, TPixel>)}<T>[int,int,int]");
/// <summary>
/// Gets a single <typeparamref name="TPixel"/> value from the current writeable texture.
/// </summary>
/// <param name="xyz">The coordinates of the value to get.</param>
/// <remarks>This API can only be used from a compute shader, and will always throw if used anywhere else.</remarks>
/// <inheritdoc/>
public ref TPixel this[Int3 xyz] => throw new InvalidExecutionContextException($"{nameof(ReadWriteTexture3D<T, TPixel>)}<T>[Int3]");
/// <inheritdoc/>