Improve consistency in interop API parameters ordering
このコミットが含まれているのは:
1 親
e64b638454
コミット
7761d0bbd8
10ファイル変更
+22
-22
検索条件に一致するファイルはありません
@@ -223,7 +223,7 @@ unsafe partial class PixelShaderEffect<T>
|
||||
}
|
||||
|
||||
// Set the constant buffer for the effect
|
||||
D2D1PixelShaderEffect.SetConstantBufferForD2D1Effect(this.value, this.d2D1Effect.Get());
|
||||
D2D1PixelShaderEffect.SetConstantBufferForD2D1Effect(this.d2D1Effect.Get(), in this.value);
|
||||
|
||||
// If there is a transform mapper, set it in the effect
|
||||
if (this.transformMapper is not null)
|
||||
|
||||
@@ -40,7 +40,7 @@ unsafe partial class PixelShaderEffect<T>
|
||||
// If the effect is realized, set the property on the underlying ID2D1Effect object
|
||||
if (this.d2D1Effect.Get() is not null)
|
||||
{
|
||||
D2D1PixelShaderEffect.SetConstantBufferForD2D1Effect(in value, this.d2D1Effect.Get());
|
||||
D2D1PixelShaderEffect.SetConstantBufferForD2D1Effect(this.d2D1Effect.Get(), in value);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -426,11 +426,11 @@ public static class D2D1PixelShader
|
||||
/// Sets the constant buffer from an input D2D1 pixel shader, by calling <c>ID2D1DrawInfo::SetPixelShaderConstantBuffer</c>.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of D2D1 pixel shader to set the constant buffer for.</typeparam>
|
||||
/// <param name="shader">The input D2D1 pixel shader to set the contant buffer for.</param>
|
||||
/// <param name="d2D1DrawInfo">A pointer to the <c>ID2D1DrawInfo</c> instance to use.</param>
|
||||
/// <param name="shader">The input D2D1 pixel shader to set the contant buffer for.</param>
|
||||
/// <exception cref="ArgumentNullException">Thrown if <paramref name="d2D1DrawInfo"/> is <see langword="null"/>.</exception>
|
||||
/// <remarks>For more info, see <see href="https://docs.microsoft.com/windows/win32/api/d2d1effectauthor/nf-d2d1effectauthor-id2d1drawinfo-setpixelshaderconstantbuffer"/>.</remarks>
|
||||
public static unsafe void SetConstantBufferForD2D1DrawInfo<T>(in T shader, void* d2D1DrawInfo)
|
||||
public static unsafe void SetConstantBufferForD2D1DrawInfo<T>(void* d2D1DrawInfo, in T shader)
|
||||
where T : unmanaged, ID2D1PixelShader
|
||||
{
|
||||
if (d2D1DrawInfo is null)
|
||||
|
||||
@@ -497,11 +497,11 @@ public static unsafe class D2D1PixelShaderEffect
|
||||
/// Sets the constant buffer from an input D2D1 effect, by calling <c>ID2D1Effect::SetValue</c>.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of D2D1 pixel shader to set the constant buffer for.</typeparam>
|
||||
/// <param name="shader">The input D2D1 pixel shader to set the contant buffer for.</param>
|
||||
/// <param name="d2D1Effect">A pointer to the <c>ID2D1Effect</c> instance to use.</param>
|
||||
/// <param name="shader">The input D2D1 pixel shader to set the contant buffer for.</param>
|
||||
/// <exception cref="ArgumentNullException">Thrown if <paramref name="d2D1Effect"/> is <see langword="null"/>.</exception>
|
||||
/// <remarks>For more info, see <see href="https://docs.microsoft.com/windows/win32/api/d2d1_1/nf-d2d1_1-id2d1properties-setvalue(uint32_d2d1_property_type_constbyte_uint32)"/>.</remarks>
|
||||
public static void SetConstantBufferForD2D1Effect<T>(in T shader, void* d2D1Effect)
|
||||
public static void SetConstantBufferForD2D1Effect<T>(void* d2D1Effect, in T shader)
|
||||
where T : unmanaged, ID2D1PixelShader
|
||||
{
|
||||
if (d2D1Effect is null)
|
||||
|
||||
@@ -47,7 +47,7 @@ public partial class D2D1PixelShaderEffectTests
|
||||
[ExpectedException(typeof(ArgumentNullException), AllowDerivedTypes = false)]
|
||||
public unsafe void SetConstantBufferForD2D1Effect_NullD2D1Effect()
|
||||
{
|
||||
D2D1PixelShaderEffect.SetConstantBufferForD2D1Effect<InvertEffect>(default, null);
|
||||
D2D1PixelShaderEffect.SetConstantBufferForD2D1Effect<InvertEffect>(null, default);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
|
||||
@@ -630,6 +630,6 @@ public partial class D2D1PixelShaderTests
|
||||
[ExpectedException(typeof(ArgumentNullException), AllowDerivedTypes = false)]
|
||||
public unsafe void SetConstantBufferForD2D1DrawInfo_NullD2D1DrawInfo()
|
||||
{
|
||||
D2D1PixelShader.SetConstantBufferForD2D1DrawInfo<InvertEffect>(default, null);
|
||||
D2D1PixelShader.SetConstantBufferForD2D1DrawInfo<InvertEffect>(null, default);
|
||||
}
|
||||
}
|
||||
@@ -198,7 +198,7 @@ public partial class D2D1ResourceTextureManagerTests
|
||||
|
||||
D2D1PixelShaderEffect.CreateFromD2D1DeviceContext<IndexFrom2DResourceTextureShader>(d2D1DeviceContext.Get(), (void**)d2D1Effect.GetAddressOf());
|
||||
|
||||
D2D1PixelShaderEffect.SetConstantBufferForD2D1Effect(default(IndexFrom2DResourceTextureShader), d2D1Effect.Get());
|
||||
D2D1PixelShaderEffect.SetConstantBufferForD2D1Effect(d2D1Effect.Get(), default(IndexFrom2DResourceTextureShader));
|
||||
|
||||
using ComPtr<IUnknown> resourceTextureManager = default;
|
||||
|
||||
@@ -257,7 +257,7 @@ public partial class D2D1ResourceTextureManagerTests
|
||||
|
||||
D2D1PixelShaderEffect.CreateFromD2D1DeviceContext<IndexFrom2DResourceTextureShader>(d2D1DeviceContext.Get(), (void**)d2D1Effect.GetAddressOf());
|
||||
|
||||
D2D1PixelShaderEffect.SetConstantBufferForD2D1Effect(default(IndexFrom2DResourceTextureShader), d2D1Effect.Get());
|
||||
D2D1PixelShaderEffect.SetConstantBufferForD2D1Effect(d2D1Effect.Get(), default(IndexFrom2DResourceTextureShader));
|
||||
|
||||
using ComPtr<IUnknown> resourceTextureManager = default;
|
||||
|
||||
@@ -321,7 +321,7 @@ public partial class D2D1ResourceTextureManagerTests
|
||||
|
||||
D2D1PixelShaderEffect.CreateFromD2D1DeviceContext<IndexFrom2DResourceTextureShader>(d2D1DeviceContext.Get(), (void**)d2D1Effect.GetAddressOf());
|
||||
|
||||
D2D1PixelShaderEffect.SetConstantBufferForD2D1Effect(default(IndexFrom2DResourceTextureShader), d2D1Effect.Get());
|
||||
D2D1PixelShaderEffect.SetConstantBufferForD2D1Effect(d2D1Effect.Get(), default(IndexFrom2DResourceTextureShader));
|
||||
|
||||
string assemblyPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!;
|
||||
string expectedPath = Path.Combine(assemblyPath, "Assets", "Landscape.png");
|
||||
@@ -498,7 +498,7 @@ public partial class D2D1ResourceTextureManagerTests
|
||||
|
||||
IndexFrom3DResourceTextureShader shader = new(expected.Height / 4);
|
||||
|
||||
D2D1PixelShaderEffect.SetConstantBufferForD2D1Effect(in shader, d2D1Effect.Get());
|
||||
D2D1PixelShaderEffect.SetConstantBufferForD2D1Effect(d2D1Effect.Get(), in shader);
|
||||
|
||||
using ComPtr<IUnknown> resourceTextureManager = default;
|
||||
|
||||
@@ -575,7 +575,7 @@ public partial class D2D1ResourceTextureManagerTests
|
||||
|
||||
CopyFromResourceTexture1DShader shader = new(width);
|
||||
|
||||
D2D1PixelShaderEffect.SetConstantBufferForD2D1Effect(in shader, d2D1Effect.Get());
|
||||
D2D1PixelShaderEffect.SetConstantBufferForD2D1Effect(d2D1Effect.Get(), in shader);
|
||||
|
||||
byte[] texture = new byte[width];
|
||||
|
||||
@@ -663,7 +663,7 @@ public partial class D2D1ResourceTextureManagerTests
|
||||
|
||||
CopyFromResourceTexture2DShader shader = new(width, height);
|
||||
|
||||
D2D1PixelShaderEffect.SetConstantBufferForD2D1Effect(in shader, d2D1Effect.Get());
|
||||
D2D1PixelShaderEffect.SetConstantBufferForD2D1Effect(d2D1Effect.Get(), in shader);
|
||||
|
||||
byte[] texture = new byte[width * height];
|
||||
|
||||
@@ -766,7 +766,7 @@ public partial class D2D1ResourceTextureManagerTests
|
||||
|
||||
CopyFromResourceTexture3DShader shader = new(width, height, depth);
|
||||
|
||||
D2D1PixelShaderEffect.SetConstantBufferForD2D1Effect(in shader, d2D1Effect.Get());
|
||||
D2D1PixelShaderEffect.SetConstantBufferForD2D1Effect(d2D1Effect.Get(), in shader);
|
||||
|
||||
byte[] texture = new byte[width * height * depth];
|
||||
|
||||
@@ -860,7 +860,7 @@ public partial class D2D1ResourceTextureManagerTests
|
||||
|
||||
D2D1PixelShaderEffect.CreateFromD2D1DeviceContext<NullResourceTextureShader>(d2D1DeviceContext.Get(), (void**)d2D1Effect.GetAddressOf());
|
||||
|
||||
D2D1PixelShaderEffect.SetConstantBufferForD2D1Effect(default(NullResourceTextureShader), d2D1Effect.Get());
|
||||
D2D1PixelShaderEffect.SetConstantBufferForD2D1Effect(d2D1Effect.Get(), default(NullResourceTextureShader));
|
||||
|
||||
using ComPtr<ID2D1Bitmap> d2D1BitmapTarget = D2D1Helper.CreateD2D1BitmapAndSetAsTarget(d2D1DeviceContext.Get(), 128, 128);
|
||||
|
||||
|
||||
@@ -158,7 +158,7 @@ public partial class D2D1TransformMapperTests
|
||||
|
||||
D2D1PixelShaderEffect.CreateFromD2D1DeviceContext<ShaderWithDispatchArea>(d2D1DeviceContext.Get(), (void**)d2D1Effect.GetAddressOf());
|
||||
|
||||
D2D1PixelShaderEffect.SetConstantBufferForD2D1Effect(new ShaderWithDispatchArea(111, 222), d2D1Effect.Get());
|
||||
D2D1PixelShaderEffect.SetConstantBufferForD2D1Effect(d2D1Effect.Get(), new ShaderWithDispatchArea(111, 222));
|
||||
|
||||
DispatchAreaTransformMapper transformMapper = new() { ExpectedWidth = 111, ExpectedHeight = 222 };
|
||||
|
||||
|
||||
@@ -425,9 +425,9 @@ public sealed partial class BokehBlurEffect
|
||||
// Set the constant buffers
|
||||
for (int i = 0; i < numberOfComponents; i++)
|
||||
{
|
||||
D2D1PixelShaderEffect.SetConstantBufferForD2D1Effect(new VerticalConvolution.Shader((int)kernelSize), verticalConvolutionEffectsForReals[i].Get());
|
||||
D2D1PixelShaderEffect.SetConstantBufferForD2D1Effect(new VerticalConvolution.Shader((int)kernelSize), verticalConvolutionEffectsForImaginaries[i].Get());
|
||||
D2D1PixelShaderEffect.SetConstantBufferForD2D1Effect(new HorizontalConvolutionAndAccumulatePartials.Shader((int)kernelSize, this.kernelParameters[i].Z, this.kernelParameters[i].W), horizontalConvolutionEffects[i].Get());
|
||||
D2D1PixelShaderEffect.SetConstantBufferForD2D1Effect(verticalConvolutionEffectsForReals[i].Get(), new VerticalConvolution.Shader((int)kernelSize));
|
||||
D2D1PixelShaderEffect.SetConstantBufferForD2D1Effect(verticalConvolutionEffectsForImaginaries[i].Get(), new VerticalConvolution.Shader((int)kernelSize));
|
||||
D2D1PixelShaderEffect.SetConstantBufferForD2D1Effect(horizontalConvolutionEffects[i].Get(), new HorizontalConvolutionAndAccumulatePartials.Shader((int)kernelSize, this.kernelParameters[i].Z, this.kernelParameters[i].W));
|
||||
}
|
||||
|
||||
// Build the effect graph:
|
||||
|
||||
@@ -124,7 +124,7 @@ internal static class D2D1TestRunner
|
||||
|
||||
D2D1PixelShaderEffect.CreateFromD2D1DeviceContext<T>(d2D1DeviceContext.Get(), (void**)d2D1Effect.GetAddressOf());
|
||||
|
||||
D2D1PixelShaderEffect.SetConstantBufferForD2D1Effect(in shader, d2D1Effect.Get());
|
||||
D2D1PixelShaderEffect.SetConstantBufferForD2D1Effect(d2D1Effect.Get(), in shader);
|
||||
|
||||
if (transformMapper is not null)
|
||||
{
|
||||
@@ -173,7 +173,7 @@ internal static class D2D1TestRunner
|
||||
|
||||
D2D1PixelShaderEffect.CreateFromD2D1DeviceContext<T>(d2D1DeviceContext.Get(), (void**)d2D1Effect.GetAddressOf());
|
||||
|
||||
D2D1PixelShaderEffect.SetConstantBufferForD2D1Effect(in shader, d2D1Effect.Get());
|
||||
D2D1PixelShaderEffect.SetConstantBufferForD2D1Effect(d2D1Effect.Get(), in shader);
|
||||
|
||||
if (transformMapper is not null)
|
||||
{
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする