Removed unorm Double[N] options

このコミットが含まれているのは:
Sergio Pedri committed 2021-01-05 13:48:37 +01:00
1 親 9e0b7404b1
コミット 763f7e61f4
11ファイル変更
+14 -182

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

+1 -1
ファイルの表示
@@ -18,7 +18,7 @@ namespace ComputeSharp
/// </summary>
/// <remarks>This struct is fully mutable.</remarks>
[StructLayout(LayoutKind.Sequential)]
public struct Bgra32 : IEquatable<Bgra32>, IUnorm<Vector4>, IUnorm<Float4>, IUnorm<Double4>
public struct Bgra32 : IEquatable<Bgra32>, IUnorm<Vector4>, IUnorm<Float4>
{
/// <summary>
/// The blue component.
+1 -1
ファイルの表示
@@ -14,7 +14,7 @@ namespace ComputeSharp
/// </para>
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public struct R16 : IEquatable<R16>, IUnorm<float>, IUnorm<double>
public struct R16 : IEquatable<R16>, IUnorm<float>
{
/// <summary>
/// The red component.
+1 -1
ファイルの表示
@@ -14,7 +14,7 @@ namespace ComputeSharp
/// </para>
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public struct R8 : IEquatable<R8>, IUnorm<float>, IUnorm<double>
public struct R8 : IEquatable<R8>, IUnorm<float>
{
/// <summary>
/// The red component.
+1 -1
ファイルの表示
@@ -15,7 +15,7 @@ namespace ComputeSharp
/// </para>
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public struct Rg16 : IEquatable<Rg16>, IUnorm<Vector2>, IUnorm<Float2>, IUnorm<Double2>
public struct Rg16 : IEquatable<Rg16>, IUnorm<Vector2>, IUnorm<Float2>
{
/// <summary>
/// The red component.
+1 -1
ファイルの表示
@@ -15,7 +15,7 @@ namespace ComputeSharp
/// </para>
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public struct Rg32 : IEquatable<Rg32>, IUnorm<Vector2>, IUnorm<Float2>, IUnorm<Double2>
public struct Rg32 : IEquatable<Rg32>, IUnorm<Vector2>, IUnorm<Float2>
{
/// <summary>
/// The red component.
+1 -1
ファイルの表示
@@ -17,7 +17,7 @@ namespace ComputeSharp
/// </summary>
/// <remarks>This struct is fully mutable.</remarks>
[StructLayout(LayoutKind.Sequential)]
public struct Rgba32 : IEquatable<Rgba32>, IUnorm<Vector4>, IUnorm<Float4>, IUnorm<Double4>
public struct Rgba32 : IEquatable<Rgba32>, IUnorm<Vector4>, IUnorm<Float4>
{
/// <summary>
/// The red component.
+1 -1
ファイルの表示
@@ -17,7 +17,7 @@ namespace ComputeSharp
/// </summary>
/// <remarks>This struct is fully mutable.</remarks>
[StructLayout(LayoutKind.Sequential)]
public struct Rgba64 : IEquatable<Rgba64>, IUnorm<Vector4>, IUnorm<Float4>, IUnorm<Double4>
public struct Rgba64 : IEquatable<Rgba64>, IUnorm<Vector4>, IUnorm<Float4>
{
/// <summary>
/// The red component.
-14
ファイルの表示
@@ -15,42 +15,28 @@ namespace ComputeSharp.Tests
[TestMethod]
[DataRow(typeof(ReadOnlyTexture2D<,>), typeof(Bgra32), typeof(Vector4))]
[DataRow(typeof(ReadOnlyTexture2D<,>), typeof(Bgra32), typeof(Float4))]
[DataRow(typeof(ReadOnlyTexture2D<,>), typeof(Bgra32), typeof(Double4))]
[DataRow(typeof(ReadOnlyTexture2D<,>), typeof(R16), typeof(float))]
[DataRow(typeof(ReadOnlyTexture2D<,>), typeof(R16), typeof(double))]
[DataRow(typeof(ReadOnlyTexture2D<,>), typeof(R8), typeof(float))]
[DataRow(typeof(ReadOnlyTexture2D<,>), typeof(R8), typeof(double))]
[DataRow(typeof(ReadOnlyTexture2D<,>), typeof(Rg16), typeof(Vector2))]
[DataRow(typeof(ReadOnlyTexture2D<,>), typeof(Rg16), typeof(Float2))]
[DataRow(typeof(ReadOnlyTexture2D<,>), typeof(Rg16), typeof(Double2))]
[DataRow(typeof(ReadOnlyTexture2D<,>), typeof(Rg32), typeof(Vector2))]
[DataRow(typeof(ReadOnlyTexture2D<,>), typeof(Rg32), typeof(Float2))]
[DataRow(typeof(ReadOnlyTexture2D<,>), typeof(Rg32), typeof(Double2))]
[DataRow(typeof(ReadOnlyTexture2D<,>), typeof(Rgba32), typeof(Vector4))]
[DataRow(typeof(ReadOnlyTexture2D<,>), typeof(Rgba32), typeof(Float4))]
[DataRow(typeof(ReadOnlyTexture2D<,>), typeof(Rgba32), typeof(Double4))]
[DataRow(typeof(ReadOnlyTexture2D<,>), typeof(Rgba64), typeof(Vector4))]
[DataRow(typeof(ReadOnlyTexture2D<,>), typeof(Rgba64), typeof(Float4))]
[DataRow(typeof(ReadOnlyTexture2D<,>), typeof(Rgba64), typeof(Double4))]
[DataRow(typeof(ReadWriteTexture2D<,>), typeof(Bgra32), typeof(Vector4))]
[DataRow(typeof(ReadWriteTexture2D<,>), typeof(Bgra32), typeof(Float4))]
[DataRow(typeof(ReadWriteTexture2D<,>), typeof(Bgra32), typeof(Double4))]
[DataRow(typeof(ReadWriteTexture2D<,>), typeof(R16), typeof(float))]
[DataRow(typeof(ReadWriteTexture2D<,>), typeof(R16), typeof(double))]
[DataRow(typeof(ReadWriteTexture2D<,>), typeof(R8), typeof(float))]
[DataRow(typeof(ReadWriteTexture2D<,>), typeof(R8), typeof(double))]
[DataRow(typeof(ReadWriteTexture2D<,>), typeof(Rg16), typeof(Vector2))]
[DataRow(typeof(ReadWriteTexture2D<,>), typeof(Rg16), typeof(Float2))]
[DataRow(typeof(ReadWriteTexture2D<,>), typeof(Rg16), typeof(Double2))]
[DataRow(typeof(ReadWriteTexture2D<,>), typeof(Rg32), typeof(Vector2))]
[DataRow(typeof(ReadWriteTexture2D<,>), typeof(Rg32), typeof(Float2))]
[DataRow(typeof(ReadWriteTexture2D<,>), typeof(Rg32), typeof(Double2))]
[DataRow(typeof(ReadWriteTexture2D<,>), typeof(Rgba32), typeof(Vector4))]
[DataRow(typeof(ReadWriteTexture2D<,>), typeof(Rgba32), typeof(Float4))]
[DataRow(typeof(ReadWriteTexture2D<,>), typeof(Rgba32), typeof(Double4))]
[DataRow(typeof(ReadWriteTexture2D<,>), typeof(Rgba64), typeof(Vector4))]
[DataRow(typeof(ReadWriteTexture2D<,>), typeof(Rgba64), typeof(Float4))]
[DataRow(typeof(ReadWriteTexture2D<,>), typeof(Rgba64), typeof(Double4))]
public void Allocate_Uninitialized_Pixel_Ok(Type textureType, Type t, Type tPixel)
{
static void Test<T, TPixel>(Type textureType)
-140
ファイルの表示
@@ -9,23 +9,16 @@ namespace ComputeSharp.Tests
[TestMethod]
[DataRow(typeof(Bgra32), typeof(Vector4))]
[DataRow(typeof(Bgra32), typeof(Float4))]
[DataRow(typeof(Bgra32), typeof(Double4))]
[DataRow(typeof(R16), typeof(float))]
[DataRow(typeof(R16), typeof(double))]
[DataRow(typeof(R8), typeof(float))]
[DataRow(typeof(R8), typeof(double))]
[DataRow(typeof(Rg16), typeof(Vector2))]
[DataRow(typeof(Rg16), typeof(Float2))]
[DataRow(typeof(Rg16), typeof(Double2))]
[DataRow(typeof(Rg32), typeof(Vector2))]
[DataRow(typeof(Rg32), typeof(Float2))]
[DataRow(typeof(Rg32), typeof(Double2))]
[DataRow(typeof(Rgba32), typeof(Vector4))]
[DataRow(typeof(Rgba32), typeof(Float4))]
[DataRow(typeof(Rgba32), typeof(Double4))]
[DataRow(typeof(Rgba64), typeof(Vector4))]
[DataRow(typeof(Rgba64), typeof(Float4))]
[DataRow(typeof(Rgba64), typeof(Double4))]
public void Dispatch_NormalizedTexture2D(Type t, Type tPixel)
{
if (t == typeof(Bgra32) && tPixel == typeof(Vector4))
@@ -42,13 +35,6 @@ namespace ComputeSharp.Tests
Gpu.Default.For(128, 128, new Shader_Unorm_Bgra32_Float4(source, destination));
}
if (t == typeof(Bgra32) && tPixel == typeof(Double4))
{
using ReadOnlyTexture2D<Bgra32, Double4> source = Gpu.Default.AllocateReadOnlyTexture2D<Bgra32, Double4>(128, 128);
using ReadWriteTexture2D<Bgra32, Double4> destination = Gpu.Default.AllocateReadWriteTexture2D<Bgra32, Double4>(128, 128);
Gpu.Default.For(128, 128, new Shader_Unorm_Bgra32_Double4(source, destination));
}
if (t == typeof(R16) && tPixel == typeof(float))
{
using ReadOnlyTexture2D<R16, float> source = Gpu.Default.AllocateReadOnlyTexture2D<R16, float>(128, 128);
@@ -56,13 +42,6 @@ namespace ComputeSharp.Tests
Gpu.Default.For(128, 128, new Shader_Unorm_R16_float(source, destination));
}
if (t == typeof(R16) && tPixel == typeof(double))
{
using ReadOnlyTexture2D<R16, double> source = Gpu.Default.AllocateReadOnlyTexture2D<R16, double>(128, 128);
using ReadWriteTexture2D<R16, double> destination = Gpu.Default.AllocateReadWriteTexture2D<R16, double>(128, 128);
Gpu.Default.For(128, 128, new Shader_Unorm_R16_double(source, destination));
}
if (t == typeof(R8) && tPixel == typeof(float))
{
using ReadOnlyTexture2D<R8, float> source = Gpu.Default.AllocateReadOnlyTexture2D<R8, float>(128, 128);
@@ -70,13 +49,6 @@ namespace ComputeSharp.Tests
Gpu.Default.For(128, 128, new Shader_Unorm_R8_float(source, destination));
}
if (t == typeof(R8) && tPixel == typeof(double))
{
using ReadOnlyTexture2D<R8, double> source = Gpu.Default.AllocateReadOnlyTexture2D<R8, double>(128, 128);
using ReadWriteTexture2D<R8, double> destination = Gpu.Default.AllocateReadWriteTexture2D<R8, double>(128, 128);
Gpu.Default.For(128, 128, new Shader_Unorm_R8_double(source, destination));
}
if (t == typeof(Rg16) && tPixel == typeof(Vector2))
{
using ReadOnlyTexture2D<Rg16, Vector2> source = Gpu.Default.AllocateReadOnlyTexture2D<Rg16, Vector2>(128, 128);
@@ -91,13 +63,6 @@ namespace ComputeSharp.Tests
Gpu.Default.For(128, 128, new Shader_Unorm_Rg16_Float2(source, destination));
}
if (t == typeof(Rg16) && tPixel == typeof(Double2))
{
using ReadOnlyTexture2D<Rg16, Double2> source = Gpu.Default.AllocateReadOnlyTexture2D<Rg16, Double2>(128, 128);
using ReadWriteTexture2D<Rg16, Double2> destination = Gpu.Default.AllocateReadWriteTexture2D<Rg16, Double2>(128, 128);
Gpu.Default.For(128, 128, new Shader_Unorm_Rg16_Double2(source, destination));
}
if (t == typeof(Rg32) && tPixel == typeof(Vector2))
{
using ReadOnlyTexture2D<Rg32, Vector2> source = Gpu.Default.AllocateReadOnlyTexture2D<Rg32, Vector2>(128, 128);
@@ -112,13 +77,6 @@ namespace ComputeSharp.Tests
Gpu.Default.For(128, 128, new Shader_Unorm_Rg32_Float2(source, destination));
}
if (t == typeof(Rg32) && tPixel == typeof(Double2))
{
using ReadOnlyTexture2D<Rg32, Double2> source = Gpu.Default.AllocateReadOnlyTexture2D<Rg32, Double2>(128, 128);
using ReadWriteTexture2D<Rg32, Double2> destination = Gpu.Default.AllocateReadWriteTexture2D<Rg32, Double2>(128, 128);
Gpu.Default.For(128, 128, new Shader_Unorm_Rg32_Double2(source, destination));
}
if (t == typeof(Rgba32) && tPixel == typeof(Vector4))
{
using ReadOnlyTexture2D<Rgba32, Vector4> source = Gpu.Default.AllocateReadOnlyTexture2D<Rgba32, Vector4>(128, 128);
@@ -133,13 +91,6 @@ namespace ComputeSharp.Tests
Gpu.Default.For(128, 128, new Shader_Unorm_Rgba32_Float4(source, destination));
}
if (t == typeof(Rgba32) && tPixel == typeof(Double4))
{
using ReadOnlyTexture2D<Rgba32, Double4> source = Gpu.Default.AllocateReadOnlyTexture2D<Rgba32, Double4>(128, 128);
using ReadWriteTexture2D<Rgba32, Double4> destination = Gpu.Default.AllocateReadWriteTexture2D<Rgba32, Double4>(128, 128);
Gpu.Default.For(128, 128, new Shader_Unorm_Rgba32_Double4(source, destination));
}
if (t == typeof(Rgba64) && tPixel == typeof(Vector4))
{
using ReadOnlyTexture2D<Rgba64, Vector4> source = Gpu.Default.AllocateReadOnlyTexture2D<Rgba64, Vector4>(128, 128);
@@ -154,13 +105,6 @@ namespace ComputeSharp.Tests
Gpu.Default.For(128, 128, new Shader_Unorm_Rgba64_Float4(source, destination));
}
if (t == typeof(Rgba64) && tPixel == typeof(Double4))
{
using ReadOnlyTexture2D<Rgba64, Double4> source = Gpu.Default.AllocateReadOnlyTexture2D<Rgba64, Double4>(128, 128);
using ReadWriteTexture2D<Rgba64, Double4> destination = Gpu.Default.AllocateReadWriteTexture2D<Rgba64, Double4>(128, 128);
Gpu.Default.For(128, 128, new Shader_Unorm_Rgba64_Double4(source, destination));
}
}
[AutoConstructor]
@@ -187,18 +131,6 @@ namespace ComputeSharp.Tests
}
}
[AutoConstructor]
internal readonly partial struct Shader_Unorm_Bgra32_Double4 : IComputeShader
{
public readonly ReadOnlyTexture2D<Bgra32, Double4> source;
public readonly ReadWriteTexture2D<Bgra32, Double4> destination;
public void Execute(ThreadIds ids)
{
destination[ids.XY] = (source[ids.XY] + destination[ids.XY]) / 2;
}
}
[AutoConstructor]
internal readonly partial struct Shader_Unorm_R16_float : IComputeShader
{
@@ -211,18 +143,6 @@ namespace ComputeSharp.Tests
}
}
[AutoConstructor]
internal readonly partial struct Shader_Unorm_R16_double : IComputeShader
{
public readonly ReadOnlyTexture2D<R16, double> source;
public readonly ReadWriteTexture2D<R16, double> destination;
public void Execute(ThreadIds ids)
{
destination[ids.XY] = (source[ids.XY] + destination[ids.XY]) / 2;
}
}
[AutoConstructor]
internal readonly partial struct Shader_Unorm_R8_float : IComputeShader
{
@@ -235,18 +155,6 @@ namespace ComputeSharp.Tests
}
}
[AutoConstructor]
internal readonly partial struct Shader_Unorm_R8_double : IComputeShader
{
public readonly ReadOnlyTexture2D<R8, double> source;
public readonly ReadWriteTexture2D<R8, double> destination;
public void Execute(ThreadIds ids)
{
destination[ids.XY] = (source[ids.XY] + destination[ids.XY]) / 2;
}
}
[AutoConstructor]
internal readonly partial struct Shader_Unorm_Rg16_Vector2 : IComputeShader
{
@@ -271,18 +179,6 @@ namespace ComputeSharp.Tests
}
}
[AutoConstructor]
internal readonly partial struct Shader_Unorm_Rg16_Double2 : IComputeShader
{
public readonly ReadOnlyTexture2D<Rg16, Double2> source;
public readonly ReadWriteTexture2D<Rg16, Double2> destination;
public void Execute(ThreadIds ids)
{
destination[ids.XY] = (source[ids.XY] + destination[ids.XY]) / 2;
}
}
[AutoConstructor]
internal readonly partial struct Shader_Unorm_Rg32_Vector2 : IComputeShader
{
@@ -307,18 +203,6 @@ namespace ComputeSharp.Tests
}
}
[AutoConstructor]
internal readonly partial struct Shader_Unorm_Rg32_Double2 : IComputeShader
{
public readonly ReadOnlyTexture2D<Rg32, Double2> source;
public readonly ReadWriteTexture2D<Rg32, Double2> destination;
public void Execute(ThreadIds ids)
{
destination[ids.XY] = (source[ids.XY] + destination[ids.XY]) / 2;
}
}
[AutoConstructor]
internal readonly partial struct Shader_Unorm_Rgba32_Vector4 : IComputeShader
{
@@ -343,18 +227,6 @@ namespace ComputeSharp.Tests
}
}
[AutoConstructor]
internal readonly partial struct Shader_Unorm_Rgba32_Double4 : IComputeShader
{
public readonly ReadOnlyTexture2D<Rgba32, Double4> source;
public readonly ReadWriteTexture2D<Rgba32, Double4> destination;
public void Execute(ThreadIds ids)
{
destination[ids.XY] = (source[ids.XY] + destination[ids.XY]) / 2;
}
}
[AutoConstructor]
internal readonly partial struct Shader_Unorm_Rgba64_Vector4 : IComputeShader
{
@@ -378,17 +250,5 @@ namespace ComputeSharp.Tests
destination[ids.XY] = (source[ids.XY] + destination[ids.XY]) / 2;
}
}
[AutoConstructor]
internal readonly partial struct Shader_Unorm_Rgba64_Double4 : IComputeShader
{
public readonly ReadOnlyTexture2D<Rgba64, Double4> source;
public readonly ReadWriteTexture2D<Rgba64, Double4> destination;
public void Execute(ThreadIds ids)
{
destination[ids.XY] = (source[ids.XY] + destination[ids.XY]) / 2;
}
}
}
}
+7 -7
ファイルの表示
@@ -7,13 +7,13 @@
<#
var typesMap = new Dictionary<string, string[]>
{
["Bgra32"] = new[] { "Vector4", "Float4", "Double4" },
["R16"] = new[] { "float", "double" },
["R8"] = new[] { "float", "double" },
["Rg16"] = new[] { "Vector2", "Float2", "Double2" },
["Rg32"] = new[] { "Vector2", "Float2", "Double2" },
["Rgba32"] = new[] { "Vector4", "Float4", "Double4" },
["Rgba64"] = new[] { "Vector4", "Float4", "Double4" }
["Bgra32"] = new[] { "Vector4", "Float4" },
["R16"] = new[] { "float" },
["R8"] = new[] { "float" },
["Rg16"] = new[] { "Vector2", "Float2" },
["Rg32"] = new[] { "Vector2", "Float2" },
["Rgba32"] = new[] { "Vector4", "Float4" },
["Rgba64"] = new[] { "Vector4", "Float4" }
};
IEnumerable<(string T, string TPixel)> EnumerateTypes()
-14
ファイルの表示
@@ -15,42 +15,28 @@ namespace ComputeSharp.Tests
[TestMethod]
[DataRow(typeof(ReadOnlyTexture3D<,>), typeof(Bgra32), typeof(Vector4))]
[DataRow(typeof(ReadOnlyTexture3D<,>), typeof(Bgra32), typeof(Float4))]
[DataRow(typeof(ReadOnlyTexture3D<,>), typeof(Bgra32), typeof(Double4))]
[DataRow(typeof(ReadOnlyTexture3D<,>), typeof(R16), typeof(float))]
[DataRow(typeof(ReadOnlyTexture3D<,>), typeof(R16), typeof(double))]
[DataRow(typeof(ReadOnlyTexture3D<,>), typeof(R8), typeof(float))]
[DataRow(typeof(ReadOnlyTexture3D<,>), typeof(R8), typeof(double))]
[DataRow(typeof(ReadOnlyTexture3D<,>), typeof(Rg16), typeof(Vector2))]
[DataRow(typeof(ReadOnlyTexture3D<,>), typeof(Rg16), typeof(Float2))]
[DataRow(typeof(ReadOnlyTexture3D<,>), typeof(Rg16), typeof(Double2))]
[DataRow(typeof(ReadOnlyTexture3D<,>), typeof(Rg32), typeof(Vector2))]
[DataRow(typeof(ReadOnlyTexture3D<,>), typeof(Rg32), typeof(Float2))]
[DataRow(typeof(ReadOnlyTexture3D<,>), typeof(Rg32), typeof(Double2))]
[DataRow(typeof(ReadOnlyTexture3D<,>), typeof(Rgba32), typeof(Vector4))]
[DataRow(typeof(ReadOnlyTexture3D<,>), typeof(Rgba32), typeof(Float4))]
[DataRow(typeof(ReadOnlyTexture3D<,>), typeof(Rgba32), typeof(Double4))]
[DataRow(typeof(ReadOnlyTexture3D<,>), typeof(Rgba64), typeof(Vector4))]
[DataRow(typeof(ReadOnlyTexture3D<,>), typeof(Rgba64), typeof(Float4))]
[DataRow(typeof(ReadOnlyTexture3D<,>), typeof(Rgba64), typeof(Double4))]
[DataRow(typeof(ReadWriteTexture3D<,>), typeof(Bgra32), typeof(Vector4))]
[DataRow(typeof(ReadWriteTexture3D<,>), typeof(Bgra32), typeof(Float4))]
[DataRow(typeof(ReadWriteTexture3D<,>), typeof(Bgra32), typeof(Double4))]
[DataRow(typeof(ReadWriteTexture3D<,>), typeof(R16), typeof(float))]
[DataRow(typeof(ReadWriteTexture3D<,>), typeof(R16), typeof(double))]
[DataRow(typeof(ReadWriteTexture3D<,>), typeof(R8), typeof(float))]
[DataRow(typeof(ReadWriteTexture3D<,>), typeof(R8), typeof(double))]
[DataRow(typeof(ReadWriteTexture3D<,>), typeof(Rg16), typeof(Vector2))]
[DataRow(typeof(ReadWriteTexture3D<,>), typeof(Rg16), typeof(Float2))]
[DataRow(typeof(ReadWriteTexture3D<,>), typeof(Rg16), typeof(Double2))]
[DataRow(typeof(ReadWriteTexture3D<,>), typeof(Rg32), typeof(Vector2))]
[DataRow(typeof(ReadWriteTexture3D<,>), typeof(Rg32), typeof(Float2))]
[DataRow(typeof(ReadWriteTexture3D<,>), typeof(Rg32), typeof(Double2))]
[DataRow(typeof(ReadWriteTexture3D<,>), typeof(Rgba32), typeof(Vector4))]
[DataRow(typeof(ReadWriteTexture3D<,>), typeof(Rgba32), typeof(Float4))]
[DataRow(typeof(ReadWriteTexture3D<,>), typeof(Rgba32), typeof(Double4))]
[DataRow(typeof(ReadWriteTexture3D<,>), typeof(Rgba64), typeof(Vector4))]
[DataRow(typeof(ReadWriteTexture3D<,>), typeof(Rgba64), typeof(Float4))]
[DataRow(typeof(ReadWriteTexture3D<,>), typeof(Rgba64), typeof(Double4))]
public void Allocate_Uninitialized_Pixel_Ok(Type textureType, Type t, Type tPixel)
{
static void Test<T, TPixel>(Type textureType)