Skip to content

Commit bf354d5

Browse files
committed
Update source generator unit tests
1 parent 80b6f55 commit bf354d5

File tree

2 files changed

+116
-0
lines changed

2 files changed

+116
-0
lines changed

tests/ComputeSharp.D2D1.Tests.SourceGenerators/Test_D2DPixelShaderDescriptorGenerator.cs

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,25 @@ partial struct MyShader : global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShader
102102
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
103103
static string? global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor<MyShader>.EffectAuthor => null;
104104
105+
/// <inheritdoc/>
106+
[global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", <ASSEMBLY_VERSION>)]
107+
[global::System.Diagnostics.DebuggerNonUserCode]
108+
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
109+
static unsafe nint global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor<MyShader>.EffectFactory
110+
{
111+
[global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
112+
get
113+
{
114+
[global::System.Runtime.InteropServices.UnmanagedCallersOnly(CallConvs = [typeof(global::System.Runtime.CompilerServices.CallConvStdcall)])]
115+
static int EffectFactory(void** effectImpl)
116+
{
117+
return global::ComputeSharp.D2D1.Interop.D2D1PixelShaderEffect.CreateEffectUnsafe<MyShader>(effectImpl);
118+
}
119+
120+
return (nint)(delegate* unmanaged[Stdcall]<void**, int>)&EffectFactory;
121+
}
122+
}
123+
105124
/// <inheritdoc/>
106125
[global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", <ASSEMBLY_VERSION>)]
107126
[global::System.Diagnostics.DebuggerNonUserCode]
@@ -402,6 +421,25 @@ partial struct MyShader : global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShader
402421
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
403422
static string? global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor<MyShader>.EffectAuthor => null;
404423
424+
/// <inheritdoc/>
425+
[global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", <ASSEMBLY_VERSION>)]
426+
[global::System.Diagnostics.DebuggerNonUserCode]
427+
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
428+
static unsafe nint global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor<MyShader>.EffectFactory
429+
{
430+
[global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
431+
get
432+
{
433+
[global::System.Runtime.InteropServices.UnmanagedCallersOnly(CallConvs = [typeof(global::System.Runtime.CompilerServices.CallConvStdcall)])]
434+
static int EffectFactory(void** effectImpl)
435+
{
436+
return global::ComputeSharp.D2D1.Interop.D2D1PixelShaderEffect.CreateEffectUnsafe<MyShader>(effectImpl);
437+
}
438+
439+
return (nint)(delegate* unmanaged[Stdcall]<void**, int>)&EffectFactory;
440+
}
441+
}
442+
405443
/// <inheritdoc/>
406444
[global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", <ASSEMBLY_VERSION>)]
407445
[global::System.Diagnostics.DebuggerNonUserCode]
@@ -754,6 +792,25 @@ partial struct MyShader : global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShader
754792
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
755793
static string? global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor<MyShader>.EffectAuthor => "ComputeSharp.D2D1";
756794
795+
/// <inheritdoc/>
796+
[global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", <ASSEMBLY_VERSION>)]
797+
[global::System.Diagnostics.DebuggerNonUserCode]
798+
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
799+
static unsafe nint global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor<MyShader>.EffectFactory
800+
{
801+
[global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
802+
get
803+
{
804+
[global::System.Runtime.InteropServices.UnmanagedCallersOnly(CallConvs = [typeof(global::System.Runtime.CompilerServices.CallConvStdcall)])]
805+
static int EffectFactory(void** effectImpl)
806+
{
807+
return global::ComputeSharp.D2D1.Interop.D2D1PixelShaderEffect.CreateEffectUnsafe<MyShader>(effectImpl);
808+
}
809+
810+
return (nint)(delegate* unmanaged[Stdcall]<void**, int>)&EffectFactory;
811+
}
812+
}
813+
757814
/// <inheritdoc/>
758815
[global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", <ASSEMBLY_VERSION>)]
759816
[global::System.Diagnostics.DebuggerNonUserCode]
@@ -1052,6 +1109,25 @@ partial struct MyShader : global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShader
10521109
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
10531110
static string? global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor<MyShader>.EffectAuthor => null;
10541111
1112+
/// <inheritdoc/>
1113+
[global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", <ASSEMBLY_VERSION>)]
1114+
[global::System.Diagnostics.DebuggerNonUserCode]
1115+
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
1116+
static unsafe nint global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor<MyShader>.EffectFactory
1117+
{
1118+
[global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
1119+
get
1120+
{
1121+
[global::System.Runtime.InteropServices.UnmanagedCallersOnly(CallConvs = [typeof(global::System.Runtime.CompilerServices.CallConvStdcall)])]
1122+
static int EffectFactory(void** effectImpl)
1123+
{
1124+
return global::ComputeSharp.D2D1.Interop.D2D1PixelShaderEffect.CreateEffectUnsafe<MyShader>(effectImpl);
1125+
}
1126+
1127+
return (nint)(delegate* unmanaged[Stdcall]<void**, int>)&EffectFactory;
1128+
}
1129+
}
1130+
10551131
/// <inheritdoc/>
10561132
[global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", <ASSEMBLY_VERSION>)]
10571133
[global::System.Diagnostics.DebuggerNonUserCode]
@@ -1347,6 +1423,25 @@ partial struct MyShader : global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShader
13471423
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
13481424
static string? global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor<MyShader>.EffectAuthor => null;
13491425
1426+
/// <inheritdoc/>
1427+
[global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", <ASSEMBLY_VERSION>)]
1428+
[global::System.Diagnostics.DebuggerNonUserCode]
1429+
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
1430+
static unsafe nint global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor<MyShader>.EffectFactory
1431+
{
1432+
[global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
1433+
get
1434+
{
1435+
[global::System.Runtime.InteropServices.UnmanagedCallersOnly(CallConvs = [typeof(global::System.Runtime.CompilerServices.CallConvStdcall)])]
1436+
static int EffectFactory(void** effectImpl)
1437+
{
1438+
return global::ComputeSharp.D2D1.Interop.D2D1PixelShaderEffect.CreateEffectUnsafe<MyShader>(effectImpl);
1439+
}
1440+
1441+
return (nint)(delegate* unmanaged[Stdcall]<void**, int>)&EffectFactory;
1442+
}
1443+
}
1444+
13501445
/// <inheritdoc/>
13511446
[global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", <ASSEMBLY_VERSION>)]
13521447
[global::System.Diagnostics.DebuggerNonUserCode]
@@ -1630,6 +1725,25 @@ partial struct MyShader : global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShader
16301725
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
16311726
static string? global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor<MyShader>.EffectAuthor => null;
16321727
1728+
/// <inheritdoc/>
1729+
[global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", <ASSEMBLY_VERSION>)]
1730+
[global::System.Diagnostics.DebuggerNonUserCode]
1731+
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
1732+
static unsafe nint global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor<MyShader>.EffectFactory
1733+
{
1734+
[global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
1735+
get
1736+
{
1737+
[global::System.Runtime.InteropServices.UnmanagedCallersOnly(CallConvs = [typeof(global::System.Runtime.CompilerServices.CallConvStdcall)])]
1738+
static int EffectFactory(void** effectImpl)
1739+
{
1740+
return global::ComputeSharp.D2D1.Interop.D2D1PixelShaderEffect.CreateEffectUnsafe<MyShader>(effectImpl);
1741+
}
1742+
1743+
return (nint)(delegate* unmanaged[Stdcall]<void**, int>)&EffectFactory;
1744+
}
1745+
}
1746+
16331747
/// <inheritdoc/>
16341748
[global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", <ASSEMBLY_VERSION>)]
16351749
[global::System.Diagnostics.DebuggerNonUserCode]

tests/ComputeSharp.D2D1.Tests.SourceGenerators/Test_D2DPixelShaderDescriptorGenerator_Analyzers.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ internal partial struct MyShader : ID2D1PixelShader, ID2D1PixelShaderDescriptor<
6969
7070
public static string? EffectAuthor => throw new NotImplementedException();
7171
72+
public static nint EffectFactory => throw new NotImplementedException();
73+
7274
public static int ConstantBufferSize => throw new NotImplementedException();
7375
7476
public static int InputCount => throw new NotImplementedException();

0 commit comments

Comments
 (0)