Merge pull request #628 from Sergio0694/dev/remove-ns2.0-paths
Remove conditional .NET Standard 2.0 paths
このコミットが含まれているのは:
62ファイル変更
+181
-2247
検索条件に一致するファイルはありません
@@ -48,7 +48,7 @@ public readonly struct Bool
|
||||
return ((bool)this).ToString(formatProvider);
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
#if !SOURCE_GENERATOR
|
||||
/// <inheritdoc cref="bool.TryFormat(Span{char}, out int)"/>
|
||||
public bool TryFormat(Span<char> destination, out int charsWritten)
|
||||
{
|
||||
|
||||
@@ -461,16 +461,12 @@ public unsafe partial struct Bool2
|
||||
[UnscopedRef]
|
||||
public readonly ref readonly Bool4 GGGG => ref *(Bool4*)UndefinedData.Memory;
|
||||
|
||||
#if !SOURCE_GENERATOR
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override readonly string ToString()
|
||||
{
|
||||
return $"<{this.x != 0}, {this.y != 0}>";
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Negates a <see cref="Bool2"/> value.
|
||||
/// </summary>
|
||||
|
||||
@@ -1727,16 +1727,12 @@ public unsafe partial struct Bool3
|
||||
[UnscopedRef]
|
||||
public readonly ref readonly Bool4 BBBB => ref *(Bool4*)UndefinedData.Memory;
|
||||
|
||||
#if !SOURCE_GENERATOR
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override readonly string ToString()
|
||||
{
|
||||
return $"<{this.x != 0}, {this.y != 0}, {this.z != 0}>";
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Negates a <see cref="Bool3"/> value.
|
||||
/// </summary>
|
||||
|
||||
@@ -4813,16 +4813,12 @@ public unsafe partial struct Bool4
|
||||
[UnscopedRef]
|
||||
public readonly ref readonly Bool4 AAAA => ref *(Bool4*)UndefinedData.Memory;
|
||||
|
||||
#if !SOURCE_GENERATOR
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override readonly string ToString()
|
||||
{
|
||||
return $"<{this.x != 0}, {this.y != 0}, {this.z != 0}, {this.w != 0}>";
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Negates a <see cref="Bool4"/> value.
|
||||
/// </summary>
|
||||
|
||||
@@ -463,8 +463,6 @@ public unsafe partial struct Double2
|
||||
[UnscopedRef]
|
||||
public readonly ref readonly Double4 GGGG => ref *(Double4*)UndefinedData.Memory;
|
||||
|
||||
#if !SOURCE_GENERATOR
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override readonly string ToString()
|
||||
{
|
||||
@@ -473,8 +471,6 @@ public unsafe partial struct Double2
|
||||
return $"<{this.x}{separator} {this.y}>";
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Negates a <see cref="Double2"/> value.
|
||||
/// </summary>
|
||||
|
||||
@@ -1729,8 +1729,6 @@ public unsafe partial struct Double3
|
||||
[UnscopedRef]
|
||||
public readonly ref readonly Double4 BBBB => ref *(Double4*)UndefinedData.Memory;
|
||||
|
||||
#if !SOURCE_GENERATOR
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override readonly string ToString()
|
||||
{
|
||||
@@ -1739,8 +1737,6 @@ public unsafe partial struct Double3
|
||||
return $"<{this.x}{separator} {this.y}{separator} {this.z}>";
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Negates a <see cref="Double3"/> value.
|
||||
/// </summary>
|
||||
|
||||
@@ -4815,8 +4815,6 @@ public unsafe partial struct Double4
|
||||
[UnscopedRef]
|
||||
public readonly ref readonly Double4 AAAA => ref *(Double4*)UndefinedData.Memory;
|
||||
|
||||
#if !SOURCE_GENERATOR
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override readonly string ToString()
|
||||
{
|
||||
@@ -4825,8 +4823,6 @@ public unsafe partial struct Double4
|
||||
return $"<{this.x}{separator} {this.y}{separator} {this.z}{separator} {this.w}>";
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Negates a <see cref="Double4"/> value.
|
||||
/// </summary>
|
||||
|
||||
@@ -464,8 +464,6 @@ public unsafe partial struct Float2
|
||||
[UnscopedRef]
|
||||
public readonly ref readonly Float4 GGGG => ref *(Float4*)UndefinedData.Memory;
|
||||
|
||||
#if !SOURCE_GENERATOR
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override readonly string ToString()
|
||||
{
|
||||
@@ -474,8 +472,6 @@ public unsafe partial struct Float2
|
||||
return $"<{this.x}{separator} {this.y}>";
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Negates a <see cref="Float2"/> value.
|
||||
/// </summary>
|
||||
|
||||
@@ -1730,8 +1730,6 @@ public unsafe partial struct Float3
|
||||
[UnscopedRef]
|
||||
public readonly ref readonly Float4 BBBB => ref *(Float4*)UndefinedData.Memory;
|
||||
|
||||
#if !SOURCE_GENERATOR
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override readonly string ToString()
|
||||
{
|
||||
@@ -1740,8 +1738,6 @@ public unsafe partial struct Float3
|
||||
return $"<{this.x}{separator} {this.y}{separator} {this.z}>";
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Negates a <see cref="Float3"/> value.
|
||||
/// </summary>
|
||||
|
||||
@@ -4816,8 +4816,6 @@ public unsafe partial struct Float4
|
||||
[UnscopedRef]
|
||||
public readonly ref readonly Float4 AAAA => ref *(Float4*)UndefinedData.Memory;
|
||||
|
||||
#if !SOURCE_GENERATOR
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override readonly string ToString()
|
||||
{
|
||||
@@ -4826,8 +4824,6 @@ public unsafe partial struct Float4
|
||||
return $"<{this.x}{separator} {this.y}{separator} {this.z}{separator} {this.w}>";
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Negates a <see cref="Float4"/> value.
|
||||
/// </summary>
|
||||
|
||||
@@ -464,8 +464,6 @@ public unsafe partial struct Int2
|
||||
[UnscopedRef]
|
||||
public readonly ref readonly Int4 GGGG => ref *(Int4*)UndefinedData.Memory;
|
||||
|
||||
#if !SOURCE_GENERATOR
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override readonly string ToString()
|
||||
{
|
||||
@@ -474,8 +472,6 @@ public unsafe partial struct Int2
|
||||
return $"<{this.x}{separator} {this.y}>";
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Negates a <see cref="Int2"/> value.
|
||||
/// </summary>
|
||||
|
||||
@@ -1730,8 +1730,6 @@ public unsafe partial struct Int3
|
||||
[UnscopedRef]
|
||||
public readonly ref readonly Int4 BBBB => ref *(Int4*)UndefinedData.Memory;
|
||||
|
||||
#if !SOURCE_GENERATOR
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override readonly string ToString()
|
||||
{
|
||||
@@ -1740,8 +1738,6 @@ public unsafe partial struct Int3
|
||||
return $"<{this.x}{separator} {this.y}{separator} {this.z}>";
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Negates a <see cref="Int3"/> value.
|
||||
/// </summary>
|
||||
|
||||
@@ -4816,8 +4816,6 @@ public unsafe partial struct Int4
|
||||
[UnscopedRef]
|
||||
public readonly ref readonly Int4 AAAA => ref *(Int4*)UndefinedData.Memory;
|
||||
|
||||
#if !SOURCE_GENERATOR
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override readonly string ToString()
|
||||
{
|
||||
@@ -4826,8 +4824,6 @@ public unsafe partial struct Int4
|
||||
return $"<{this.x}{separator} {this.y}{separator} {this.z}{separator} {this.w}>";
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Negates a <see cref="Int4"/> value.
|
||||
/// </summary>
|
||||
|
||||
@@ -463,8 +463,6 @@ public unsafe partial struct UInt2
|
||||
[UnscopedRef]
|
||||
public readonly ref readonly UInt4 GGGG => ref *(UInt4*)UndefinedData.Memory;
|
||||
|
||||
#if !SOURCE_GENERATOR
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override readonly string ToString()
|
||||
{
|
||||
@@ -473,8 +471,6 @@ public unsafe partial struct UInt2
|
||||
return $"<{this.x}{separator} {this.y}>";
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Sums two <see cref="UInt2"/> values.
|
||||
/// </summary>
|
||||
|
||||
@@ -1729,8 +1729,6 @@ public unsafe partial struct UInt3
|
||||
[UnscopedRef]
|
||||
public readonly ref readonly UInt4 BBBB => ref *(UInt4*)UndefinedData.Memory;
|
||||
|
||||
#if !SOURCE_GENERATOR
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override readonly string ToString()
|
||||
{
|
||||
@@ -1739,8 +1737,6 @@ public unsafe partial struct UInt3
|
||||
return $"<{this.x}{separator} {this.y}{separator} {this.z}>";
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Sums two <see cref="UInt3"/> values.
|
||||
/// </summary>
|
||||
|
||||
@@ -4815,8 +4815,6 @@ public unsafe partial struct UInt4
|
||||
[UnscopedRef]
|
||||
public readonly ref readonly UInt4 AAAA => ref *(UInt4*)UndefinedData.Memory;
|
||||
|
||||
#if !SOURCE_GENERATOR
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override readonly string ToString()
|
||||
{
|
||||
@@ -4825,8 +4823,6 @@ public unsafe partial struct UInt4
|
||||
return $"<{this.x}{separator} {this.y}{separator} {this.z}{separator} {this.w}>";
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Sums two <see cref="UInt4"/> values.
|
||||
/// </summary>
|
||||
|
||||
@@ -229,10 +229,6 @@ public unsafe partial struct <#=typeName#>
|
||||
PopIndent();
|
||||
WriteLine("");
|
||||
|
||||
#>
|
||||
#if !SOURCE_GENERATOR
|
||||
|
||||
<#
|
||||
if (elementTypeName == "Bool")
|
||||
{
|
||||
#>
|
||||
@@ -256,10 +252,6 @@ public unsafe partial struct <#=typeName#>
|
||||
<#
|
||||
}
|
||||
|
||||
#>
|
||||
|
||||
#endif
|
||||
<#
|
||||
// Generate the negation operator
|
||||
if (elementTypeName != "UInt")
|
||||
{
|
||||
|
||||
@@ -23,7 +23,7 @@ public sealed class FxcCompilationException : Exception
|
||||
/// <returns>A formatted error message for a new <see cref="FxcCompilationException"/> instance.</returns>
|
||||
private static string GetExceptionMessage(string error)
|
||||
{
|
||||
#if NET6_0_OR_GREATER
|
||||
#if !SOURCE_GENERATOR
|
||||
ReadOnlySpan<char> message = error.AsSpan().Trim();
|
||||
#else
|
||||
string message = error.Trim();
|
||||
|
||||
@@ -148,44 +148,44 @@ public static unsafe class D2D1PixelShaderEffect
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager15].propertyName = (ushort*)pResourceTextureManager15PropertyName;
|
||||
|
||||
// Property getters
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ConstantBuffer].getFunction = PixelShaderEffect.GetConstantBuffer;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.TransformMapper].getFunction = PixelShaderEffect.GetTransformMapper;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager0].getFunction = PixelShaderEffect.GetResourceTextureManager0;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager1].getFunction = PixelShaderEffect.GetResourceTextureManager1;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager2].getFunction = PixelShaderEffect.GetResourceTextureManager2;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager3].getFunction = PixelShaderEffect.GetResourceTextureManager3;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager4].getFunction = PixelShaderEffect.GetResourceTextureManager4;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager5].getFunction = PixelShaderEffect.GetResourceTextureManager5;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager6].getFunction = PixelShaderEffect.GetResourceTextureManager6;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager7].getFunction = PixelShaderEffect.GetResourceTextureManager7;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager8].getFunction = PixelShaderEffect.GetResourceTextureManager8;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager9].getFunction = PixelShaderEffect.GetResourceTextureManager9;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager10].getFunction = PixelShaderEffect.GetResourceTextureManager10;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager11].getFunction = PixelShaderEffect.GetResourceTextureManager11;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager12].getFunction = PixelShaderEffect.GetResourceTextureManager12;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager13].getFunction = PixelShaderEffect.GetResourceTextureManager13;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager14].getFunction = PixelShaderEffect.GetResourceTextureManager14;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager15].getFunction = PixelShaderEffect.GetResourceTextureManager15;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ConstantBuffer].getFunction = &PixelShaderEffect.GetConstantBufferImpl;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.TransformMapper].getFunction = &PixelShaderEffect.GetTransformMapperImpl;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager0].getFunction = &PixelShaderEffect.GetResourceTextureManager0Impl;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager1].getFunction = &PixelShaderEffect.GetResourceTextureManager1Impl;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager2].getFunction = &PixelShaderEffect.GetResourceTextureManager2Impl;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager3].getFunction = &PixelShaderEffect.GetResourceTextureManager3Impl;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager4].getFunction = &PixelShaderEffect.GetResourceTextureManager4Impl;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager5].getFunction = &PixelShaderEffect.GetResourceTextureManager5Impl;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager6].getFunction = &PixelShaderEffect.GetResourceTextureManager6Impl;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager7].getFunction = &PixelShaderEffect.GetResourceTextureManager7Impl;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager8].getFunction = &PixelShaderEffect.GetResourceTextureManager8Impl;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager9].getFunction = &PixelShaderEffect.GetResourceTextureManager9Impl;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager10].getFunction = &PixelShaderEffect.GetResourceTextureManager10Impl;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager11].getFunction = &PixelShaderEffect.GetResourceTextureManager11Impl;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager12].getFunction = &PixelShaderEffect.GetResourceTextureManager12Impl;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager13].getFunction = &PixelShaderEffect.GetResourceTextureManager13Impl;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager14].getFunction = &PixelShaderEffect.GetResourceTextureManager14Impl;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager15].getFunction = &PixelShaderEffect.GetResourceTextureManager15Impl;
|
||||
|
||||
// Property setters
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ConstantBuffer].setFunction = PixelShaderEffect.SetConstantBuffer;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.TransformMapper].setFunction = PixelShaderEffect.SetTransformMapper;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager0].setFunction = PixelShaderEffect.SetResourceTextureManager0;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager1].setFunction = PixelShaderEffect.SetResourceTextureManager1;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager2].setFunction = PixelShaderEffect.SetResourceTextureManager2;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager3].setFunction = PixelShaderEffect.SetResourceTextureManager3;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager4].setFunction = PixelShaderEffect.SetResourceTextureManager4;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager5].setFunction = PixelShaderEffect.SetResourceTextureManager5;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager6].setFunction = PixelShaderEffect.SetResourceTextureManager6;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager7].setFunction = PixelShaderEffect.SetResourceTextureManager7;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager8].setFunction = PixelShaderEffect.SetResourceTextureManager8;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager9].setFunction = PixelShaderEffect.SetResourceTextureManager9;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager10].setFunction = PixelShaderEffect.SetResourceTextureManager10;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager11].setFunction = PixelShaderEffect.SetResourceTextureManager11;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager12].setFunction = PixelShaderEffect.SetResourceTextureManager12;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager13].setFunction = PixelShaderEffect.SetResourceTextureManager13;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager14].setFunction = PixelShaderEffect.SetResourceTextureManager14;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager15].setFunction = PixelShaderEffect.SetResourceTextureManager15;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ConstantBuffer].setFunction = &PixelShaderEffect.SetConstantBufferImpl;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.TransformMapper].setFunction = &PixelShaderEffect.SetTransformMapperImpl;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager0].setFunction = &PixelShaderEffect.SetResourceTextureManager0Impl;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager1].setFunction = &PixelShaderEffect.SetResourceTextureManager1Impl;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager2].setFunction = &PixelShaderEffect.SetResourceTextureManager2Impl;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager3].setFunction = &PixelShaderEffect.SetResourceTextureManager3Impl;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager4].setFunction = &PixelShaderEffect.SetResourceTextureManager4Impl;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager5].setFunction = &PixelShaderEffect.SetResourceTextureManager5Impl;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager6].setFunction = &PixelShaderEffect.SetResourceTextureManager6Impl;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager7].setFunction = &PixelShaderEffect.SetResourceTextureManager7Impl;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager8].setFunction = &PixelShaderEffect.SetResourceTextureManager8Impl;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager9].setFunction = &PixelShaderEffect.SetResourceTextureManager9Impl;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager10].setFunction = &PixelShaderEffect.SetResourceTextureManager10Impl;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager11].setFunction = &PixelShaderEffect.SetResourceTextureManager11Impl;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager12].setFunction = &PixelShaderEffect.SetResourceTextureManager12Impl;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager13].setFunction = &PixelShaderEffect.SetResourceTextureManager13Impl;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager14].setFunction = &PixelShaderEffect.SetResourceTextureManager14Impl;
|
||||
d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager15].setFunction = &PixelShaderEffect.SetResourceTextureManager15Impl;
|
||||
|
||||
fixed (Guid* pGuid = &GetEffectId<T>())
|
||||
{
|
||||
@@ -227,9 +227,9 @@ public static unsafe class D2D1PixelShaderEffect
|
||||
/// <item>The effect XML description (as null-terminated UTF8 text).</item>
|
||||
/// <item>The number of property bindings (an <see cref="int"/>).</item>
|
||||
/// <item>The property name (as null-terminated UTF8 text).</item>
|
||||
/// <item>The property getter (a <see langword="delegate* unmanaged[Stdcall]<IUnknown*, byte*, uint, uint*, HRESULT>"/>).</item>
|
||||
/// <item>The property setter (a <see langword="delegate* unmanaged[Stdcall]<IUnknown*, byte*, uint, HRESULT>"/>).</item>
|
||||
/// <item>The effect factory (a <see langword="delegate* unmanaged[Stdcall]<IUnknown**, HRESULT>"/>).</item>
|
||||
/// <item>The property getter (a <see langword="delegate* unmanaged<IUnknown*, byte*, uint, uint*, HRESULT>"/>).</item>
|
||||
/// <item>The property setter (a <see langword="delegate* unmanaged<IUnknown*, byte*, uint, HRESULT>"/>).</item>
|
||||
/// <item>The effect factory (a <see langword="delegate* unmanaged<IUnknown**, HRESULT>"/>).</item>
|
||||
/// </list>
|
||||
/// The property name, getter and setter are grouped together after the number of bindings.
|
||||
/// </para>
|
||||
@@ -275,12 +275,12 @@ public static unsafe class D2D1PixelShaderEffect
|
||||
writer.Write(D2D1PixelShaderEffectProperty.NumberOfAlwaysAvailableProperties + D2D1PixelShader.GetResourceTextureCount<T>());
|
||||
writer.Write("ConstantBuffer"u8);
|
||||
writer.Write((byte)'\0');
|
||||
writer.Write((nint)PixelShaderEffect.GetConstantBuffer);
|
||||
writer.Write((nint)PixelShaderEffect.SetConstantBuffer);
|
||||
writer.Write((nint)(delegate* unmanaged<IUnknown*, byte*, uint, uint*, HRESULT>)&PixelShaderEffect.GetConstantBufferImpl);
|
||||
writer.Write((nint)(delegate* unmanaged<IUnknown*, byte*, uint, HRESULT>)&PixelShaderEffect.SetConstantBufferImpl);
|
||||
writer.Write("TransformMapper"u8);
|
||||
writer.Write((byte)'\0');
|
||||
writer.Write((nint)PixelShaderEffect.GetTransformMapper);
|
||||
writer.Write((nint)PixelShaderEffect.SetTransformMapper);
|
||||
writer.Write((nint)(delegate* unmanaged<IUnknown*, byte*, uint, uint*, HRESULT>)&PixelShaderEffect.GetTransformMapperImpl);
|
||||
writer.Write((nint)(delegate* unmanaged<IUnknown*, byte*, uint, HRESULT>)&PixelShaderEffect.SetTransformMapperImpl);
|
||||
|
||||
// Add all resource texture manager property bindings
|
||||
for (int i = 0; i < D2D1PixelShader.GetResourceTextureCount<T>(); i++)
|
||||
@@ -290,98 +290,98 @@ public static unsafe class D2D1PixelShaderEffect
|
||||
case 0:
|
||||
writer.Write("ResourceTextureManager0"u8);
|
||||
writer.Write((byte)'\0');
|
||||
writer.Write((nint)PixelShaderEffect.GetResourceTextureManager0);
|
||||
writer.Write((nint)PixelShaderEffect.SetResourceTextureManager0);
|
||||
writer.Write((nint)(delegate* unmanaged<IUnknown*, byte*, uint, uint*, HRESULT>)&PixelShaderEffect.GetResourceTextureManager0Impl);
|
||||
writer.Write((nint)(delegate* unmanaged<IUnknown*, byte*, uint, HRESULT>)&PixelShaderEffect.SetResourceTextureManager0Impl);
|
||||
break;
|
||||
case 1:
|
||||
writer.Write("ResourceTextureManager1"u8);
|
||||
writer.Write((byte)'\0');
|
||||
writer.Write((nint)PixelShaderEffect.GetResourceTextureManager1);
|
||||
writer.Write((nint)PixelShaderEffect.SetResourceTextureManager1);
|
||||
writer.Write((nint)(delegate* unmanaged<IUnknown*, byte*, uint, uint*, HRESULT>)&PixelShaderEffect.GetResourceTextureManager1Impl);
|
||||
writer.Write((nint)(delegate* unmanaged<IUnknown*, byte*, uint, HRESULT>)&PixelShaderEffect.SetResourceTextureManager1Impl);
|
||||
break;
|
||||
case 2:
|
||||
writer.Write("ResourceTextureManager2"u8);
|
||||
writer.Write((byte)'\0');
|
||||
writer.Write((nint)PixelShaderEffect.GetResourceTextureManager2);
|
||||
writer.Write((nint)PixelShaderEffect.SetResourceTextureManager2);
|
||||
writer.Write((nint)(delegate* unmanaged<IUnknown*, byte*, uint, uint*, HRESULT>)&PixelShaderEffect.GetResourceTextureManager2Impl);
|
||||
writer.Write((nint)(delegate* unmanaged<IUnknown*, byte*, uint, HRESULT>)&PixelShaderEffect.SetResourceTextureManager2Impl);
|
||||
break;
|
||||
case 3:
|
||||
writer.Write("ResourceTextureManager3"u8);
|
||||
writer.Write((byte)'\0');
|
||||
writer.Write((nint)PixelShaderEffect.GetResourceTextureManager3);
|
||||
writer.Write((nint)PixelShaderEffect.SetResourceTextureManager3);
|
||||
writer.Write((nint)(delegate* unmanaged<IUnknown*, byte*, uint, uint*, HRESULT>)&PixelShaderEffect.GetResourceTextureManager3Impl);
|
||||
writer.Write((nint)(delegate* unmanaged<IUnknown*, byte*, uint, HRESULT>)&PixelShaderEffect.SetResourceTextureManager3Impl);
|
||||
break;
|
||||
case 4:
|
||||
writer.Write("ResourceTextureManager4"u8);
|
||||
writer.Write((byte)'\0');
|
||||
writer.Write((nint)PixelShaderEffect.GetResourceTextureManager4);
|
||||
writer.Write((nint)PixelShaderEffect.SetResourceTextureManager4);
|
||||
writer.Write((nint)(delegate* unmanaged<IUnknown*, byte*, uint, uint*, HRESULT>)&PixelShaderEffect.GetResourceTextureManager4Impl);
|
||||
writer.Write((nint)(delegate* unmanaged<IUnknown*, byte*, uint, HRESULT>)&PixelShaderEffect.SetResourceTextureManager4Impl);
|
||||
break;
|
||||
case 5:
|
||||
writer.Write("ResourceTextureManager5"u8);
|
||||
writer.Write((byte)'\0');
|
||||
writer.Write((nint)PixelShaderEffect.GetResourceTextureManager5);
|
||||
writer.Write((nint)PixelShaderEffect.SetResourceTextureManager5);
|
||||
writer.Write((nint)(delegate* unmanaged<IUnknown*, byte*, uint, uint*, HRESULT>)&PixelShaderEffect.GetResourceTextureManager5Impl);
|
||||
writer.Write((nint)(delegate* unmanaged<IUnknown*, byte*, uint, HRESULT>)&PixelShaderEffect.SetResourceTextureManager5Impl);
|
||||
break;
|
||||
case 6:
|
||||
writer.Write("ResourceTextureManager6"u8);
|
||||
writer.Write((byte)'\0');
|
||||
writer.Write((nint)PixelShaderEffect.GetResourceTextureManager6);
|
||||
writer.Write((nint)PixelShaderEffect.SetResourceTextureManager6);
|
||||
writer.Write((nint)(delegate* unmanaged<IUnknown*, byte*, uint, uint*, HRESULT>)&PixelShaderEffect.GetResourceTextureManager6Impl);
|
||||
writer.Write((nint)(delegate* unmanaged<IUnknown*, byte*, uint, HRESULT>)&PixelShaderEffect.SetResourceTextureManager6Impl);
|
||||
break;
|
||||
case 7:
|
||||
writer.Write("ResourceTextureManager7"u8);
|
||||
writer.Write((byte)'\0');
|
||||
writer.Write((nint)PixelShaderEffect.GetResourceTextureManager7);
|
||||
writer.Write((nint)PixelShaderEffect.SetResourceTextureManager7);
|
||||
writer.Write((nint)(delegate* unmanaged<IUnknown*, byte*, uint, uint*, HRESULT>)&PixelShaderEffect.GetResourceTextureManager7Impl);
|
||||
writer.Write((nint)(delegate* unmanaged<IUnknown*, byte*, uint, HRESULT>)&PixelShaderEffect.SetResourceTextureManager7Impl);
|
||||
break;
|
||||
case 8:
|
||||
writer.Write("ResourceTextureManager8"u8);
|
||||
writer.Write((byte)'\0');
|
||||
writer.Write((nint)PixelShaderEffect.GetResourceTextureManager8);
|
||||
writer.Write((nint)PixelShaderEffect.SetResourceTextureManager8);
|
||||
writer.Write((nint)(delegate* unmanaged<IUnknown*, byte*, uint, uint*, HRESULT>)&PixelShaderEffect.GetResourceTextureManager8Impl);
|
||||
writer.Write((nint)(delegate* unmanaged<IUnknown*, byte*, uint, HRESULT>)&PixelShaderEffect.SetResourceTextureManager8Impl);
|
||||
break;
|
||||
case 9:
|
||||
writer.Write("ResourceTextureManager9"u8);
|
||||
writer.Write((byte)'\0');
|
||||
writer.Write((nint)PixelShaderEffect.GetResourceTextureManager9);
|
||||
writer.Write((nint)PixelShaderEffect.SetResourceTextureManager9);
|
||||
writer.Write((nint)(delegate* unmanaged<IUnknown*, byte*, uint, uint*, HRESULT>)&PixelShaderEffect.GetResourceTextureManager9Impl);
|
||||
writer.Write((nint)(delegate* unmanaged<IUnknown*, byte*, uint, HRESULT>)&PixelShaderEffect.SetResourceTextureManager9Impl);
|
||||
break;
|
||||
case 10:
|
||||
writer.Write("ResourceTextureManager10"u8);
|
||||
writer.Write((byte)'\0');
|
||||
writer.Write((nint)PixelShaderEffect.GetResourceTextureManager10);
|
||||
writer.Write((nint)PixelShaderEffect.SetResourceTextureManager10);
|
||||
writer.Write((nint)(delegate* unmanaged<IUnknown*, byte*, uint, uint*, HRESULT>)&PixelShaderEffect.GetResourceTextureManager10Impl);
|
||||
writer.Write((nint)(delegate* unmanaged<IUnknown*, byte*, uint, HRESULT>)&PixelShaderEffect.SetResourceTextureManager10Impl);
|
||||
break;
|
||||
case 11:
|
||||
writer.Write("ResourceTextureManager11"u8);
|
||||
writer.Write((byte)'\0');
|
||||
writer.Write((nint)PixelShaderEffect.GetResourceTextureManager11);
|
||||
writer.Write((nint)PixelShaderEffect.SetResourceTextureManager11);
|
||||
writer.Write((nint)(delegate* unmanaged<IUnknown*, byte*, uint, uint*, HRESULT>)&PixelShaderEffect.GetResourceTextureManager11Impl);
|
||||
writer.Write((nint)(delegate* unmanaged<IUnknown*, byte*, uint, HRESULT>)&PixelShaderEffect.SetResourceTextureManager11Impl);
|
||||
break;
|
||||
case 12:
|
||||
writer.Write("ResourceTextureManager12"u8);
|
||||
writer.Write((byte)'\0');
|
||||
writer.Write((nint)PixelShaderEffect.GetResourceTextureManager12);
|
||||
writer.Write((nint)PixelShaderEffect.SetResourceTextureManager12);
|
||||
writer.Write((nint)(delegate* unmanaged<IUnknown*, byte*, uint, uint*, HRESULT>)&PixelShaderEffect.GetResourceTextureManager12Impl);
|
||||
writer.Write((nint)(delegate* unmanaged<IUnknown*, byte*, uint, HRESULT>)&PixelShaderEffect.SetResourceTextureManager12Impl);
|
||||
break;
|
||||
case 13:
|
||||
writer.Write("ResourceTextureManager13"u8);
|
||||
writer.Write((byte)'\0');
|
||||
writer.Write((nint)PixelShaderEffect.GetResourceTextureManager13);
|
||||
writer.Write((nint)PixelShaderEffect.SetResourceTextureManager13);
|
||||
writer.Write((nint)(delegate* unmanaged<IUnknown*, byte*, uint, uint*, HRESULT>)&PixelShaderEffect.GetResourceTextureManager13Impl);
|
||||
writer.Write((nint)(delegate* unmanaged<IUnknown*, byte*, uint, HRESULT>)&PixelShaderEffect.SetResourceTextureManager13Impl);
|
||||
break;
|
||||
case 14:
|
||||
writer.Write("ResourceTextureManager14"u8);
|
||||
writer.Write((byte)'\0');
|
||||
writer.Write((nint)PixelShaderEffect.GetResourceTextureManager14);
|
||||
writer.Write((nint)PixelShaderEffect.SetResourceTextureManager14);
|
||||
writer.Write((nint)(delegate* unmanaged<IUnknown*, byte*, uint, uint*, HRESULT>)&PixelShaderEffect.GetResourceTextureManager14Impl);
|
||||
writer.Write((nint)(delegate* unmanaged<IUnknown*, byte*, uint, HRESULT>)&PixelShaderEffect.SetResourceTextureManager14Impl);
|
||||
break;
|
||||
case 15:
|
||||
writer.Write("ResourceTextureManager15"u8);
|
||||
writer.Write((byte)'\0');
|
||||
writer.Write((nint)PixelShaderEffect.GetResourceTextureManager15);
|
||||
writer.Write((nint)PixelShaderEffect.SetResourceTextureManager15);
|
||||
writer.Write((nint)(delegate* unmanaged<IUnknown*, byte*, uint, uint*, HRESULT>)&PixelShaderEffect.GetResourceTextureManager15Impl);
|
||||
writer.Write((nint)(delegate* unmanaged<IUnknown*, byte*, uint, HRESULT>)&PixelShaderEffect.SetResourceTextureManager15Impl);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,18 +74,10 @@ internal unsafe partial struct PixelShaderEffect
|
||||
/// <summary>
|
||||
/// Gets the factory for the current effect.
|
||||
/// </summary>
|
||||
#if NET6_0_OR_GREATER
|
||||
public delegate* unmanaged[Stdcall]<IUnknown**, HRESULT> Factory
|
||||
#else
|
||||
public void* Factory
|
||||
#endif
|
||||
public delegate* unmanaged<IUnknown**, HRESULT> Factory
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
#if NET6_0_OR_GREATER
|
||||
get => (delegate* unmanaged[Stdcall]<IUnknown**, HRESULT>)Marshal.GetFunctionPointerForDelegate(this.effectFactory);
|
||||
#else
|
||||
get => (void*)Marshal.GetFunctionPointerForDelegate(this.effectFactory);
|
||||
#endif
|
||||
get => (delegate* unmanaged<IUnknown**, HRESULT>)Marshal.GetFunctionPointerForDelegate(this.effectFactory);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
-62
@@ -14,68 +14,6 @@ partial struct PixelShaderEffect
|
||||
/// </summary>
|
||||
private static unsafe class ID2D1DrawTransformMethods
|
||||
{
|
||||
#if !NET6_0_OR_GREATER
|
||||
/// <inheritdoc cref="GetInputCount"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
public delegate uint GetInputCountDelegate(PixelShaderEffect* @this);
|
||||
|
||||
/// <inheritdoc cref="MapOutputRectToInputRects"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
public delegate int MapOutputRectToInputRectsDelegate(PixelShaderEffect* @this, RECT* outputRect, RECT* inputRects, uint inputRectsCount);
|
||||
|
||||
/// <inheritdoc cref="MapInputRectsToOutputRect"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
public delegate int MapInputRectsToOutputRectDelegate(PixelShaderEffect* @this, RECT* inputRects, RECT* inputOpaqueSubRects, uint inputRectCount, RECT* outputRect, RECT* outputOpaqueSubRect);
|
||||
|
||||
/// <inheritdoc cref="MapInvalidRect"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
public delegate int MapInvalidRectDelegate(PixelShaderEffect* @this, uint inputIndex, RECT invalidInputRect, RECT* invalidOutputRect);
|
||||
|
||||
/// <inheritdoc cref="SetDrawInfo"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
public delegate int SetDrawInfoDelegate(PixelShaderEffect* @this, ID2D1DrawInfo* drawInfo);
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="QueryInterfaceDelegate"/> instance wrapping <see cref="QueryInterface"/>.
|
||||
/// </summary>
|
||||
public static readonly QueryInterfaceDelegate QueryInterfaceWrapper = QueryInterface;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="AddRefDelegate"/> instance wrapping <see cref="AddRef"/>.
|
||||
/// </summary>
|
||||
public static readonly AddRefDelegate AddRefWrapper = AddRef;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="ReleaseDelegate"/> instance wrapping <see cref="Release"/>.
|
||||
/// </summary>
|
||||
public static readonly ReleaseDelegate ReleaseWrapper = Release;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="GetInputCountDelegate"/> instance wrapping <see cref="GetInputCount"/>.
|
||||
/// </summary>
|
||||
public static readonly GetInputCountDelegate GetInputCountWrapper = GetInputCount;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="MapOutputRectToInputRectsDelegate"/> instance wrapping <see cref="MapOutputRectToInputRects"/>.
|
||||
/// </summary>
|
||||
public static readonly MapOutputRectToInputRectsDelegate MapOutputRectToInputRectsWrapper = MapOutputRectToInputRects;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="MapInputRectsToOutputRectDelegate"/> instance wrapping <see cref="MapInputRectsToOutputRect"/>.
|
||||
/// </summary>
|
||||
public static readonly MapInputRectsToOutputRectDelegate MapInputRectsToOutputRectWrapper = MapInputRectsToOutputRect;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="MapInvalidRectDelegate"/> instance wrapping <see cref="MapInvalidRect"/>.
|
||||
/// </summary>
|
||||
public static readonly MapInvalidRectDelegate MapInvalidRectWrapper = MapInvalidRect;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="SetDrawInfoDelegate"/> instance wrapping <see cref="SetDrawInfo"/>.
|
||||
/// </summary>
|
||||
public static readonly SetDrawInfoDelegate SetDrawInfoWrapper = SetDrawInfo;
|
||||
#endif
|
||||
|
||||
/// <inheritdoc cref="ID2D1DrawTransform.QueryInterface"/>
|
||||
[UnmanagedCallersOnly]
|
||||
public static int QueryInterface(PixelShaderEffect* @this, Guid* riid, void** ppvObject)
|
||||
|
||||
-44
@@ -17,50 +17,6 @@ internal unsafe partial struct PixelShaderEffect
|
||||
/// </summary>
|
||||
private static class ID2D1EffectImplMethods
|
||||
{
|
||||
#if !NET6_0_OR_GREATER
|
||||
/// <inheritdoc cref="Initialize"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
public delegate int InitializeDelegate(PixelShaderEffect* @this, ID2D1EffectContext* effectContext, ID2D1TransformGraph* transformGraph);
|
||||
|
||||
/// <inheritdoc cref="PrepareForRender"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
public delegate int PrepareForRenderDelegate(PixelShaderEffect* @this, D2D1_CHANGE_TYPE changeType);
|
||||
|
||||
/// <inheritdoc cref="SetGraph"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
public delegate int SetGraphDelegate(PixelShaderEffect* @this, ID2D1TransformGraph* transformGraph);
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="QueryInterfaceDelegate"/> instance wrapping <see cref="QueryInterface"/>.
|
||||
/// </summary>
|
||||
public static readonly QueryInterfaceDelegate QueryInterfaceWrapper = QueryInterface;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="AddRefDelegate"/> instance wrapping <see cref="AddRef"/>.
|
||||
/// </summary>
|
||||
public static readonly AddRefDelegate AddRefWrapper = AddRef;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="ReleaseDelegate"/> instance wrapping <see cref="Release"/>.
|
||||
/// </summary>
|
||||
public static readonly ReleaseDelegate ReleaseWrapper = Release;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="InitializeDelegate"/> instance wrapping <see cref="Initialize"/>.
|
||||
/// </summary>
|
||||
public static readonly InitializeDelegate InitializeWrapper = Initialize;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="PrepareForRenderDelegate"/> instance wrapping <see cref="PrepareForRender"/>.
|
||||
/// </summary>
|
||||
public static readonly PrepareForRenderDelegate PrepareForRenderWrapper = PrepareForRender;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="SetGraphDelegate"/> instance wrapping <see cref="SetGraph"/>.
|
||||
/// </summary>
|
||||
public static readonly SetGraphDelegate SetGraphWrapper = SetGraph;
|
||||
#endif
|
||||
|
||||
/// <inheritdoc cref="ID2D1EffectImpl.QueryInterface"/>
|
||||
[UnmanagedCallersOnly]
|
||||
public static int QueryInterface(PixelShaderEffect* @this, Guid* riid, void** ppvObject)
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using ComputeSharp.D2D1.Extensions;
|
||||
using ComputeSharp.D2D1.Shaders.Interop.Effects.ResourceManagers;
|
||||
@@ -11,107 +10,9 @@ namespace ComputeSharp.D2D1.Interop.Effects;
|
||||
/// <inheritdoc/>
|
||||
unsafe partial struct PixelShaderEffect
|
||||
{
|
||||
#if !NET6_0_OR_GREATER
|
||||
/// <inheritdoc cref="D2D1_PROPERTY_BINDING.getFunction"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate int PropertyGetFunctionDelegate(IUnknown* effect, byte* data, uint dataSize, uint* actualSize);
|
||||
|
||||
/// <inheritdoc cref="D2D1_PROPERTY_BINDING.setFunction"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate int PropertySetFunctionDelegate(IUnknown* effect, byte* data, uint dataSize);
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="PropertyGetFunctionDelegate"/> instance wrapping <see cref="GetConstantBufferImpl"/>.
|
||||
/// </summary>
|
||||
private static readonly PropertyGetFunctionDelegate GetConstantBufferWrapper = GetConstantBufferImpl;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="PropertySetFunctionDelegate"/> instance wrapping <see cref="SetConstantBufferImpl"/>.
|
||||
/// </summary>
|
||||
private static readonly PropertySetFunctionDelegate SetConstantBufferWrapper = SetConstantBufferImpl;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="PropertyGetFunctionDelegate"/> instance wrapping <see cref="GetTransformMapperImpl"/>.
|
||||
/// </summary>
|
||||
private static readonly PropertyGetFunctionDelegate GetTransformMapperWrapper = GetTransformMapperImpl;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="PropertySetFunctionDelegate"/> instance wrapping <see cref="SetTransformMapperImpl"/>.
|
||||
/// </summary>
|
||||
private static readonly PropertySetFunctionDelegate SetTransformMapperWrapper = SetTransformMapperImpl;
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Gets the get accessor for the constant buffer.
|
||||
/// </summary>
|
||||
#if NET6_0_OR_GREATER
|
||||
public static delegate* unmanaged[Stdcall]<IUnknown*, byte*, uint, uint*, int> GetConstantBuffer
|
||||
#else
|
||||
public static void* GetConstantBuffer
|
||||
#endif
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
#if NET6_0_OR_GREATER
|
||||
get => &GetConstantBufferImpl;
|
||||
#else
|
||||
get => (void*)Marshal.GetFunctionPointerForDelegate(GetConstantBufferWrapper);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the set accessor for the constant buffer.
|
||||
/// </summary>
|
||||
#if NET6_0_OR_GREATER
|
||||
public static delegate* unmanaged[Stdcall]<IUnknown*, byte*, uint, int> SetConstantBuffer
|
||||
#else
|
||||
public static void* SetConstantBuffer
|
||||
#endif
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
#if NET6_0_OR_GREATER
|
||||
get => &SetConstantBufferImpl;
|
||||
#else
|
||||
get => (void*)Marshal.GetFunctionPointerForDelegate(SetConstantBufferWrapper);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the get accessor for the transform mapper.
|
||||
/// </summary>
|
||||
#if NET6_0_OR_GREATER
|
||||
public static delegate* unmanaged[Stdcall]<IUnknown*, byte*, uint, uint*, int> GetTransformMapper
|
||||
#else
|
||||
public static void* GetTransformMapper
|
||||
#endif
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
#if NET6_0_OR_GREATER
|
||||
get => &GetTransformMapperImpl;
|
||||
#else
|
||||
get => (void*)Marshal.GetFunctionPointerForDelegate(GetTransformMapperWrapper);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the set accessor for the transform mapper.
|
||||
/// </summary>
|
||||
#if NET6_0_OR_GREATER
|
||||
public static delegate* unmanaged[Stdcall]<IUnknown*, byte*, uint, int> SetTransformMapper
|
||||
#else
|
||||
public static void* SetTransformMapper
|
||||
#endif
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
#if NET6_0_OR_GREATER
|
||||
get => &SetTransformMapperImpl;
|
||||
#else
|
||||
get => (void*)Marshal.GetFunctionPointerForDelegate(SetTransformMapperWrapper);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="D2D1_PROPERTY_BINDING.getFunction"/>
|
||||
[UnmanagedCallersOnly(CallConvs = new[] { typeof(CallConvStdcall) })]
|
||||
private static int GetConstantBufferImpl(IUnknown* effect, byte* data, uint dataSize, uint* actualSize)
|
||||
[UnmanagedCallersOnly]
|
||||
public static HRESULT GetConstantBufferImpl(IUnknown* effect, byte* data, uint dataSize, uint* actualSize)
|
||||
{
|
||||
PixelShaderEffect* @this = (PixelShaderEffect*)effect;
|
||||
|
||||
@@ -163,8 +64,8 @@ unsafe partial struct PixelShaderEffect
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="D2D1_PROPERTY_BINDING.getFunction"/>
|
||||
[UnmanagedCallersOnly(CallConvs = new[] { typeof(CallConvStdcall) })]
|
||||
private static int SetConstantBufferImpl(IUnknown* effect, byte* data, uint dataSize)
|
||||
[UnmanagedCallersOnly]
|
||||
public static HRESULT SetConstantBufferImpl(IUnknown* effect, byte* data, uint dataSize)
|
||||
{
|
||||
PixelShaderEffect* @this = (PixelShaderEffect*)effect;
|
||||
|
||||
@@ -196,8 +97,8 @@ unsafe partial struct PixelShaderEffect
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="D2D1_PROPERTY_BINDING.getFunction"/>
|
||||
[UnmanagedCallersOnly(CallConvs = new[] { typeof(CallConvStdcall) })]
|
||||
private static int GetTransformMapperImpl(IUnknown* effect, byte* data, uint dataSize, uint* actualSize)
|
||||
[UnmanagedCallersOnly]
|
||||
public static HRESULT GetTransformMapperImpl(IUnknown* effect, byte* data, uint dataSize, uint* actualSize)
|
||||
{
|
||||
PixelShaderEffect* @this = (PixelShaderEffect*)effect;
|
||||
|
||||
@@ -229,8 +130,8 @@ unsafe partial struct PixelShaderEffect
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="D2D1_PROPERTY_BINDING.getFunction"/>
|
||||
[UnmanagedCallersOnly(CallConvs = new[] { typeof(CallConvStdcall) })]
|
||||
private static int SetTransformMapperImpl(IUnknown* effect, byte* data, uint dataSize)
|
||||
[UnmanagedCallersOnly]
|
||||
public static HRESULT SetTransformMapperImpl(IUnknown* effect, byte* data, uint dataSize)
|
||||
{
|
||||
PixelShaderEffect* @this = (PixelShaderEffect*)effect;
|
||||
|
||||
|
||||
ファイル差分が大きすぎるため表示されません。
差分を読み込み
@@ -1,10 +1,7 @@
|
||||
<#@ template debug="false" hostspecific="false" language="C#" #>
|
||||
<#@ assembly name="System.Core" #>
|
||||
<#@ output extension=".g.cs"#>
|
||||
using System.Runtime.CompilerServices;
|
||||
#if !NET6_OR_GREATER
|
||||
using System.Runtime.InteropServices;
|
||||
#endif
|
||||
using ComputeSharp.Win32;
|
||||
|
||||
namespace ComputeSharp.D2D1.Interop.Effects;
|
||||
@@ -12,87 +9,20 @@ namespace ComputeSharp.D2D1.Interop.Effects;
|
||||
/// <inheritdoc/>
|
||||
unsafe partial struct PixelShaderEffect
|
||||
{
|
||||
#if !NET6_0_OR_GREATER
|
||||
<#
|
||||
for (int i = 0; i < 16; i++)
|
||||
{
|
||||
#>
|
||||
/// <summary>
|
||||
/// A cached <see cref="PropertyGetFunctionDelegate"/> instance wrapping <see cref="GetResourceTextureManager<#=i#>"/>.
|
||||
/// </summary>
|
||||
private static readonly PropertyGetFunctionDelegate GetResourceTextureManager<#=i#>Wrapper = GetResourceTextureManager<#=i#>Impl;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="PropertySetFunctionDelegate"/> instance wrapping <see cref="SetResourceTextureManager<#=i#>"/>.
|
||||
/// </summary>
|
||||
private static readonly PropertySetFunctionDelegate SetResourceTextureManager<#=i#>Wrapper = SetResourceTextureManager<#=i#>Impl;
|
||||
<#
|
||||
if (i < 15) WriteLine("");
|
||||
}
|
||||
#>
|
||||
#endif
|
||||
|
||||
<#
|
||||
for (int i = 0; i < 16; i++)
|
||||
{
|
||||
#>
|
||||
/// <summary>
|
||||
/// Gets the get accessor for the resource manager at index <#=i#>.
|
||||
/// </summary>
|
||||
#if NET6_0_OR_GREATER
|
||||
public static delegate* unmanaged[Stdcall]<IUnknown*, byte*, uint, uint*, int> GetResourceTextureManager<#=i#>
|
||||
#else
|
||||
public static void* GetResourceTextureManager<#=i#>
|
||||
#endif
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
get
|
||||
{
|
||||
#if NET6_0_OR_GREATER
|
||||
return &GetResourceTextureManager<#=i#>Impl;
|
||||
#else
|
||||
return (void*)Marshal.GetFunctionPointerForDelegate(GetResourceTextureManager<#=i#>Wrapper);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the set accessor for the resource manager at index <#=i#>.
|
||||
/// </summary>
|
||||
#if NET6_0_OR_GREATER
|
||||
public static delegate* unmanaged[Stdcall]<IUnknown*, byte*, uint, int> SetResourceTextureManager<#=i#>
|
||||
#else
|
||||
public static void* SetResourceTextureManager<#=i#>
|
||||
#endif
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
get
|
||||
{
|
||||
#if NET6_0_OR_GREATER
|
||||
return &SetResourceTextureManager<#=i#>Impl;
|
||||
#else
|
||||
return (void*)Marshal.GetFunctionPointerForDelegate(SetResourceTextureManager<#=i#>Wrapper);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
<#
|
||||
}
|
||||
#>
|
||||
<#
|
||||
for (int i = 0; i < 16; i++)
|
||||
{
|
||||
#>
|
||||
/// <inheritdoc cref="D2D1_PROPERTY_BINDING.getFunction"/>
|
||||
[UnmanagedCallersOnly(CallConvs = new[] { typeof(CallConvStdcall) })]
|
||||
private static int GetResourceTextureManager<#=i#>Impl(IUnknown* effect, byte* data, uint dataSize, uint* actualSize)
|
||||
[UnmanagedCallersOnly]
|
||||
public static HRESULT GetResourceTextureManager<#=i#>Impl(IUnknown* effect, byte* data, uint dataSize, uint* actualSize)
|
||||
{
|
||||
return ((PixelShaderEffect*)effect)->GetResourceTextureManagerAtIndex(<#=i#>, data, dataSize, actualSize);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="D2D1_PROPERTY_BINDING.getFunction"/>
|
||||
[UnmanagedCallersOnly(CallConvs = new[] { typeof(CallConvStdcall) })]
|
||||
private static int SetResourceTextureManager<#=i#>Impl(IUnknown* effect, byte* data, uint dataSize)
|
||||
[UnmanagedCallersOnly]
|
||||
public static HRESULT SetResourceTextureManager<#=i#>Impl(IUnknown* effect, byte* data, uint dataSize)
|
||||
{
|
||||
return ((PixelShaderEffect*)effect)->SetResourceTextureManagerAtIndex(<#=i#>, data, dataSize);
|
||||
}
|
||||
|
||||
@@ -12,20 +12,6 @@ namespace ComputeSharp.D2D1.Interop.Effects;
|
||||
/// </summary>
|
||||
internal unsafe partial struct PixelShaderEffect
|
||||
{
|
||||
#if !NET6_0_OR_GREATER
|
||||
/// <inheritdoc cref="QueryInterface"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate int QueryInterfaceDelegate(PixelShaderEffect* @this, Guid* riid, void** ppvObject);
|
||||
|
||||
/// <inheritdoc cref="AddRef"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate uint AddRefDelegate(PixelShaderEffect* @this);
|
||||
|
||||
/// <inheritdoc cref="Release"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate uint ReleaseDelegate(PixelShaderEffect* @this);
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// The shared vtable pointer for <see cref="PixelShaderEffect"/> instance, for <see cref="ID2D1EffectImplMethods"/>.
|
||||
/// </summary>
|
||||
@@ -45,24 +31,14 @@ internal unsafe partial struct PixelShaderEffect
|
||||
void** lpVtbl = (void**)D2D1AssemblyAssociatedMemory.Allocate(sizeof(void*) * 14);
|
||||
|
||||
// ID2D1EffectImpl
|
||||
#if NET6_0_OR_GREATER
|
||||
lpVtbl[0] = (delegate* unmanaged<PixelShaderEffect*, Guid*, void**, int>)&ID2D1EffectImplMethods.QueryInterface;
|
||||
lpVtbl[1] = (delegate* unmanaged<PixelShaderEffect*, uint>)&ID2D1EffectImplMethods.AddRef;
|
||||
lpVtbl[2] = (delegate* unmanaged<PixelShaderEffect*, uint>)&ID2D1EffectImplMethods.Release;
|
||||
lpVtbl[3] = (delegate* unmanaged<PixelShaderEffect*, ID2D1EffectContext*, ID2D1TransformGraph*, int>)&ID2D1EffectImplMethods.Initialize;
|
||||
lpVtbl[4] = (delegate* unmanaged<PixelShaderEffect*, D2D1_CHANGE_TYPE, int>)&ID2D1EffectImplMethods.PrepareForRender;
|
||||
lpVtbl[5] = (delegate* unmanaged<PixelShaderEffect*, ID2D1TransformGraph*, int>)&ID2D1EffectImplMethods.SetGraph;
|
||||
#else
|
||||
lpVtbl[0] = (void*)Marshal.GetFunctionPointerForDelegate(ID2D1EffectImplMethods.QueryInterfaceWrapper);
|
||||
lpVtbl[1] = (void*)Marshal.GetFunctionPointerForDelegate(ID2D1EffectImplMethods.AddRefWrapper);
|
||||
lpVtbl[2] = (void*)Marshal.GetFunctionPointerForDelegate(ID2D1EffectImplMethods.ReleaseWrapper);
|
||||
lpVtbl[3] = (void*)Marshal.GetFunctionPointerForDelegate(ID2D1EffectImplMethods.InitializeWrapper);
|
||||
lpVtbl[4] = (void*)Marshal.GetFunctionPointerForDelegate(ID2D1EffectImplMethods.PrepareForRenderWrapper);
|
||||
lpVtbl[5] = (void*)Marshal.GetFunctionPointerForDelegate(ID2D1EffectImplMethods.SetGraphWrapper);
|
||||
#endif
|
||||
|
||||
// ID2D1DrawTransform
|
||||
#if NET6_0_OR_GREATER
|
||||
lpVtbl[6 + 0] = (delegate* unmanaged<PixelShaderEffect*, Guid*, void**, int>)&ID2D1DrawTransformMethods.QueryInterface;
|
||||
lpVtbl[6 + 1] = (delegate* unmanaged<PixelShaderEffect*, uint>)&ID2D1DrawTransformMethods.AddRef;
|
||||
lpVtbl[6 + 2] = (delegate* unmanaged<PixelShaderEffect*, uint>)&ID2D1DrawTransformMethods.Release;
|
||||
@@ -71,16 +47,6 @@ internal unsafe partial struct PixelShaderEffect
|
||||
lpVtbl[6 + 5] = (delegate* unmanaged<PixelShaderEffect*, RECT*, RECT*, uint, RECT*, RECT*, int>)&ID2D1DrawTransformMethods.MapInputRectsToOutputRect;
|
||||
lpVtbl[6 + 6] = (delegate* unmanaged<PixelShaderEffect*, uint, RECT, RECT*, int>)&ID2D1DrawTransformMethods.MapInvalidRect;
|
||||
lpVtbl[6 + 7] = (delegate* unmanaged<PixelShaderEffect*, ID2D1DrawInfo*, int>)&ID2D1DrawTransformMethods.SetDrawInfo;
|
||||
#else
|
||||
lpVtbl[6 + 0] = (void*)Marshal.GetFunctionPointerForDelegate(ID2D1DrawTransformMethods.QueryInterfaceWrapper);
|
||||
lpVtbl[6 + 1] = (void*)Marshal.GetFunctionPointerForDelegate(ID2D1DrawTransformMethods.AddRefWrapper);
|
||||
lpVtbl[6 + 2] = (void*)Marshal.GetFunctionPointerForDelegate(ID2D1DrawTransformMethods.ReleaseWrapper);
|
||||
lpVtbl[6 + 3] = (void*)Marshal.GetFunctionPointerForDelegate(ID2D1DrawTransformMethods.GetInputCountWrapper);
|
||||
lpVtbl[6 + 4] = (void*)Marshal.GetFunctionPointerForDelegate(ID2D1DrawTransformMethods.MapOutputRectToInputRectsWrapper);
|
||||
lpVtbl[6 + 5] = (void*)Marshal.GetFunctionPointerForDelegate(ID2D1DrawTransformMethods.MapInputRectsToOutputRectWrapper);
|
||||
lpVtbl[6 + 6] = (void*)Marshal.GetFunctionPointerForDelegate(ID2D1DrawTransformMethods.MapInvalidRectWrapper);
|
||||
lpVtbl[6 + 7] = (void*)Marshal.GetFunctionPointerForDelegate(ID2D1DrawTransformMethods.SetDrawInfoWrapper);
|
||||
#endif
|
||||
|
||||
return lpVtbl;
|
||||
}
|
||||
|
||||
-48
@@ -124,54 +124,6 @@ unsafe partial struct D2D1ResourceTextureManagerImpl
|
||||
/// </summary>
|
||||
private static class ID2D1ResourceTextureManagerMethods
|
||||
{
|
||||
#if !NET6_0_OR_GREATER
|
||||
/// <inheritdoc cref="Initialize"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
public delegate int InitializeDelegate(
|
||||
D2D1ResourceTextureManagerImpl* @this,
|
||||
Guid* resourceId,
|
||||
D2D1_RESOURCE_TEXTURE_PROPERTIES* resourceTextureProperties,
|
||||
byte* data,
|
||||
uint* strides,
|
||||
uint dataSize);
|
||||
|
||||
/// <inheritdoc cref="Update"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
public delegate int UpdateDelegate(
|
||||
D2D1ResourceTextureManagerImpl* @this,
|
||||
uint* minimumExtents,
|
||||
uint* maximimumExtents,
|
||||
uint* strides,
|
||||
uint dimensions,
|
||||
byte* data,
|
||||
uint dataCount);
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="QueryInterfaceDelegate"/> instance wrapping <see cref="QueryInterface"/>.
|
||||
/// </summary>
|
||||
public static readonly QueryInterfaceDelegate QueryInterfaceWrapper = QueryInterface;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="AddRefDelegate"/> instance wrapping <see cref="AddRef"/>.
|
||||
/// </summary>
|
||||
public static readonly AddRefDelegate AddRefWrapper = AddRef;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="ReleaseDelegate"/> instance wrapping <see cref="Release"/>.
|
||||
/// </summary>
|
||||
public static readonly ReleaseDelegate ReleaseWrapper = Release;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="InitializeDelegate"/> instance wrapping <see cref="Initialize"/>.
|
||||
/// </summary>
|
||||
public static readonly InitializeDelegate InitializeWrapper = Initialize;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="UpdateDelegate"/> instance wrapping <see cref="Update"/>.
|
||||
/// </summary>
|
||||
public static readonly UpdateDelegate UpdateWrapper = Update;
|
||||
#endif
|
||||
|
||||
/// <inheritdoc cref="D2D1ResourceTextureManagerImpl.QueryInterface"/>
|
||||
[UnmanagedCallersOnly]
|
||||
public static int QueryInterface(D2D1ResourceTextureManagerImpl* @this, Guid* riid, void** ppvObject)
|
||||
|
||||
-35
@@ -13,41 +13,6 @@ partial struct D2D1ResourceTextureManagerImpl
|
||||
/// </summary>
|
||||
private static unsafe class ID2D1ResourceTextureManagerInternalMethods
|
||||
{
|
||||
#if !NET6_0_OR_GREATER
|
||||
/// <inheritdoc cref="Initialize"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
public delegate int InitializeDelegate(D2D1ResourceTextureManagerImpl* @this, ID2D1EffectContext* effectContext, uint* dimensions);
|
||||
|
||||
/// <inheritdoc cref="GetResourceTexture"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
public delegate int GetResourceTextureDelegate(D2D1ResourceTextureManagerImpl* @this, ID2D1ResourceTexture** resourceTexture);
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="QueryInterfaceDelegate"/> instance wrapping <see cref="QueryInterface"/>.
|
||||
/// </summary>
|
||||
public static readonly QueryInterfaceDelegate QueryInterfaceWrapper = QueryInterface;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="AddRefDelegate"/> instance wrapping <see cref="AddRef"/>.
|
||||
/// </summary>
|
||||
public static readonly AddRefDelegate AddRefWrapper = AddRef;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="ReleaseDelegate"/> instance wrapping <see cref="Release"/>.
|
||||
/// </summary>
|
||||
public static readonly ReleaseDelegate ReleaseWrapper = Release;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="InitializeDelegate"/> instance wrapping <see cref="Initialize"/>.
|
||||
/// </summary>
|
||||
public static readonly InitializeDelegate InitializeWrapper = Initialize;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="GetResourceTextureDelegate"/> instance wrapping <see cref="GetResourceTexture"/>.
|
||||
/// </summary>
|
||||
public static readonly GetResourceTextureDelegate GetResourceTextureWrapper = GetResourceTexture;
|
||||
#endif
|
||||
|
||||
/// <inheritdoc cref="D2D1ResourceTextureManagerImpl.QueryInterface"/>
|
||||
[UnmanagedCallersOnly]
|
||||
public static int QueryInterface(D2D1ResourceTextureManagerImpl* @this, Guid* riid, void** ppvObject)
|
||||
|
||||
-30
@@ -12,20 +12,6 @@ namespace ComputeSharp.D2D1.Shaders.Interop.Effects.ResourceManagers;
|
||||
/// </summary>
|
||||
internal unsafe partial struct D2D1ResourceTextureManagerImpl
|
||||
{
|
||||
#if !NET6_0_OR_GREATER
|
||||
/// <inheritdoc cref="QueryInterface"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate int QueryInterfaceDelegate(D2D1ResourceTextureManagerImpl* @this, Guid* riid, void** ppvObject);
|
||||
|
||||
/// <inheritdoc cref="AddRef"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate uint AddRefDelegate(D2D1ResourceTextureManagerImpl* @this);
|
||||
|
||||
/// <inheritdoc cref="Release"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate uint ReleaseDelegate(D2D1ResourceTextureManagerImpl* @this);
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// The shared vtable pointer for <see cref="D2D1ResourceTextureManagerImpl"/> instance, for <see cref="ID2D1ResourceTextureManager"/>.
|
||||
/// </summary>
|
||||
@@ -45,34 +31,18 @@ internal unsafe partial struct D2D1ResourceTextureManagerImpl
|
||||
void** lpVtbl = (void**)D2D1AssemblyAssociatedMemory.Allocate(sizeof(void*) * 10);
|
||||
|
||||
// ID2D1ResourceTextureManager
|
||||
#if NET6_0_OR_GREATER
|
||||
lpVtbl[0] = (delegate* unmanaged<D2D1ResourceTextureManagerImpl*, Guid*, void**, int>)&ID2D1ResourceTextureManagerMethods.QueryInterface;
|
||||
lpVtbl[1] = (delegate* unmanaged<D2D1ResourceTextureManagerImpl*, uint>)&ID2D1ResourceTextureManagerMethods.AddRef;
|
||||
lpVtbl[2] = (delegate* unmanaged<D2D1ResourceTextureManagerImpl*, uint>)&ID2D1ResourceTextureManagerMethods.Release;
|
||||
lpVtbl[3] = (delegate* unmanaged<D2D1ResourceTextureManagerImpl*, Guid*, D2D1_RESOURCE_TEXTURE_PROPERTIES*, byte*, uint*, uint, int>)&ID2D1ResourceTextureManagerMethods.Initialize;
|
||||
lpVtbl[4] = (delegate* unmanaged<D2D1ResourceTextureManagerImpl*, uint*, uint*, uint*, uint, byte*, uint, int>)&ID2D1ResourceTextureManagerMethods.Update;
|
||||
#else
|
||||
lpVtbl[0] = (void*)Marshal.GetFunctionPointerForDelegate(ID2D1ResourceTextureManagerMethods.QueryInterfaceWrapper);
|
||||
lpVtbl[1] = (void*)Marshal.GetFunctionPointerForDelegate(ID2D1ResourceTextureManagerMethods.AddRefWrapper);
|
||||
lpVtbl[2] = (void*)Marshal.GetFunctionPointerForDelegate(ID2D1ResourceTextureManagerMethods.ReleaseWrapper);
|
||||
lpVtbl[3] = (void*)Marshal.GetFunctionPointerForDelegate(ID2D1ResourceTextureManagerMethods.InitializeWrapper);
|
||||
lpVtbl[4] = (void*)Marshal.GetFunctionPointerForDelegate(ID2D1ResourceTextureManagerMethods.UpdateWrapper);
|
||||
#endif
|
||||
|
||||
// ID2D1ResourceTextureManagerInternal
|
||||
#if NET6_0_OR_GREATER
|
||||
lpVtbl[5 + 0] = (delegate* unmanaged<D2D1ResourceTextureManagerImpl*, Guid*, void**, int>)&ID2D1ResourceTextureManagerInternalMethods.QueryInterface;
|
||||
lpVtbl[5 + 1] = (delegate* unmanaged<D2D1ResourceTextureManagerImpl*, uint>)&ID2D1ResourceTextureManagerInternalMethods.AddRef;
|
||||
lpVtbl[5 + 2] = (delegate* unmanaged<D2D1ResourceTextureManagerImpl*, uint>)&ID2D1ResourceTextureManagerInternalMethods.Release;
|
||||
lpVtbl[5 + 3] = (delegate* unmanaged<D2D1ResourceTextureManagerImpl*, ID2D1EffectContext*, uint*, int>)&ID2D1ResourceTextureManagerInternalMethods.Initialize;
|
||||
lpVtbl[5 + 4] = (delegate* unmanaged<D2D1ResourceTextureManagerImpl*, ID2D1ResourceTexture**, int>)&ID2D1ResourceTextureManagerInternalMethods.GetResourceTexture;
|
||||
#else
|
||||
lpVtbl[5 + 0] = (void*)Marshal.GetFunctionPointerForDelegate(ID2D1ResourceTextureManagerInternalMethods.QueryInterfaceWrapper);
|
||||
lpVtbl[5 + 1] = (void*)Marshal.GetFunctionPointerForDelegate(ID2D1ResourceTextureManagerInternalMethods.AddRefWrapper);
|
||||
lpVtbl[5 + 2] = (void*)Marshal.GetFunctionPointerForDelegate(ID2D1ResourceTextureManagerInternalMethods.ReleaseWrapper);
|
||||
lpVtbl[5 + 3] = (void*)Marshal.GetFunctionPointerForDelegate(ID2D1ResourceTextureManagerInternalMethods.InitializeWrapper);
|
||||
lpVtbl[5 + 4] = (void*)Marshal.GetFunctionPointerForDelegate(ID2D1ResourceTextureManagerInternalMethods.GetResourceTextureWrapper);
|
||||
#endif
|
||||
|
||||
return lpVtbl;
|
||||
}
|
||||
|
||||
-44
@@ -12,50 +12,6 @@ partial struct D2D1DrawInfoUpdateContextImpl
|
||||
/// </summary>
|
||||
private static unsafe class ID2D1DrawInfoUpdateContextMethods
|
||||
{
|
||||
#if !NET6_0_OR_GREATER
|
||||
/// <inheritdoc cref="GetConstantBufferSize"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
public delegate int GetConstantBufferSizeDelegate(D2D1DrawInfoUpdateContextImpl* @this, uint* size);
|
||||
|
||||
/// <inheritdoc cref="GetConstantBuffer"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
public delegate int GetConstantBufferDelegate(D2D1DrawInfoUpdateContextImpl* @this, byte* buffer, uint bufferCount);
|
||||
|
||||
/// <inheritdoc cref="SetConstantBuffer"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
public delegate int SetConstantBufferDelegate(D2D1DrawInfoUpdateContextImpl* @this, byte* buffer, uint bufferCount);
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="QueryInterfaceDelegate"/> instance wrapping <see cref="QueryInterface"/>.
|
||||
/// </summary>
|
||||
public static readonly QueryInterfaceDelegate QueryInterfaceWrapper = QueryInterface;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="AddRefDelegate"/> instance wrapping <see cref="AddRef"/>.
|
||||
/// </summary>
|
||||
public static readonly AddRefDelegate AddRefWrapper = AddRef;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="ReleaseDelegate"/> instance wrapping <see cref="Release"/>.
|
||||
/// </summary>
|
||||
public static readonly ReleaseDelegate ReleaseWrapper = Release;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="GetConstantBufferSizeDelegate"/> instance wrapping <see cref="GetConstantBufferSize"/>.
|
||||
/// </summary>
|
||||
public static readonly GetConstantBufferSizeDelegate GetConstantBufferSizeWrapper = GetConstantBufferSize;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="GetConstantBufferDelegate"/> instance wrapping <see cref="GetConstantBuffer"/>.
|
||||
/// </summary>
|
||||
public static readonly GetConstantBufferDelegate GetConstantBufferWrapper = GetConstantBuffer;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="SetConstantBufferDelegate"/> instance wrapping <see cref="SetConstantBuffer"/>.
|
||||
/// </summary>
|
||||
public static readonly SetConstantBufferDelegate SetConstantBufferWrapper = SetConstantBuffer;
|
||||
#endif
|
||||
|
||||
/// <inheritdoc cref="D2D1DrawInfoUpdateContextImpl.QueryInterface"/>
|
||||
[UnmanagedCallersOnly]
|
||||
public static int QueryInterface(D2D1DrawInfoUpdateContextImpl* @this, Guid* riid, void** ppvObject)
|
||||
|
||||
-26
@@ -20,32 +20,6 @@ unsafe partial struct D2D1DrawInfoUpdateContextImpl
|
||||
/// </summary>
|
||||
private static class ID2D1DrawInfoUpdateContextInternalMethods
|
||||
{
|
||||
#if !NET6_0_OR_GREATER
|
||||
/// <inheritdoc cref="Close"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
public delegate int CloseDelegate(D2D1DrawInfoUpdateContextImpl* @this);
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="QueryInterfaceDelegate"/> instance wrapping <see cref="QueryInterface"/>.
|
||||
/// </summary>
|
||||
public static readonly QueryInterfaceDelegate QueryInterfaceWrapper = QueryInterface;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="AddRefDelegate"/> instance wrapping <see cref="AddRef"/>.
|
||||
/// </summary>
|
||||
public static readonly AddRefDelegate AddRefWrapper = AddRef;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="ReleaseDelegate"/> instance wrapping <see cref="Release"/>.
|
||||
/// </summary>
|
||||
public static readonly ReleaseDelegate ReleaseWrapper = Release;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="CloseDelegate"/> instance wrapping <see cref="Close"/>.
|
||||
/// </summary>
|
||||
public static readonly CloseDelegate CloseWrapper = Close;
|
||||
#endif
|
||||
|
||||
/// <inheritdoc cref="D2D1DrawInfoUpdateContextImpl.QueryInterface"/>
|
||||
[UnmanagedCallersOnly]
|
||||
public static int QueryInterface(D2D1DrawInfoUpdateContextImpl* @this, Guid* riid, void** ppvObject)
|
||||
|
||||
-30
@@ -12,20 +12,6 @@ namespace ComputeSharp.D2D1.Shaders.Interop.Effects.TransformMappers;
|
||||
/// </summary>
|
||||
internal unsafe partial struct D2D1DrawInfoUpdateContextImpl
|
||||
{
|
||||
#if !NET6_0_OR_GREATER
|
||||
/// <inheritdoc cref="QueryInterface"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate int QueryInterfaceDelegate(D2D1DrawInfoUpdateContextImpl* @this, Guid* riid, void** ppvObject);
|
||||
|
||||
/// <inheritdoc cref="AddRef"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate uint AddRefDelegate(D2D1DrawInfoUpdateContextImpl* @this);
|
||||
|
||||
/// <inheritdoc cref="Release"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate uint ReleaseDelegate(D2D1DrawInfoUpdateContextImpl* @this);
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// The shared vtable pointer for <see cref="D2D1DrawInfoUpdateContextImpl"/> instance, for <see cref="ID2D1DrawInfoUpdateContext"/>.
|
||||
/// </summary>
|
||||
@@ -45,34 +31,18 @@ internal unsafe partial struct D2D1DrawInfoUpdateContextImpl
|
||||
void** lpVtbl = (void**)D2D1AssemblyAssociatedMemory.Allocate(sizeof(void*) * 10);
|
||||
|
||||
// ID2D1ResourceTextureManager
|
||||
#if NET6_0_OR_GREATER
|
||||
lpVtbl[0] = (delegate* unmanaged<D2D1DrawInfoUpdateContextImpl*, Guid*, void**, int>)&ID2D1DrawInfoUpdateContextMethods.QueryInterface;
|
||||
lpVtbl[1] = (delegate* unmanaged<D2D1DrawInfoUpdateContextImpl*, uint>)&ID2D1DrawInfoUpdateContextMethods.AddRef;
|
||||
lpVtbl[2] = (delegate* unmanaged<D2D1DrawInfoUpdateContextImpl*, uint>)&ID2D1DrawInfoUpdateContextMethods.Release;
|
||||
lpVtbl[3] = (delegate* unmanaged<D2D1DrawInfoUpdateContextImpl*, uint*, int>)&ID2D1DrawInfoUpdateContextMethods.GetConstantBufferSize;
|
||||
lpVtbl[4] = (delegate* unmanaged<D2D1DrawInfoUpdateContextImpl*, byte*, uint, int>)&ID2D1DrawInfoUpdateContextMethods.GetConstantBuffer;
|
||||
lpVtbl[5] = (delegate* unmanaged<D2D1DrawInfoUpdateContextImpl*, byte*, uint, int>)&ID2D1DrawInfoUpdateContextMethods.SetConstantBuffer;
|
||||
#else
|
||||
lpVtbl[0] = (void*)Marshal.GetFunctionPointerForDelegate(ID2D1DrawInfoUpdateContextMethods.QueryInterfaceWrapper);
|
||||
lpVtbl[1] = (void*)Marshal.GetFunctionPointerForDelegate(ID2D1DrawInfoUpdateContextMethods.AddRefWrapper);
|
||||
lpVtbl[2] = (void*)Marshal.GetFunctionPointerForDelegate(ID2D1DrawInfoUpdateContextMethods.ReleaseWrapper);
|
||||
lpVtbl[3] = (void*)Marshal.GetFunctionPointerForDelegate(ID2D1DrawInfoUpdateContextMethods.GetConstantBufferSizeWrapper);
|
||||
lpVtbl[4] = (void*)Marshal.GetFunctionPointerForDelegate(ID2D1DrawInfoUpdateContextMethods.GetConstantBufferWrapper);
|
||||
lpVtbl[5] = (void*)Marshal.GetFunctionPointerForDelegate(ID2D1DrawInfoUpdateContextMethods.SetConstantBufferWrapper);
|
||||
#endif
|
||||
|
||||
// ID2D1ResourceTextureManagerInternal
|
||||
#if NET6_0_OR_GREATER
|
||||
lpVtbl[6 + 0] = (delegate* unmanaged<D2D1DrawInfoUpdateContextImpl*, Guid*, void**, int>)&ID2D1DrawInfoUpdateContextInternalMethods.QueryInterface;
|
||||
lpVtbl[6 + 1] = (delegate* unmanaged<D2D1DrawInfoUpdateContextImpl*, uint>)&ID2D1DrawInfoUpdateContextInternalMethods.AddRef;
|
||||
lpVtbl[6 + 2] = (delegate* unmanaged<D2D1DrawInfoUpdateContextImpl*, uint>)&ID2D1DrawInfoUpdateContextInternalMethods.Release;
|
||||
lpVtbl[6 + 3] = (delegate* unmanaged<D2D1DrawInfoUpdateContextImpl*, int>)&ID2D1DrawInfoUpdateContextInternalMethods.Close;
|
||||
#else
|
||||
lpVtbl[6 + 0] = (void*)Marshal.GetFunctionPointerForDelegate(ID2D1DrawInfoUpdateContextInternalMethods.QueryInterfaceWrapper);
|
||||
lpVtbl[6 + 1] = (void*)Marshal.GetFunctionPointerForDelegate(ID2D1DrawInfoUpdateContextInternalMethods.AddRefWrapper);
|
||||
lpVtbl[6 + 2] = (void*)Marshal.GetFunctionPointerForDelegate(ID2D1DrawInfoUpdateContextInternalMethods.ReleaseWrapper);
|
||||
lpVtbl[6 + 3] = (void*)Marshal.GetFunctionPointerForDelegate(ID2D1DrawInfoUpdateContextInternalMethods.CloseWrapper);
|
||||
#endif
|
||||
|
||||
return lpVtbl;
|
||||
}
|
||||
|
||||
-59
@@ -16,65 +16,6 @@ unsafe partial struct D2D1TransformMapperImpl
|
||||
/// </summary>
|
||||
private static class ID2D1TransformMapperMethods
|
||||
{
|
||||
#if !NET6_0_OR_GREATER
|
||||
/// <inheritdoc cref="ID2D1TransformMapper.MapInputRectsToOutputRect"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
public delegate int MapInputRectsToOutputRectDelegate(
|
||||
D2D1TransformMapperImpl* @this,
|
||||
ID2D1DrawInfoUpdateContext* d2D1DrawInfoUpdateContext,
|
||||
RECT* inputRects,
|
||||
RECT* inputOpaqueSubRects,
|
||||
uint inputRectCount,
|
||||
RECT* outputRect,
|
||||
RECT* outputOpaqueSubRect);
|
||||
|
||||
/// <inheritdoc cref="ID2D1TransformMapper.MapOutputRectToInputRects"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
public delegate int MapOutputRectToInputRectsDelegate(
|
||||
D2D1TransformMapperImpl* @this,
|
||||
RECT* outputRect,
|
||||
RECT* inputRects,
|
||||
uint inputRectsCount);
|
||||
|
||||
/// <inheritdoc cref="ID2D1TransformMapper.MapInvalidRect"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
public delegate int MapInvalidRectDelegate(
|
||||
D2D1TransformMapperImpl* @this,
|
||||
uint inputIndex,
|
||||
RECT invalidInputRect,
|
||||
RECT* invalidOutputRect);
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="QueryInterfaceDelegate"/> instance wrapping <see cref="QueryInterface"/>.
|
||||
/// </summary>
|
||||
public static readonly QueryInterfaceDelegate QueryInterfaceWrapper = QueryInterface;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="AddRefDelegate"/> instance wrapping <see cref="AddRef"/>.
|
||||
/// </summary>
|
||||
public static readonly AddRefDelegate AddRefWrapper = AddRef;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="ReleaseDelegate"/> instance wrapping <see cref="Release"/>.
|
||||
/// </summary>
|
||||
public static readonly ReleaseDelegate ReleaseWrapper = Release;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="MapInputRectsToOutputRectDelegate"/> instance wrapping <see cref="MapInputRectsToOutputRect"/>.
|
||||
/// </summary>
|
||||
public static readonly MapInputRectsToOutputRectDelegate MapInputRectsToOutputRectWrapper = MapInputRectsToOutputRect;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="MapOutputRectToInputRectsDelegate"/> instance wrapping <see cref="MapOutputRectToInputRects"/>.
|
||||
/// </summary>
|
||||
public static readonly MapOutputRectToInputRectsDelegate MapOutputRectToInputRectsWrapper = MapOutputRectToInputRects;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="MapInvalidRectDelegate"/> instance wrapping <see cref="MapInvalidRect"/>.
|
||||
/// </summary>
|
||||
public static readonly MapInvalidRectDelegate MapInvalidRectWrapper = MapInvalidRect;
|
||||
#endif
|
||||
|
||||
/// <inheritdoc cref="D2D1TransformMapperImpl.QueryInterface"/>
|
||||
[UnmanagedCallersOnly]
|
||||
public static int QueryInterface(D2D1TransformMapperImpl* @this, Guid* riid, void** ppvObject)
|
||||
|
||||
-26
@@ -12,32 +12,6 @@ unsafe partial struct D2D1TransformMapperImpl
|
||||
/// </summary>
|
||||
private static class ID2D1TransformMapperInternalMethods
|
||||
{
|
||||
#if !NET6_0_OR_GREATER
|
||||
/// <inheritdoc cref="ID2D1TransformMapperInternal.GetManagedWrapperHandle"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
public delegate int GetManagedWrapperHandleDelegate(D2D1TransformMapperImpl* @this, void** ppvHandle);
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="QueryInterfaceDelegate"/> instance wrapping <see cref="QueryInterface"/>.
|
||||
/// </summary>
|
||||
public static readonly QueryInterfaceDelegate QueryInterfaceWrapper = QueryInterface;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="AddRefDelegate"/> instance wrapping <see cref="AddRef"/>.
|
||||
/// </summary>
|
||||
public static readonly AddRefDelegate AddRefWrapper = AddRef;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="ReleaseDelegate"/> instance wrapping <see cref="Release"/>.
|
||||
/// </summary>
|
||||
public static readonly ReleaseDelegate ReleaseWrapper = Release;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="GetManagedWrapperHandleDelegate"/> instance wrapping <see cref="GetManagedWrapperHandle"/>.
|
||||
/// </summary>
|
||||
public static readonly GetManagedWrapperHandleDelegate GetManagedWrapperHandleWrapper = GetManagedWrapperHandle;
|
||||
#endif
|
||||
|
||||
/// <inheritdoc cref="D2D1TransformMapperImpl.QueryInterface"/>
|
||||
[UnmanagedCallersOnly]
|
||||
public static int QueryInterface(D2D1TransformMapperImpl* @this, Guid* riid, void** ppvObject)
|
||||
|
||||
-30
@@ -14,20 +14,6 @@ namespace ComputeSharp.D2D1.Shaders.Interop.Effects.TransformMappers;
|
||||
/// </summary>
|
||||
internal unsafe partial struct D2D1TransformMapperImpl
|
||||
{
|
||||
#if !NET6_0_OR_GREATER
|
||||
/// <inheritdoc cref="IUnknown.QueryInterface"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate int QueryInterfaceDelegate(D2D1TransformMapperImpl* @this, Guid* riid, void** ppvObject);
|
||||
|
||||
/// <inheritdoc cref="IUnknown.AddRef"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate uint AddRefDelegate(D2D1TransformMapperImpl* @this);
|
||||
|
||||
/// <inheritdoc cref="IUnknown.Release"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate uint ReleaseDelegate(D2D1TransformMapperImpl* @this);
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// The shared vtable pointer for <see cref="D2D1TransformMapperImpl"/> instance, for <see cref="ID2D1TransformMapper"/>.
|
||||
/// </summary>
|
||||
@@ -47,34 +33,18 @@ internal unsafe partial struct D2D1TransformMapperImpl
|
||||
void** lpVtbl = (void**)D2D1AssemblyAssociatedMemory.Allocate(sizeof(void*) * 10);
|
||||
|
||||
// ID2D1ResourceTextureManager
|
||||
#if NET6_0_OR_GREATER
|
||||
lpVtbl[0] = (delegate* unmanaged<D2D1TransformMapperImpl*, Guid*, void**, int>)&ID2D1TransformMapperMethods.QueryInterface;
|
||||
lpVtbl[1] = (delegate* unmanaged<D2D1TransformMapperImpl*, uint>)&ID2D1TransformMapperMethods.AddRef;
|
||||
lpVtbl[2] = (delegate* unmanaged<D2D1TransformMapperImpl*, uint>)&ID2D1TransformMapperMethods.Release;
|
||||
lpVtbl[3] = (delegate* unmanaged<D2D1TransformMapperImpl*, ID2D1DrawInfoUpdateContext*, RECT*, RECT*, uint, RECT*, RECT*, int>)&ID2D1TransformMapperMethods.MapInputRectsToOutputRect;
|
||||
lpVtbl[4] = (delegate* unmanaged<D2D1TransformMapperImpl*, RECT*, RECT*, uint, int>)&ID2D1TransformMapperMethods.MapOutputRectToInputRects;
|
||||
lpVtbl[5] = (delegate* unmanaged<D2D1TransformMapperImpl*, uint, RECT, RECT*, int>)&ID2D1TransformMapperMethods.MapInvalidRect;
|
||||
#else
|
||||
lpVtbl[0] = (void*)Marshal.GetFunctionPointerForDelegate(ID2D1TransformMapperMethods.QueryInterfaceWrapper);
|
||||
lpVtbl[1] = (void*)Marshal.GetFunctionPointerForDelegate(ID2D1TransformMapperMethods.AddRefWrapper);
|
||||
lpVtbl[2] = (void*)Marshal.GetFunctionPointerForDelegate(ID2D1TransformMapperMethods.ReleaseWrapper);
|
||||
lpVtbl[3] = (void*)Marshal.GetFunctionPointerForDelegate(ID2D1TransformMapperMethods.MapInputRectsToOutputRectWrapper);
|
||||
lpVtbl[4] = (void*)Marshal.GetFunctionPointerForDelegate(ID2D1TransformMapperMethods.MapOutputRectToInputRectsWrapper);
|
||||
lpVtbl[5] = (void*)Marshal.GetFunctionPointerForDelegate(ID2D1TransformMapperMethods.MapInvalidRectWrapper);
|
||||
#endif
|
||||
|
||||
// ID2D1TransformMapperInternal
|
||||
#if NET6_0_OR_GREATER
|
||||
lpVtbl[6 + 0] = (delegate* unmanaged<D2D1TransformMapperImpl*, Guid*, void**, int>)&ID2D1TransformMapperInternalMethods.QueryInterface;
|
||||
lpVtbl[6 + 1] = (delegate* unmanaged<D2D1TransformMapperImpl*, uint>)&ID2D1TransformMapperInternalMethods.AddRef;
|
||||
lpVtbl[6 + 2] = (delegate* unmanaged<D2D1TransformMapperImpl*, uint>)&ID2D1TransformMapperInternalMethods.Release;
|
||||
lpVtbl[6 + 3] = (delegate* unmanaged<D2D1TransformMapperImpl*, void**, int>)&ID2D1TransformMapperInternalMethods.GetManagedWrapperHandle;
|
||||
#else
|
||||
lpVtbl[6 + 0] = (void*)Marshal.GetFunctionPointerForDelegate(ID2D1TransformMapperInternalMethods.QueryInterfaceWrapper);
|
||||
lpVtbl[6 + 1] = (void*)Marshal.GetFunctionPointerForDelegate(ID2D1TransformMapperInternalMethods.AddRefWrapper);
|
||||
lpVtbl[6 + 2] = (void*)Marshal.GetFunctionPointerForDelegate(ID2D1TransformMapperInternalMethods.ReleaseWrapper);
|
||||
lpVtbl[6 + 3] = (void*)Marshal.GetFunctionPointerForDelegate(ID2D1TransformMapperInternalMethods.GetManagedWrapperHandleWrapper);
|
||||
#endif
|
||||
|
||||
return lpVtbl;
|
||||
}
|
||||
|
||||
@@ -20,15 +20,8 @@ internal unsafe partial struct ID2D1Factory1
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
[VtblIndex(23)]
|
||||
#if NET6_0_OR_GREATER
|
||||
public HRESULT RegisterEffectFromString([NativeTypeName("const IID &")] Guid* classId, [NativeTypeName("PCWSTR")] ushort* propertyXml, [NativeTypeName("const D2D1_PROPERTY_BINDING *")] D2D1_PROPERTY_BINDING* bindings, [NativeTypeName("UINT32")] uint bindingsCount, [NativeTypeName("const PD2D1_EFFECT_FACTORY")] delegate* unmanaged[Stdcall]<IUnknown**, HRESULT> effectFactory)
|
||||
public HRESULT RegisterEffectFromString([NativeTypeName("const IID &")] Guid* classId, [NativeTypeName("PCWSTR")] ushort* propertyXml, [NativeTypeName("const D2D1_PROPERTY_BINDING *")] D2D1_PROPERTY_BINDING* bindings, [NativeTypeName("UINT32")] uint bindingsCount, [NativeTypeName("const PD2D1_EFFECT_FACTORY")] delegate* unmanaged<IUnknown**, HRESULT> effectFactory)
|
||||
{
|
||||
return ((delegate* unmanaged[Stdcall]<ID2D1Factory1*, Guid*, ushort*, D2D1_PROPERTY_BINDING*, uint, delegate* unmanaged[Stdcall]<IUnknown**, HRESULT>, int>)(lpVtbl[23]))((ID2D1Factory1*)Unsafe.AsPointer(ref this), classId, propertyXml, bindings, bindingsCount, effectFactory);
|
||||
return ((delegate* unmanaged<ID2D1Factory1*, Guid*, ushort*, D2D1_PROPERTY_BINDING*, uint, delegate* unmanaged<IUnknown**, HRESULT>, int>)(lpVtbl[23]))((ID2D1Factory1*)Unsafe.AsPointer(ref this), classId, propertyXml, bindings, bindingsCount, effectFactory);
|
||||
}
|
||||
#else
|
||||
public HRESULT RegisterEffectFromString([NativeTypeName("const IID &")] Guid* classId, [NativeTypeName("PCWSTR")] ushort* propertyXml, [NativeTypeName("const D2D1_PROPERTY_BINDING *")] D2D1_PROPERTY_BINDING* bindings, [NativeTypeName("UINT32")] uint bindingsCount, [NativeTypeName("const PD2D1_EFFECT_FACTORY")] void* effectFactory)
|
||||
{
|
||||
return ((delegate* unmanaged[Stdcall]<ID2D1Factory1*, Guid*, ushort*, D2D1_PROPERTY_BINDING*, uint, void*, int>)(lpVtbl[23]))((ID2D1Factory1*)Unsafe.AsPointer(ref this), classId, propertyXml, bindings, bindingsCount, effectFactory);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -13,16 +13,8 @@ internal unsafe partial struct D2D1_PROPERTY_BINDING
|
||||
public ushort* propertyName;
|
||||
|
||||
[NativeTypeName("PD2D1_PROPERTY_SET_FUNCTION")]
|
||||
#if NET6_0_OR_GREATER
|
||||
public delegate* unmanaged[Stdcall]<IUnknown*, byte*, uint, int> setFunction;
|
||||
#else
|
||||
public void* setFunction;
|
||||
#endif
|
||||
public delegate* unmanaged<IUnknown*, byte*, uint, HRESULT> setFunction;
|
||||
|
||||
[NativeTypeName("PD2D1_PROPERTY_GET_FUNCTION")]
|
||||
#if NET6_0_OR_GREATER
|
||||
public delegate* unmanaged[Stdcall]<IUnknown*, byte*, uint, uint*, int> getFunction;
|
||||
#else
|
||||
public void* getFunction;
|
||||
#endif
|
||||
public delegate* unmanaged<IUnknown*, byte*, uint, uint*, HRESULT> getFunction;
|
||||
}
|
||||
@@ -2,10 +2,8 @@ using System;
|
||||
using System.Numerics;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
#if NET6_0_OR_GREATER
|
||||
using System.Runtime.Intrinsics;
|
||||
using System.Runtime.Intrinsics.X86;
|
||||
#endif
|
||||
|
||||
namespace ComputeSharp;
|
||||
|
||||
@@ -19,10 +17,7 @@ namespace ComputeSharp;
|
||||
/// </summary>
|
||||
/// <remarks>This struct is fully mutable.</remarks>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct Bgra32 : IEquatable<Bgra32>, IPixel<Bgra32, Float4>
|
||||
#if NET6_0_OR_GREATER
|
||||
, ISpanFormattable
|
||||
#endif
|
||||
public struct Bgra32 : IEquatable<Bgra32>, IPixel<Bgra32, Float4>, ISpanFormattable
|
||||
{
|
||||
/// <summary>
|
||||
/// The blue component.
|
||||
@@ -91,7 +86,6 @@ public struct Bgra32 : IEquatable<Bgra32>, IPixel<Bgra32, Float4>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public readonly Float4 ToPixel()
|
||||
{
|
||||
#if NET6_0_OR_GREATER
|
||||
if (Sse2.IsSupported)
|
||||
{
|
||||
int pack = Unsafe.As<Bgra32, int>(ref Unsafe.AsRef(in this));
|
||||
@@ -106,7 +100,7 @@ public struct Bgra32 : IEquatable<Bgra32>, IPixel<Bgra32, Float4>
|
||||
|
||||
return vNorm.AsVector4();
|
||||
}
|
||||
#endif
|
||||
|
||||
Vector4 linear = new(this.R, this.G, this.B, this.A);
|
||||
Vector4 normalized = linear / byte.MaxValue;
|
||||
|
||||
@@ -161,7 +155,6 @@ public struct Bgra32 : IEquatable<Bgra32>, IPixel<Bgra32, Float4>
|
||||
return $"{nameof(Bgra32)}({this.B}, {this.G}, {this.R}, {this.A})";
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
/// <inheritdoc />
|
||||
public string ToString(string? format, IFormatProvider? formatProvider)
|
||||
{
|
||||
@@ -173,5 +166,4 @@ public struct Bgra32 : IEquatable<Bgra32>, IPixel<Bgra32, Float4>
|
||||
{
|
||||
return destination.TryWrite(provider, $"{nameof(Bgra32)}({this.B}, {this.G}, {this.R}, {this.A})", out charsWritten);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -11,10 +11,7 @@ namespace ComputeSharp;
|
||||
/// </para>
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct R16 : IEquatable<R16>, IPixel<R16, float>
|
||||
#if NET6_0_OR_GREATER
|
||||
, ISpanFormattable
|
||||
#endif
|
||||
public struct R16 : IEquatable<R16>, IPixel<R16, float>, ISpanFormattable
|
||||
{
|
||||
/// <summary>
|
||||
/// The red component.
|
||||
@@ -97,7 +94,6 @@ public struct R16 : IEquatable<R16>, IPixel<R16, float>
|
||||
return $"{nameof(R16)}({this.R})";
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
/// <inheritdoc/>
|
||||
public string ToString(string? format, IFormatProvider? formatProvider)
|
||||
{
|
||||
@@ -109,5 +105,4 @@ public struct R16 : IEquatable<R16>, IPixel<R16, float>
|
||||
{
|
||||
return destination.TryWrite(provider, $"{nameof(R16)}({this.R})", out charsWritten);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -11,10 +11,7 @@ namespace ComputeSharp;
|
||||
/// </para>
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct R8 : IEquatable<R8>, IPixel<R8, float>
|
||||
#if NET6_0_OR_GREATER
|
||||
, ISpanFormattable
|
||||
#endif
|
||||
public struct R8 : IEquatable<R8>, IPixel<R8, float>, ISpanFormattable
|
||||
{
|
||||
/// <summary>
|
||||
/// The red component.
|
||||
@@ -97,7 +94,6 @@ public struct R8 : IEquatable<R8>, IPixel<R8, float>
|
||||
return $"{nameof(R8)}({this.R})";
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
/// <inheritdoc/>
|
||||
public string ToString(string? format, IFormatProvider? formatProvider)
|
||||
{
|
||||
@@ -109,5 +105,4 @@ public struct R8 : IEquatable<R8>, IPixel<R8, float>
|
||||
{
|
||||
return destination.TryWrite(provider, $"{nameof(R8)}({this.R})", out charsWritten);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -11,10 +11,7 @@ namespace ComputeSharp;
|
||||
/// </para>
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct Rg16 : IEquatable<Rg16>, IPixel<Rg16, Float2>
|
||||
#if NET6_0_OR_GREATER
|
||||
, ISpanFormattable
|
||||
#endif
|
||||
public struct Rg16 : IEquatable<Rg16>, IPixel<Rg16, Float2>, ISpanFormattable
|
||||
{
|
||||
/// <summary>
|
||||
/// The red component.
|
||||
@@ -104,7 +101,6 @@ public struct Rg16 : IEquatable<Rg16>, IPixel<Rg16, Float2>
|
||||
return $"{nameof(Rg16)}({this.R}, {this.G})";
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
/// <inheritdoc/>
|
||||
public string ToString(string? format, IFormatProvider? formatProvider)
|
||||
{
|
||||
@@ -116,5 +112,4 @@ public struct Rg16 : IEquatable<Rg16>, IPixel<Rg16, Float2>
|
||||
{
|
||||
return destination.TryWrite(provider, $"{nameof(Rg16)}({this.R}, {this.G})", out charsWritten);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -11,10 +11,7 @@ namespace ComputeSharp;
|
||||
/// </para>
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct Rg32 : IEquatable<Rg32>, IPixel<Rg32, Float2>
|
||||
#if NET6_0_OR_GREATER
|
||||
, ISpanFormattable
|
||||
#endif
|
||||
public struct Rg32 : IEquatable<Rg32>, IPixel<Rg32, Float2>, ISpanFormattable
|
||||
{
|
||||
/// <summary>
|
||||
/// The red component.
|
||||
@@ -104,7 +101,6 @@ public struct Rg32 : IEquatable<Rg32>, IPixel<Rg32, Float2>
|
||||
return $"{nameof(Rg32)}({this.R}, {this.G})";
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
/// <inheritdoc/>
|
||||
public string ToString(string? format, IFormatProvider? formatProvider)
|
||||
{
|
||||
@@ -116,5 +112,4 @@ public struct Rg32 : IEquatable<Rg32>, IPixel<Rg32, Float2>
|
||||
{
|
||||
return destination.TryWrite(provider, $"{nameof(Rg32)}({this.R}, {this.G})", out charsWritten);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -2,10 +2,8 @@ using System;
|
||||
using System.Numerics;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
#if NET6_0_OR_GREATER
|
||||
using System.Runtime.Intrinsics;
|
||||
using System.Runtime.Intrinsics.X86;
|
||||
#endif
|
||||
|
||||
namespace ComputeSharp;
|
||||
|
||||
@@ -18,10 +16,7 @@ namespace ComputeSharp;
|
||||
/// </summary>
|
||||
/// <remarks>This struct is fully mutable.</remarks>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct Rgba32 : IEquatable<Rgba32>, IPixel<Rgba32, Float4>
|
||||
#if NET6_0_OR_GREATER
|
||||
, ISpanFormattable
|
||||
#endif
|
||||
public struct Rgba32 : IEquatable<Rgba32>, IPixel<Rgba32, Float4>, ISpanFormattable
|
||||
{
|
||||
/// <summary>
|
||||
/// The red component.
|
||||
@@ -90,7 +85,6 @@ public struct Rgba32 : IEquatable<Rgba32>, IPixel<Rgba32, Float4>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public readonly Float4 ToPixel()
|
||||
{
|
||||
#if NET6_0_OR_GREATER
|
||||
if (Sse2.IsSupported)
|
||||
{
|
||||
int pack = Unsafe.As<Rgba32, int>(ref Unsafe.AsRef(in this));
|
||||
@@ -104,7 +98,7 @@ public struct Rgba32 : IEquatable<Rgba32>, IPixel<Rgba32, Float4>
|
||||
|
||||
return vNorm.AsVector4();
|
||||
}
|
||||
#endif
|
||||
|
||||
Vector4 linear = new(this.R, this.G, this.B, this.A);
|
||||
Vector4 normalized = linear / byte.MaxValue;
|
||||
|
||||
@@ -159,7 +153,6 @@ public struct Rgba32 : IEquatable<Rgba32>, IPixel<Rgba32, Float4>
|
||||
return $"{nameof(Rgba32)}({this.R}, {this.G}, {this.B}, {this.A})";
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
/// <inheritdoc/>
|
||||
public string ToString(string? format, IFormatProvider? formatProvider)
|
||||
{
|
||||
@@ -171,5 +164,4 @@ public struct Rgba32 : IEquatable<Rgba32>, IPixel<Rgba32, Float4>
|
||||
{
|
||||
return destination.TryWrite(provider, $"{nameof(Rgba32)}({this.R}, {this.G}, {this.B}, {this.A})", out charsWritten);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -2,10 +2,8 @@ using System;
|
||||
using System.Numerics;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
#if NET6_0_OR_GREATER
|
||||
using System.Runtime.Intrinsics;
|
||||
using System.Runtime.Intrinsics.X86;
|
||||
#endif
|
||||
|
||||
namespace ComputeSharp;
|
||||
|
||||
@@ -18,10 +16,7 @@ namespace ComputeSharp;
|
||||
/// </summary>
|
||||
/// <remarks>This struct is fully mutable.</remarks>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct Rgba64 : IEquatable<Rgba64>, IPixel<Rgba64, Float4>
|
||||
#if NET6_0_OR_GREATER
|
||||
, ISpanFormattable
|
||||
#endif
|
||||
public struct Rgba64 : IEquatable<Rgba64>, IPixel<Rgba64, Float4>, ISpanFormattable
|
||||
{
|
||||
/// <summary>
|
||||
/// The red component.
|
||||
@@ -90,7 +85,6 @@ public struct Rgba64 : IEquatable<Rgba64>, IPixel<Rgba64, Float4>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public readonly Float4 ToPixel()
|
||||
{
|
||||
#if NET6_0_OR_GREATER
|
||||
if (Sse2.IsSupported)
|
||||
{
|
||||
long pack = Unsafe.As<Rgba64, long>(ref Unsafe.AsRef(in this));
|
||||
@@ -102,7 +96,7 @@ public struct Rgba64 : IEquatable<Rgba64>, IPixel<Rgba64, Float4>
|
||||
|
||||
return vNorm.AsVector4();
|
||||
}
|
||||
#endif
|
||||
|
||||
Vector4 linear = new(this.R, this.G, this.B, this.A);
|
||||
Vector4 normalized = linear / ushort.MaxValue;
|
||||
|
||||
@@ -157,7 +151,6 @@ public struct Rgba64 : IEquatable<Rgba64>, IPixel<Rgba64, Float4>
|
||||
return $"{nameof(Rgba64)}({this.R}, {this.G}, {this.B}, {this.A})";
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
/// <inheritdoc/>
|
||||
public string ToString(string? format, IFormatProvider? formatProvider)
|
||||
{
|
||||
@@ -169,5 +162,4 @@ public struct Rgba64 : IEquatable<Rgba64>, IPixel<Rgba64, Float4>
|
||||
{
|
||||
return destination.TryWrite(provider, $"{nameof(Rgba64)}({this.R}, {this.G}, {this.B}, {this.A})", out charsWritten);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -16,11 +16,7 @@ internal static class ComPtrExtensions
|
||||
/// <returns>The moved <see cref="ComPtr{T}"/> instance.</returns>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static unsafe ComPtr<T> Move<T>(this in ComPtr<T> ptr)
|
||||
#if NET6_0_OR_GREATER
|
||||
where T : unmanaged//, IUnknown.Interface
|
||||
#else
|
||||
where T : unmanaged
|
||||
#endif
|
||||
{
|
||||
ComPtr<T> copy = default;
|
||||
|
||||
|
||||
@@ -35,141 +35,10 @@ unsafe partial class IWICStreamExtensions
|
||||
/// <summary>
|
||||
/// A manual CCW implementation for an <see cref="IStream"/> object wrapping an <see cref="IBufferWriter{T}"/> instance.
|
||||
/// </summary>
|
||||
private unsafe partial struct IBufferWriterWrapper
|
||||
#if NET6_0_OR_GREATER
|
||||
//: IUnknown.Interface
|
||||
#endif
|
||||
private unsafe partial struct IBufferWriterWrapper //: IUnknown.Interface
|
||||
{
|
||||
#if NET6_0_OR_GREATER
|
||||
///// <inheritdoc/>
|
||||
//static Guid* INativeGuid.NativeGuid => (Guid*)default(NotSupportedException).Throw<nint>();
|
||||
#else
|
||||
/// <inheritdoc cref="QueryInterface"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate int QueryInterfaceDelegate(IBufferWriterWrapper* @this, Guid* riid, void** ppvObject);
|
||||
|
||||
/// <inheritdoc cref="AddRef"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate uint AddRefDelegate(IBufferWriterWrapper* @this);
|
||||
|
||||
/// <inheritdoc cref="Release"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate uint ReleaseDelegate(IBufferWriterWrapper* @this);
|
||||
|
||||
/// <inheritdoc cref="Read"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate HRESULT ReadDelegate(IBufferWriterWrapper* @this, void* pv, uint cb, uint* pcbRead);
|
||||
|
||||
/// <inheritdoc cref="Write"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate HRESULT WriteDelegate(IBufferWriterWrapper* @this, void* pv, uint cb, uint* pcbWritten);
|
||||
|
||||
/// <inheritdoc cref="Seek"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate HRESULT SeekDelegate(IBufferWriterWrapper* @this, LARGE_INTEGER dlibMove, uint dwOrigin, ULARGE_INTEGER* plibNewPosition);
|
||||
|
||||
/// <inheritdoc cref="SetSize"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate HRESULT SetSizeDelegate(IBufferWriterWrapper* @this, ULARGE_INTEGER libNewSize);
|
||||
|
||||
/// <inheritdoc cref="CopyTo"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate HRESULT CopyToDelegate(IBufferWriterWrapper* @this, IStream* pstm, ULARGE_INTEGER cb, ULARGE_INTEGER* pcbRead, ULARGE_INTEGER* pcbWritten);
|
||||
|
||||
/// <inheritdoc cref="Commit"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate HRESULT CommitDelegate(IBufferWriterWrapper* @this, uint grfCommitFlags);
|
||||
|
||||
/// <inheritdoc cref="Revert"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate HRESULT RevertDelegate(IBufferWriterWrapper* @this);
|
||||
|
||||
/// <inheritdoc cref="LockRegion"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate HRESULT LockRegionDelegate(IBufferWriterWrapper* @this, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, uint dwLockType);
|
||||
|
||||
/// <inheritdoc cref="UnlockRegion"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate HRESULT UnlockRegionDelegate(IBufferWriterWrapper* @this, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, uint dwLockType);
|
||||
|
||||
/// <inheritdoc cref="Stat"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate HRESULT StatDelegate(IBufferWriterWrapper* @this, STATSTG* pstatstg, uint grfStatFlag);
|
||||
|
||||
/// <inheritdoc cref="Clone"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate HRESULT CloneDelegate(IBufferWriterWrapper* @this, IStream** ppstm);
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="QueryInterfaceDelegate"/> instance wrapping <see cref="QueryInterface"/>.
|
||||
/// </summary>
|
||||
private static readonly QueryInterfaceDelegate QueryInterfaceWrapper = QueryInterface;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="AddRefDelegate"/> instance wrapping <see cref="AddRef"/>.
|
||||
/// </summary>
|
||||
private static readonly AddRefDelegate AddRefWrapper = AddRef;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="ReleaseDelegate"/> instance wrapping <see cref="Release"/>.
|
||||
/// </summary>
|
||||
private static readonly ReleaseDelegate ReleaseWrapper = Release;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="ReadDelegate"/> instance wrapping <see cref="Read"/>.
|
||||
/// </summary>
|
||||
private static readonly ReadDelegate ReadWrapper = Read;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="WriteDelegate"/> instance wrapping <see cref="Write"/>.
|
||||
/// </summary>
|
||||
private static readonly WriteDelegate WriteWrapper = Write;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="SeekDelegate"/> instance wrapping <see cref="Seek"/>.
|
||||
/// </summary>
|
||||
private static readonly SeekDelegate SeekWrapper = Seek;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="SetSizeDelegate"/> instance wrapping <see cref="SetSize"/>.
|
||||
/// </summary>
|
||||
private static readonly SetSizeDelegate SetSizeWrapper = SetSize;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="CopyToDelegate"/> instance wrapping <see cref="CopyTo"/>.
|
||||
/// </summary>
|
||||
private static readonly CopyToDelegate CopyToWrapper = CopyTo;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="CommitDelegate"/> instance wrapping <see cref="Commit"/>.
|
||||
/// </summary>
|
||||
private static readonly CommitDelegate CommitWrapper = Commit;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="RevertDelegate"/> instance wrapping <see cref="Revert"/>.
|
||||
/// </summary>
|
||||
private static readonly RevertDelegate RevertWrapper = Revert;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="LockRegionDelegate"/> instance wrapping <see cref="LockRegion"/>.
|
||||
/// </summary>
|
||||
private static readonly LockRegionDelegate LockRegionWrapper = LockRegion;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="UnlockRegionDelegate"/> instance wrapping <see cref="UnlockRegion"/>.
|
||||
/// </summary>
|
||||
private static readonly UnlockRegionDelegate UnlockRegionWrapper = UnlockRegion;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="StatDelegate"/> instance wrapping <see cref="Stat"/>.
|
||||
/// </summary>
|
||||
private static readonly StatDelegate StatWrapper = Stat;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="CloneDelegate"/> instance wrapping <see cref="Clone"/>.
|
||||
/// </summary>
|
||||
private static readonly CloneDelegate CloneWrapper = Clone;
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// The shared vtable pointer for <see cref="IBufferWriterWrapper"/> instances.
|
||||
@@ -184,7 +53,6 @@ unsafe partial class IWICStreamExtensions
|
||||
{
|
||||
void** lpVtbl = (void**)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(IBufferWriterWrapper), sizeof(void*) * 14);
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
lpVtbl[0] = (delegate* unmanaged<IBufferWriterWrapper*, Guid*, void**, int>)&QueryInterface;
|
||||
lpVtbl[1] = (delegate* unmanaged<IBufferWriterWrapper*, uint>)&AddRef;
|
||||
lpVtbl[2] = (delegate* unmanaged<IBufferWriterWrapper*, uint>)&Release;
|
||||
@@ -199,22 +67,6 @@ unsafe partial class IWICStreamExtensions
|
||||
lpVtbl[11] = (delegate* unmanaged<IBufferWriterWrapper*, ULARGE_INTEGER, ULARGE_INTEGER, uint, HRESULT>)&UnlockRegion;
|
||||
lpVtbl[12] = (delegate* unmanaged<IBufferWriterWrapper*, STATSTG*, uint, HRESULT>)&Stat;
|
||||
lpVtbl[13] = (delegate* unmanaged<IBufferWriterWrapper*, IStream**, HRESULT>)&Clone;
|
||||
#else
|
||||
lpVtbl[0] = (void*)Marshal.GetFunctionPointerForDelegate(QueryInterfaceWrapper);
|
||||
lpVtbl[1] = (void*)Marshal.GetFunctionPointerForDelegate(AddRefWrapper);
|
||||
lpVtbl[2] = (void*)Marshal.GetFunctionPointerForDelegate(ReleaseWrapper);
|
||||
lpVtbl[3] = (void*)Marshal.GetFunctionPointerForDelegate(ReadWrapper);
|
||||
lpVtbl[4] = (void*)Marshal.GetFunctionPointerForDelegate(WriteWrapper);
|
||||
lpVtbl[5] = (void*)Marshal.GetFunctionPointerForDelegate(SeekWrapper);
|
||||
lpVtbl[6] = (void*)Marshal.GetFunctionPointerForDelegate(SetSizeWrapper);
|
||||
lpVtbl[7] = (void*)Marshal.GetFunctionPointerForDelegate(CopyToWrapper);
|
||||
lpVtbl[8] = (void*)Marshal.GetFunctionPointerForDelegate(CommitWrapper);
|
||||
lpVtbl[9] = (void*)Marshal.GetFunctionPointerForDelegate(RevertWrapper);
|
||||
lpVtbl[10] = (void*)Marshal.GetFunctionPointerForDelegate(LockRegionWrapper);
|
||||
lpVtbl[11] = (void*)Marshal.GetFunctionPointerForDelegate(UnlockRegionWrapper);
|
||||
lpVtbl[12] = (void*)Marshal.GetFunctionPointerForDelegate(StatWrapper);
|
||||
lpVtbl[13] = (void*)Marshal.GetFunctionPointerForDelegate(CloneWrapper);
|
||||
#endif
|
||||
|
||||
return lpVtbl;
|
||||
}
|
||||
@@ -260,25 +112,23 @@ unsafe partial class IWICStreamExtensions
|
||||
return Unsafe.As<IBufferWriter<byte>>(this.writerHandle.Target!);
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
/// <inheritdoc/>
|
||||
public HRESULT QueryInterface(Guid* riid, void** ppvObject)
|
||||
private HRESULT QueryInterface(Guid* riid, void** ppvObject)
|
||||
{
|
||||
return ((delegate* unmanaged<IBufferWriterWrapper*, Guid*, void**, HRESULT>)this.lpVtbl[0])((IBufferWriterWrapper*)Unsafe.AsPointer(ref this), riid, ppvObject);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public uint AddRef()
|
||||
private uint AddRef()
|
||||
{
|
||||
return ((delegate* unmanaged<IBufferWriterWrapper*, uint>)this.lpVtbl[1])((IBufferWriterWrapper*)Unsafe.AsPointer(ref this));
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public uint Release()
|
||||
private uint Release()
|
||||
{
|
||||
return ((delegate* unmanaged<IBufferWriterWrapper*, uint>)this.lpVtbl[2])((IBufferWriterWrapper*)Unsafe.AsPointer(ref this));
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <inheritdoc cref="IStream.QueryInterface(Guid*, void**)"/>
|
||||
[UnmanagedCallersOnly]
|
||||
|
||||
@@ -37,141 +37,10 @@ internal static unsafe partial class IWICStreamExtensions
|
||||
/// <summary>
|
||||
/// A manual CCW implementation for an <see cref="IStream"/> object wrapping a <see cref="Stream"/> instance.
|
||||
/// </summary>
|
||||
private unsafe partial struct IStreamWrapper
|
||||
#if NET6_0_OR_GREATER
|
||||
//: IUnknown.Interface
|
||||
#endif
|
||||
private unsafe partial struct IStreamWrapper //: IUnknown.Interface
|
||||
{
|
||||
#if NET6_0_OR_GREATER
|
||||
///// <inheritdoc/>
|
||||
//static Guid* INativeGuid.NativeGuid => (Guid*)default(NotSupportedException).Throw<nint>();
|
||||
#else
|
||||
/// <inheritdoc cref="QueryInterface"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate int QueryInterfaceDelegate(IStreamWrapper* @this, Guid* riid, void** ppvObject);
|
||||
|
||||
/// <inheritdoc cref="AddRef"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate uint AddRefDelegate(IStreamWrapper* @this);
|
||||
|
||||
/// <inheritdoc cref="Release"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate uint ReleaseDelegate(IStreamWrapper* @this);
|
||||
|
||||
/// <inheritdoc cref="Read"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate HRESULT ReadDelegate(IStreamWrapper* @this, void* pv, uint cb, uint* pcbRead);
|
||||
|
||||
/// <inheritdoc cref="Write"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate HRESULT WriteDelegate(IStreamWrapper* @this, void* pv, uint cb, uint* pcbWritten);
|
||||
|
||||
/// <inheritdoc cref="Seek"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate HRESULT SeekDelegate(IStreamWrapper* @this, LARGE_INTEGER dlibMove, uint dwOrigin, ULARGE_INTEGER* plibNewPosition);
|
||||
|
||||
/// <inheritdoc cref="SetSize"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate HRESULT SetSizeDelegate(IStreamWrapper* @this, ULARGE_INTEGER libNewSize);
|
||||
|
||||
/// <inheritdoc cref="CopyTo"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate HRESULT CopyToDelegate(IStreamWrapper* @this, IStream* pstm, ULARGE_INTEGER cb, ULARGE_INTEGER* pcbRead, ULARGE_INTEGER* pcbWritten);
|
||||
|
||||
/// <inheritdoc cref="Commit"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate HRESULT CommitDelegate(IStreamWrapper* @this, uint grfCommitFlags);
|
||||
|
||||
/// <inheritdoc cref="Revert"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate HRESULT RevertDelegate(IStreamWrapper* @this);
|
||||
|
||||
/// <inheritdoc cref="LockRegion"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate HRESULT LockRegionDelegate(IStreamWrapper* @this, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, uint dwLockType);
|
||||
|
||||
/// <inheritdoc cref="UnlockRegion"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate HRESULT UnlockRegionDelegate(IStreamWrapper* @this, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, uint dwLockType);
|
||||
|
||||
/// <inheritdoc cref="Stat"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate HRESULT StatDelegate(IStreamWrapper* @this, STATSTG* pstatstg, uint grfStatFlag);
|
||||
|
||||
/// <inheritdoc cref="Clone"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate HRESULT CloneDelegate(IStreamWrapper* @this, IStream** ppstm);
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="QueryInterfaceDelegate"/> instance wrapping <see cref="QueryInterface"/>.
|
||||
/// </summary>
|
||||
private static readonly QueryInterfaceDelegate QueryInterfaceWrapper = QueryInterface;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="AddRefDelegate"/> instance wrapping <see cref="AddRef"/>.
|
||||
/// </summary>
|
||||
private static readonly AddRefDelegate AddRefWrapper = AddRef;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="ReleaseDelegate"/> instance wrapping <see cref="Release"/>.
|
||||
/// </summary>
|
||||
private static readonly ReleaseDelegate ReleaseWrapper = Release;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="ReadDelegate"/> instance wrapping <see cref="Read"/>.
|
||||
/// </summary>
|
||||
private static readonly ReadDelegate ReadWrapper = Read;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="WriteDelegate"/> instance wrapping <see cref="Write"/>.
|
||||
/// </summary>
|
||||
private static readonly WriteDelegate WriteWrapper = Write;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="SeekDelegate"/> instance wrapping <see cref="Seek"/>.
|
||||
/// </summary>
|
||||
private static readonly SeekDelegate SeekWrapper = Seek;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="SetSizeDelegate"/> instance wrapping <see cref="SetSize"/>.
|
||||
/// </summary>
|
||||
private static readonly SetSizeDelegate SetSizeWrapper = SetSize;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="CopyToDelegate"/> instance wrapping <see cref="CopyTo"/>.
|
||||
/// </summary>
|
||||
private static readonly CopyToDelegate CopyToWrapper = CopyTo;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="CommitDelegate"/> instance wrapping <see cref="Commit"/>.
|
||||
/// </summary>
|
||||
private static readonly CommitDelegate CommitWrapper = Commit;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="RevertDelegate"/> instance wrapping <see cref="Revert"/>.
|
||||
/// </summary>
|
||||
private static readonly RevertDelegate RevertWrapper = Revert;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="LockRegionDelegate"/> instance wrapping <see cref="LockRegion"/>.
|
||||
/// </summary>
|
||||
private static readonly LockRegionDelegate LockRegionWrapper = LockRegion;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="UnlockRegionDelegate"/> instance wrapping <see cref="UnlockRegion"/>.
|
||||
/// </summary>
|
||||
private static readonly UnlockRegionDelegate UnlockRegionWrapper = UnlockRegion;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="StatDelegate"/> instance wrapping <see cref="Stat"/>.
|
||||
/// </summary>
|
||||
private static readonly StatDelegate StatWrapper = Stat;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="CloneDelegate"/> instance wrapping <see cref="Clone"/>.
|
||||
/// </summary>
|
||||
private static readonly CloneDelegate CloneWrapper = Clone;
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// The shared vtable pointer for <see cref="IStreamWrapper"/> instances.
|
||||
@@ -186,7 +55,6 @@ internal static unsafe partial class IWICStreamExtensions
|
||||
{
|
||||
void** lpVtbl = (void**)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(IStreamWrapper), sizeof(void*) * 14);
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
lpVtbl[0] = (delegate* unmanaged<IStreamWrapper*, Guid*, void**, int>)&QueryInterface;
|
||||
lpVtbl[1] = (delegate* unmanaged<IStreamWrapper*, uint>)&AddRef;
|
||||
lpVtbl[2] = (delegate* unmanaged<IStreamWrapper*, uint>)&Release;
|
||||
@@ -201,22 +69,6 @@ internal static unsafe partial class IWICStreamExtensions
|
||||
lpVtbl[11] = (delegate* unmanaged<IStreamWrapper*, ULARGE_INTEGER, ULARGE_INTEGER, uint, HRESULT>)&UnlockRegion;
|
||||
lpVtbl[12] = (delegate* unmanaged<IStreamWrapper*, STATSTG*, uint, HRESULT>)&Stat;
|
||||
lpVtbl[13] = (delegate* unmanaged<IStreamWrapper*, IStream**, HRESULT>)&Clone;
|
||||
#else
|
||||
lpVtbl[0] = (void*)Marshal.GetFunctionPointerForDelegate(QueryInterfaceWrapper);
|
||||
lpVtbl[1] = (void*)Marshal.GetFunctionPointerForDelegate(AddRefWrapper);
|
||||
lpVtbl[2] = (void*)Marshal.GetFunctionPointerForDelegate(ReleaseWrapper);
|
||||
lpVtbl[3] = (void*)Marshal.GetFunctionPointerForDelegate(ReadWrapper);
|
||||
lpVtbl[4] = (void*)Marshal.GetFunctionPointerForDelegate(WriteWrapper);
|
||||
lpVtbl[5] = (void*)Marshal.GetFunctionPointerForDelegate(SeekWrapper);
|
||||
lpVtbl[6] = (void*)Marshal.GetFunctionPointerForDelegate(SetSizeWrapper);
|
||||
lpVtbl[7] = (void*)Marshal.GetFunctionPointerForDelegate(CopyToWrapper);
|
||||
lpVtbl[8] = (void*)Marshal.GetFunctionPointerForDelegate(CommitWrapper);
|
||||
lpVtbl[9] = (void*)Marshal.GetFunctionPointerForDelegate(RevertWrapper);
|
||||
lpVtbl[10] = (void*)Marshal.GetFunctionPointerForDelegate(LockRegionWrapper);
|
||||
lpVtbl[11] = (void*)Marshal.GetFunctionPointerForDelegate(UnlockRegionWrapper);
|
||||
lpVtbl[12] = (void*)Marshal.GetFunctionPointerForDelegate(StatWrapper);
|
||||
lpVtbl[13] = (void*)Marshal.GetFunctionPointerForDelegate(CloneWrapper);
|
||||
#endif
|
||||
|
||||
return lpVtbl;
|
||||
}
|
||||
@@ -262,25 +114,23 @@ internal static unsafe partial class IWICStreamExtensions
|
||||
return Unsafe.As<Stream>(this.streamHandle.Target!);
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
/// <inheritdoc/>
|
||||
public HRESULT QueryInterface(Guid* riid, void** ppvObject)
|
||||
private HRESULT QueryInterface(Guid* riid, void** ppvObject)
|
||||
{
|
||||
return ((delegate* unmanaged<IStreamWrapper*, Guid*, void**, HRESULT>)this.lpVtbl[0])((IStreamWrapper*)Unsafe.AsPointer(ref this), riid, ppvObject);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public uint AddRef()
|
||||
private uint AddRef()
|
||||
{
|
||||
return ((delegate* unmanaged<IStreamWrapper*, uint>)this.lpVtbl[1])((IStreamWrapper*)Unsafe.AsPointer(ref this));
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public uint Release()
|
||||
private uint Release()
|
||||
{
|
||||
return ((delegate* unmanaged<IStreamWrapper*, uint>)this.lpVtbl[2])((IStreamWrapper*)Unsafe.AsPointer(ref this));
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <inheritdoc cref="IStream.QueryInterface(Guid*, void**)"/>
|
||||
[UnmanagedCallersOnly]
|
||||
|
||||
@@ -66,7 +66,6 @@ public static class Texture1DExtensions
|
||||
source.CopyTo(destination.AsSpan(), 0, source.Width);
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
/// <summary>
|
||||
/// Reads the contents of the specified range from the current <see cref="Texture1D{T}"/> instance and writes them into a target array.
|
||||
/// </summary>
|
||||
@@ -82,7 +81,6 @@ public static class Texture1DExtensions
|
||||
|
||||
source.CopyTo(destination.AsSpan(), x);
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Reads the contents of the specified range from the current <see cref="Texture1D{T}"/> instance and writes them into a target array.
|
||||
@@ -117,7 +115,6 @@ public static class Texture1DExtensions
|
||||
source.CopyTo(destination.AsSpan(destinationOffset), 0, source.Width);
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
/// <summary>
|
||||
/// Reads the contents of the specified range from the current <see cref="Texture1D{T}"/> instance and writes them into a target array.
|
||||
/// </summary>
|
||||
@@ -134,7 +131,6 @@ public static class Texture1DExtensions
|
||||
|
||||
source.CopyTo(destination.AsSpan(destinationOffset), x);
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Reads the contents of the specified range from the current <see cref="Texture1D{T}"/> instance and writes them into a target array.
|
||||
@@ -169,7 +165,6 @@ public static class Texture1DExtensions
|
||||
source.CopyTo(destination, 0, source.Width);
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
/// <summary>
|
||||
/// Reads the contents of the specified range from the current <see cref="Texture1D{T}"/> instance and writes them into a target <see cref="Span{T}"/>.
|
||||
/// </summary>
|
||||
@@ -186,7 +181,6 @@ public static class Texture1DExtensions
|
||||
|
||||
source.CopyTo(destination, offsetX, width);
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Reads the contents of the specified range from the current <see cref="Texture1D{T}"/> instance and writes them into a target <see cref="Span{T}"/>.
|
||||
@@ -319,7 +313,6 @@ public static class Texture1DExtensions
|
||||
destination.CopyFrom(source.AsSpan(), 0, destination.Width);
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
/// <summary>
|
||||
/// Writes the contents of a given <typeparamref name="T"/> array to a specified area of the current <see cref="Texture1D{T}"/> instance.
|
||||
/// </summary>
|
||||
@@ -335,7 +328,6 @@ public static class Texture1DExtensions
|
||||
|
||||
destination.CopyFrom(source.AsSpan(), x);
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Writes the contents of a given <typeparamref name="T"/> array to a specified area of the current <see cref="Texture1D{T}"/> instance.
|
||||
@@ -354,7 +346,6 @@ public static class Texture1DExtensions
|
||||
destination.CopyFrom(source.AsSpan(), destinationOffsetX, width);
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
/// <summary>
|
||||
/// Writes the contents of a given <typeparamref name="T"/> array to a specified area of the current <see cref="Texture1D{T}"/> instance.
|
||||
/// </summary>
|
||||
@@ -371,7 +362,6 @@ public static class Texture1DExtensions
|
||||
|
||||
destination.CopyFrom(source.AsSpan(sourceOffset), x);
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Writes the contents of a given <typeparamref name="T"/> array to a specified area of the current <see cref="Texture1D{T}"/> instance.
|
||||
@@ -406,7 +396,6 @@ public static class Texture1DExtensions
|
||||
destination.CopyFrom(source, 0, destination.Width);
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
/// <summary>
|
||||
/// Writes the contents of a given <see cref="ReadOnlySpan{T}"/> to a specified area of the current <see cref="Texture1D{T}"/> instance.
|
||||
/// </summary>
|
||||
@@ -423,7 +412,6 @@ public static class Texture1DExtensions
|
||||
|
||||
destination.CopyFrom(source, offsetX, width);
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Writes the contents of a given <see cref="ReadOnlySpan{T}"/> to a specified area of the current <see cref="Texture1D{T}"/> instance.
|
||||
|
||||
@@ -89,7 +89,6 @@ public static class Texture2DExtensions
|
||||
source.CopyTo(destination.AsSpan(), 0, 0, source.Width, source.Height);
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
/// <summary>
|
||||
/// Reads the contents of the specified range from the current <see cref="Texture2D{T}"/> instance and writes them into a target array.
|
||||
/// </summary>
|
||||
@@ -106,7 +105,6 @@ public static class Texture2DExtensions
|
||||
|
||||
source.CopyTo(destination.AsSpan(), x, y);
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Reads the contents of the specified range from the current <see cref="Texture2D{T}"/> instance and writes them into a target array.
|
||||
@@ -143,7 +141,6 @@ public static class Texture2DExtensions
|
||||
source.CopyTo(destination.AsSpan(destinationOffset), 0, 0, source.Width, source.Height);
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
/// <summary>
|
||||
/// Reads the contents of the specified range from the current <see cref="Texture2D{T}"/> instance and writes them into a target array.
|
||||
/// </summary>
|
||||
@@ -161,7 +158,6 @@ public static class Texture2DExtensions
|
||||
|
||||
source.CopyTo(destination.AsSpan(destinationOffset), x, y);
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Reads the contents of the specified range from the current <see cref="Texture2D{T}"/> instance and writes them into a target array.
|
||||
@@ -198,7 +194,6 @@ public static class Texture2DExtensions
|
||||
source.CopyTo(destination, 0, 0, source.Width, source.Height);
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
/// <summary>
|
||||
/// Reads the contents of the specified range from the current <see cref="Texture2D{T}"/> instance and writes them into a target <see cref="Span{T}"/>.
|
||||
/// </summary>
|
||||
@@ -217,7 +212,6 @@ public static class Texture2DExtensions
|
||||
|
||||
source.CopyTo(destination, offsetX, offsetY, width, height);
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Reads the contents of the specified range from the current <see cref="Texture2D{T}"/> instance and writes them into a target <see cref="Span{T}"/>.
|
||||
@@ -379,7 +373,6 @@ public static class Texture2DExtensions
|
||||
destination.CopyFrom(source.AsSpan(), 0, 0, destination.Width, destination.Height);
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
/// <summary>
|
||||
/// Writes the contents of a given <typeparamref name="T"/> array to a specified area of the current <see cref="Texture2D{T}"/> instance.
|
||||
/// </summary>
|
||||
@@ -396,7 +389,6 @@ public static class Texture2DExtensions
|
||||
|
||||
destination.CopyFrom(source.AsSpan(), x, y);
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Writes the contents of a given <typeparamref name="T"/> array to a specified area of the current <see cref="Texture2D{T}"/> instance.
|
||||
@@ -417,7 +409,6 @@ public static class Texture2DExtensions
|
||||
destination.CopyFrom(source.AsSpan(), destinationOffsetX, destinationOffsetY, width, height);
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
/// <summary>
|
||||
/// Writes the contents of a given <typeparamref name="T"/> array to a specified area of the current <see cref="Texture2D{T}"/> instance.
|
||||
/// </summary>
|
||||
@@ -435,7 +426,6 @@ public static class Texture2DExtensions
|
||||
|
||||
destination.CopyFrom(source.AsSpan(sourceOffset), x, y);
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Writes the contents of a given <typeparamref name="T"/> array to a specified area of the current <see cref="Texture2D{T}"/> instance.
|
||||
@@ -472,7 +462,6 @@ public static class Texture2DExtensions
|
||||
destination.CopyFrom(source, 0, 0, destination.Width, destination.Height);
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
/// <summary>
|
||||
/// Writes the contents of a given <see cref="ReadOnlySpan{T}"/> to a specified area of the current <see cref="Texture2D{T}"/> instance.
|
||||
/// </summary>
|
||||
@@ -491,7 +480,6 @@ public static class Texture2DExtensions
|
||||
|
||||
destination.CopyFrom(source, offsetX, offsetY, width, height);
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Writes the contents of a given <see cref="ReadOnlySpan{T}"/> to a specified area of the current <see cref="Texture2D{T}"/> instance.
|
||||
|
||||
@@ -100,7 +100,6 @@ public static class Texture3DExtensions
|
||||
source.CopyTo(destination.AsSpan(destinationOffset), 0, 0, 0, source.Width, source.Height, source.Depth);
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
/// <summary>
|
||||
/// Reads the contents of the specified range from the current <see cref="Texture3D{T}"/> instance and writes them into a target array.
|
||||
/// </summary>
|
||||
@@ -119,7 +118,6 @@ public static class Texture3DExtensions
|
||||
|
||||
source.CopyTo(destination.AsSpan(destinationOffset), x, y, z);
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Reads the contents of the specified range from the current <see cref="Texture3D{T}"/> instance and writes them into a target array.
|
||||
@@ -157,7 +155,6 @@ public static class Texture3DExtensions
|
||||
source.CopyTo(destination, 0, 0, 0, source.Width, source.Height, source.Depth);
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
/// <summary>
|
||||
/// Reads the contents of the specified range from the current <see cref="Texture3D{T}"/> instance and writes them into a target <see cref="Span{T}"/>.
|
||||
/// </summary>
|
||||
@@ -178,7 +175,6 @@ public static class Texture3DExtensions
|
||||
|
||||
source.CopyTo(destination, offsetX, offsetY, offsetZ, width, height, depth);
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Reads the contents of the specified range from the current <see cref="Texture3D{T}"/> instance and writes them into a target <see cref="Span{T}"/>.
|
||||
@@ -357,7 +353,6 @@ public static class Texture3DExtensions
|
||||
destination.CopyFrom(source.AsSpan(), 0, 0, 0, destination.Width, destination.Height, destination.Depth);
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
/// <summary>
|
||||
/// Writes the contents of a given <typeparamref name="T"/> array to a specified area of the current <see cref="Texture3D{T}"/> instance.
|
||||
/// </summary>
|
||||
@@ -375,7 +370,6 @@ public static class Texture3DExtensions
|
||||
|
||||
destination.CopyFrom(source.AsSpan(), x, y, z);
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Writes the contents of a given <typeparamref name="T"/> array to a specified area of the current <see cref="Texture3D{T}"/> instance.
|
||||
@@ -398,7 +392,6 @@ public static class Texture3DExtensions
|
||||
destination.CopyFrom(source.AsSpan(), destinationOffsetX, destinationOffsetY, destinationOffsetZ, width, height, depth);
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
/// <summary>
|
||||
/// Writes the contents of a given <typeparamref name="T"/> array to a specified area of the current <see cref="Texture3D{T}"/> instance.
|
||||
/// </summary>
|
||||
@@ -417,7 +410,6 @@ public static class Texture3DExtensions
|
||||
|
||||
destination.CopyFrom(source.AsSpan(sourceOffset), x, y, z);
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Writes the contents of a given <typeparamref name="T"/> array to a specified area of the current <see cref="Texture3D{T}"/> instance.
|
||||
@@ -456,7 +448,6 @@ public static class Texture3DExtensions
|
||||
destination.CopyFrom(source, 0, 0, 0, destination.Width, destination.Height, destination.Depth);
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
/// <summary>
|
||||
/// Writes the contents of a given <see cref="ReadOnlySpan{T}"/> to a specified area of the current <see cref="Texture3D{T}"/> instance.
|
||||
/// </summary>
|
||||
@@ -477,7 +468,6 @@ public static class Texture3DExtensions
|
||||
|
||||
destination.CopyFrom(source, offsetX, offsetY, offsetZ, width, height, depth);
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Writes the contents of a given <see cref="ReadOnlySpan{T}"/> to a specified area of the current <see cref="Texture3D{T}"/> instance.
|
||||
|
||||
@@ -11,13 +11,6 @@ namespace ComputeSharp;
|
||||
/// <inheritdoc/>
|
||||
unsafe partial class GraphicsDevice
|
||||
{
|
||||
#if !NET6_0_OR_GREATER
|
||||
/// <summary>
|
||||
/// A cached <see cref="WaitForSingleObjectCallbackDelegate"/> instance wrapping <see cref="WaitForSingleObjectCallbackForRegisterDeviceLostCallback(void*, byte)"/>.
|
||||
/// </summary>
|
||||
private static readonly WaitForSingleObjectCallbackDelegate WaitForSingleObjectCallbackForRegisterDeviceLostCallbackWrapper = WaitForSingleObjectCallbackForRegisterDeviceLostCallback;
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Throws an <see cref="InvalidOperationException"/> if the current device has been lost.
|
||||
/// </summary>
|
||||
@@ -124,11 +117,7 @@ unsafe partial class GraphicsDevice
|
||||
_ = Windows.RegisterWaitForSingleObject(
|
||||
phNewWaitObject: &waitHandle,
|
||||
hObject: eventHandle,
|
||||
#if NET6_0_OR_GREATER
|
||||
Callback: &WaitForSingleObjectCallbackForRegisterDeviceLostCallback,
|
||||
#else
|
||||
Callback: (void*)Marshal.GetFunctionPointerForDelegate(WaitForSingleObjectCallbackForRegisterDeviceLostCallbackWrapper),
|
||||
#endif
|
||||
Context: (void*)GCHandle.ToIntPtr(handle),
|
||||
dwMilliseconds: Windows.INFINITE,
|
||||
dwFlags: 0);
|
||||
|
||||
@@ -17,21 +17,6 @@ namespace ComputeSharp;
|
||||
/// <inheritdoc/>
|
||||
unsafe partial class GraphicsDevice
|
||||
{
|
||||
#if !NET6_0_OR_GREATER
|
||||
/// <summary>
|
||||
/// A delegate for a callback to pass to <see cref="Windows.RegisterWaitForSingleObject(HANDLE*, HANDLE, void*, void*, uint, uint)"/>.
|
||||
/// </summary>
|
||||
/// <param name="pContext">The input context.</param>
|
||||
/// <param name="timedOut">Whether the wait has timed out.</param>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate void WaitForSingleObjectCallbackDelegate(void* pContext, byte timedOut);
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="WaitForSingleObjectCallbackDelegate"/> instance wrapping <see cref="WaitForSingleObjectCallbackForWaitForFenceAsync(void*, byte)"/>.
|
||||
/// </summary>
|
||||
private static readonly WaitForSingleObjectCallbackDelegate WaitForSingleObjectCallbackForWaitForFenceAsyncWrapper = WaitForSingleObjectCallbackForWaitForFenceAsync;
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Executes a given command list and waits for the operation to be completed.
|
||||
/// </summary>
|
||||
@@ -67,11 +52,7 @@ unsafe partial class GraphicsDevice
|
||||
d3D12CommandQueue->ExecuteCommandLists(1, d3D12CommandList);
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
ulong updatedFenceValue = Interlocked.Increment(ref d3D12FenceValue);
|
||||
#else
|
||||
ulong updatedFenceValue = (ulong)Interlocked.Increment(ref Unsafe.As<ulong, long>(ref d3D12FenceValue));
|
||||
#endif
|
||||
|
||||
// Signal to the target fence with the updated value. Note that incrementing the
|
||||
// target fence value to signal must be done after executing the command list.
|
||||
@@ -101,11 +82,7 @@ unsafe partial class GraphicsDevice
|
||||
this.d3D12ComputeCommandQueue.Get()->ExecuteCommandLists(1, d3D12CommandList);
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
ulong updatedFenceValue = Interlocked.Increment(ref this.nextD3D12ComputeFenceValue);
|
||||
#else
|
||||
ulong updatedFenceValue = (ulong)Interlocked.Increment(ref Unsafe.As<ulong, long>(ref this.nextD3D12ComputeFenceValue));
|
||||
#endif
|
||||
|
||||
// Signal to the target fence with the updated value. Note that incrementing the
|
||||
// target fence value to signal must be done after executing the command list.
|
||||
@@ -117,11 +94,7 @@ unsafe partial class GraphicsDevice
|
||||
// Return the rented command list and command allocator so that they can be reused
|
||||
this.computeCommandListPool.Return(commandList.DetachD3D12CommandList(), commandList.DetachD3D12CommandAllocator());
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
return ValueTask.CompletedTask;
|
||||
#else
|
||||
return new(Task.CompletedTask);
|
||||
#endif
|
||||
}
|
||||
|
||||
// Setup the awaitable task
|
||||
@@ -198,11 +171,7 @@ unsafe partial class GraphicsDevice
|
||||
int result = Windows.RegisterWaitForSingleObject(
|
||||
phNewWaitObject: &waitHandle,
|
||||
hObject: eventHandle,
|
||||
#if NET6_0_OR_GREATER
|
||||
Callback: &WaitForSingleObjectCallbackForWaitForFenceAsync,
|
||||
#else
|
||||
Callback: (void*)Marshal.GetFunctionPointerForDelegate(WaitForSingleObjectCallbackForWaitForFenceAsyncWrapper),
|
||||
#endif
|
||||
Context: callbackContext,
|
||||
dwMilliseconds: Windows.INFINITE,
|
||||
dwFlags: 0);
|
||||
|
||||
@@ -101,44 +101,6 @@ partial class DeviceHelper
|
||||
/// </summary>
|
||||
private unsafe struct IDXGIFactory4As6Backcompat
|
||||
{
|
||||
#if !NET6_0_OR_GREATER
|
||||
/// <inheritdoc cref="Release"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate uint ReleaseDelegate(IDXGIFactory4As6Backcompat* @this);
|
||||
|
||||
/// <inheritdoc cref="EnumAdapters"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate int EnumAdaptersDelegate(IDXGIFactory4As6Backcompat* @this, uint Adapter, IDXGIAdapter** ppAdapter);
|
||||
|
||||
/// <inheritdoc cref="EnumWarpAdapter"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate int EnumWarpAdapterDelegate(IDXGIFactory4As6Backcompat* @this, Guid* riid, void** ppvAdapter);
|
||||
|
||||
/// <inheritdoc cref="EnumAdapterByGpuPreference"/>
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate int EnumAdapterByGpuPreferenceDelegate(IDXGIFactory4As6Backcompat* @this, uint Adapter, DXGI_GPU_PREFERENCE GpuPreference, Guid* riid, void** ppvAdapter);
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="ReleaseDelegate"/> instance wrapping <see cref="Release"/>.
|
||||
/// </summary>
|
||||
private static readonly ReleaseDelegate ReleaseWrapper = Release;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="EnumAdaptersDelegate"/> instance wrapping <see cref="EnumAdapters"/>.
|
||||
/// </summary>
|
||||
private static readonly EnumAdaptersDelegate EnumAdaptersWrapper = EnumAdapters;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="EnumWarpAdapterDelegate"/> instance wrapping <see cref="EnumWarpAdapter"/>.
|
||||
/// </summary>
|
||||
private static readonly EnumWarpAdapterDelegate EnumWarpAdapterWrapper = EnumWarpAdapter;
|
||||
|
||||
/// <summary>
|
||||
/// A cached <see cref="EnumAdapterByGpuPreferenceDelegate"/> instance wrapping <see cref="EnumAdapterByGpuPreference"/>.
|
||||
/// </summary>
|
||||
private static readonly EnumAdapterByGpuPreferenceDelegate EnumAdapterByGpuPreferenceWrapper = EnumAdapterByGpuPreference;
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// The shared method table pointer for all <see cref="IDXGIFactory4As6Backcompat"/> instances.
|
||||
/// </summary>
|
||||
@@ -154,17 +116,10 @@ partial class DeviceHelper
|
||||
|
||||
new Span<IntPtr>(lpVtbl, 30).Clear();
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
lpVtbl[2] = (delegate* unmanaged<IDXGIFactory4As6Backcompat*, uint>)&Release;
|
||||
lpVtbl[7] = (delegate* unmanaged<IDXGIFactory4As6Backcompat*, uint, IDXGIAdapter**, int>)&EnumAdapters;
|
||||
lpVtbl[27] = (delegate* unmanaged<IDXGIFactory4As6Backcompat*, Guid*, void**, int>)&EnumWarpAdapter;
|
||||
lpVtbl[29] = (delegate* unmanaged<IDXGIFactory4As6Backcompat*, uint, DXGI_GPU_PREFERENCE, Guid*, void**, int>)&EnumAdapterByGpuPreference;
|
||||
#else
|
||||
lpVtbl[2] = (void*)Marshal.GetFunctionPointerForDelegate(ReleaseWrapper);
|
||||
lpVtbl[7] = (void*)Marshal.GetFunctionPointerForDelegate(EnumAdaptersWrapper);
|
||||
lpVtbl[27] = (void*)Marshal.GetFunctionPointerForDelegate(EnumWarpAdapterWrapper);
|
||||
lpVtbl[29] = (void*)Marshal.GetFunctionPointerForDelegate(EnumAdapterByGpuPreferenceWrapper);
|
||||
#endif
|
||||
|
||||
return lpVtbl;
|
||||
}
|
||||
|
||||
@@ -11,10 +11,7 @@ namespace ComputeSharp.Interop.Allocation;
|
||||
/// An allocation wrapper for a native <see cref="ID3D12Resource"/> object.
|
||||
/// </summary>
|
||||
[Guid("D42D5782-2DE7-4539-A817-482E3AA01E2E")]
|
||||
internal unsafe struct ID3D12Allocation
|
||||
#if NET6_0_OR_GREATER
|
||||
//: IUnknown.Interface
|
||||
#endif
|
||||
internal unsafe struct ID3D12Allocation //: IUnknown.Interface
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the <see cref="System.Guid"/> for <see cref="ID3D12Allocation"/> (<c>D42D5782-2DE7-4539-A817-482E3AA01E2E</c>).
|
||||
@@ -40,10 +37,8 @@ internal unsafe struct ID3D12Allocation
|
||||
}
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
///// <inheritdoc/>
|
||||
//static Guid* INativeGuid.NativeGuid => (Guid*)Unsafe.AsPointer(ref Unsafe.AsRef(in Guid));
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// The vtable for the current instance.
|
||||
|
||||
@@ -11,10 +11,7 @@ namespace ComputeSharp.Interop.Allocation;
|
||||
/// An object that can allocate resources for a given <see cref="ID3D12Device"/> instance.
|
||||
/// </summary>
|
||||
[Guid("2D5E55D2-9244-431F-868E-0D90AAB6E575")]
|
||||
internal unsafe struct ID3D12MemoryAllocator
|
||||
#if NET6_0_OR_GREATER
|
||||
//: IUnknown.Interface
|
||||
#endif
|
||||
internal unsafe struct ID3D12MemoryAllocator //: IUnknown.Interface
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the <see cref="System.Guid"/> for <see cref="ID3D12MemoryAllocator"/> (<c>2D5E55D2-9244-431F-868E-0D90AAB6E575</c>).
|
||||
@@ -40,10 +37,8 @@ internal unsafe struct ID3D12MemoryAllocator
|
||||
}
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
///// <inheritdoc/>
|
||||
//static Guid* INativeGuid.NativeGuid => (Guid*)Unsafe.AsPointer(ref Unsafe.AsRef(in Guid));
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// The vtable for the current instance.
|
||||
|
||||
@@ -11,10 +11,7 @@ namespace ComputeSharp.Interop.Allocation;
|
||||
/// A factory type for <see cref="ID3D12MemoryAllocator"/> objects.
|
||||
/// </summary>
|
||||
[Guid("CC1E74A7-786D-40F4-8AE2-F8B7A255587E")]
|
||||
internal unsafe struct ID3D12MemoryAllocatorFactory
|
||||
#if NET6_0_OR_GREATER
|
||||
//: IUnknown.Interface
|
||||
#endif
|
||||
internal unsafe struct ID3D12MemoryAllocatorFactory //: IUnknown.Interface
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the <see cref="System.Guid"/> for <see cref="ID3D12MemoryAllocatorFactory"/> (<c>CC1E74A7-786D-40F4-8AE2-F8B7A255587E</c>).
|
||||
@@ -40,10 +37,8 @@ internal unsafe struct ID3D12MemoryAllocatorFactory
|
||||
}
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
///// <inheritdoc/>
|
||||
//static Guid* INativeGuid.NativeGuid => (Guid*)Unsafe.AsPointer(ref Unsafe.AsRef(in Guid));
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// The vtable for the current instance.
|
||||
|
||||
@@ -9,10 +9,7 @@ namespace ComputeSharp;
|
||||
/// <summary>
|
||||
/// A locally unique identifier for a graphics device.
|
||||
/// </summary>
|
||||
public readonly struct Luid : IEquatable<Luid>
|
||||
#if NET6_0_OR_GREATER
|
||||
, ISpanFormattable
|
||||
#endif
|
||||
public readonly struct Luid : IEquatable<Luid>, ISpanFormattable
|
||||
{
|
||||
/// <summary>
|
||||
/// The low bits of the luid.
|
||||
@@ -63,7 +60,6 @@ public readonly struct Luid : IEquatable<Luid>
|
||||
return ((((long)this.highPart) << 32) | this.lowPart).ToString();
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
/// <inheritdoc/>
|
||||
public string ToString(string? format, IFormatProvider? formatProvider)
|
||||
{
|
||||
@@ -75,7 +71,6 @@ public readonly struct Luid : IEquatable<Luid>
|
||||
{
|
||||
return ((((long)this.highPart) << 32) | this.lowPart).TryFormat(destination, out charsWritten, format, provider);
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Check whether two <see cref="Luid"/> values are equal.
|
||||
|
||||
@@ -284,11 +284,7 @@ public struct ComputeContext : IDisposable, IAsyncDisposable
|
||||
{
|
||||
device.GetReferenceTracker().DangerousRelease();
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
return ValueTask.CompletedTask;
|
||||
#else
|
||||
return new(Task.CompletedTask);
|
||||
#endif
|
||||
}
|
||||
|
||||
try
|
||||
|
||||
@@ -2,13 +2,6 @@ using System;
|
||||
|
||||
namespace ComputeSharp.D2D1.Tests.Effects;
|
||||
|
||||
#if !NET6_0_OR_GREATER
|
||||
internal static class MathF
|
||||
{
|
||||
public const float PI = (float)Math.PI;
|
||||
}
|
||||
#endif
|
||||
|
||||
[D2DInputCount(0)]
|
||||
[D2DRequiresScenePosition]
|
||||
[D2DShaderProfile(D2D1ShaderProfile.PixelShader50)]
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
#if NET6_0_OR_GREATER
|
||||
using System.Runtime.Versioning;
|
||||
#endif
|
||||
using ComputeSharp;
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
[assembly: SupportedOSPlatform("windows6.2")]
|
||||
#endif
|
||||
|
||||
float[] array = Enumerable.Range(1, 100).Select(static i => (float)i).ToArray();
|
||||
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
#if NET6_0_OR_GREATER
|
||||
using System.Runtime.Versioning;
|
||||
#endif
|
||||
using ComputeSharp;
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
[assembly: SupportedOSPlatform("windows6.2")]
|
||||
#endif
|
||||
|
||||
float[] array = Enumerable.Range(1, 100).Select(static i => (float)i).ToArray();
|
||||
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
#if !NET6_0_OR_GREATER
|
||||
|
||||
namespace System;
|
||||
|
||||
/// <summary>
|
||||
/// A type with some helper methods for the <see cref="Random"/> class.
|
||||
/// </summary>
|
||||
internal static class RandomExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Fills the elements of a specified span of bytes with random numbers.
|
||||
/// </summary>
|
||||
/// <param name="random">The target random instance.</param>
|
||||
/// <param name="buffer">The array to be filled with random numbers.</param>
|
||||
public static void NextBytes(this Random random, Span<byte> buffer)
|
||||
{
|
||||
byte[] array = new byte[buffer.Length];
|
||||
|
||||
random.NextBytes(array);
|
||||
|
||||
array.AsSpan().CopyTo(buffer);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
新しいイシューから参照
ユーザーをブロックする