Merge pull request #810 from Sergio0694/dev/generator-tweaks
Minor tweaks to generated code
このコミットが含まれているのは:
4ファイル変更
+7
-6
検索条件に一致するファイルはありません
+1
-1
@@ -199,7 +199,7 @@ partial class ConstantBufferSyntaxProcessor
|
||||
writer.WriteLine($"""/// <returns>The marshalled <see cref="{fullyQualifiedTypeName}"/> instance.</returns>""");
|
||||
writer.WriteLine($"""[MethodImpl(MethodImplOptions.AggressiveInlining)]""");
|
||||
writer.WriteLine($"""[SkipLocalsInit]""");
|
||||
writer.WriteLine($"public static {fullyQualifiedTypeName} ToManaged(in ConstantBuffer buffer)");
|
||||
writer.WriteLine($"public static {fullyQualifiedTypeName} ToManaged(ref readonly ConstantBuffer buffer)");
|
||||
|
||||
using (writer.WriteBlock())
|
||||
{
|
||||
|
||||
@@ -82,7 +82,7 @@ partial class ComputeShaderDescriptorGenerator
|
||||
writer.WriteLine("buffer.__x = x;");
|
||||
writer.WriteLine("buffer.__y = y;");
|
||||
writer.WriteLineIf(!info.IsPixelShaderLike, "buffer.__z = z;");
|
||||
writer.WriteLineIf(!info.IsPixelShaderLike);
|
||||
writer.WriteLine(skipIfPresent: true);
|
||||
writer.WriteLine("loader.LoadConstantBuffer(new global::System.ReadOnlySpan<byte>(&buffer, sizeof(global::ComputeSharp.Generated.ConstantBuffer)));");
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -281,7 +281,7 @@ public class Test_D2DPixelShaderDescriptorGenerator
|
||||
/// <returns>The marshalled <see cref="global::MyNamespace.MyShader"/> instance.</returns>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
[SkipLocalsInit]
|
||||
public static global::MyNamespace.MyShader ToManaged(in ConstantBuffer buffer)
|
||||
public static global::MyNamespace.MyShader ToManaged(ref readonly ConstantBuffer buffer)
|
||||
{
|
||||
Unsafe.SkipInit(out global::MyNamespace.MyShader shader);
|
||||
|
||||
@@ -583,7 +583,7 @@ public class Test_D2DPixelShaderDescriptorGenerator
|
||||
/// <returns>The marshalled <see cref="global::MyNamespace.MyShader"/> instance.</returns>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
[SkipLocalsInit]
|
||||
public static global::MyNamespace.MyShader ToManaged(in ConstantBuffer buffer)
|
||||
public static global::MyNamespace.MyShader ToManaged(ref readonly ConstantBuffer buffer)
|
||||
{
|
||||
Unsafe.SkipInit(out global::MyNamespace.MyShader shader);
|
||||
|
||||
@@ -933,7 +933,7 @@ public class Test_D2DPixelShaderDescriptorGenerator
|
||||
/// <returns>The marshalled <see cref="global::MyNamespace.MyShader"/> instance.</returns>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
[SkipLocalsInit]
|
||||
public static global::MyNamespace.MyShader ToManaged(in ConstantBuffer buffer)
|
||||
public static global::MyNamespace.MyShader ToManaged(ref readonly ConstantBuffer buffer)
|
||||
{
|
||||
Unsafe.SkipInit(out global::MyNamespace.MyShader shader);
|
||||
|
||||
@@ -1231,7 +1231,7 @@ public class Test_D2DPixelShaderDescriptorGenerator
|
||||
/// <returns>The marshalled <see cref="global::MyNamespace.MyShader"/> instance.</returns>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
[SkipLocalsInit]
|
||||
public static global::MyNamespace.MyShader ToManaged(in ConstantBuffer buffer)
|
||||
public static global::MyNamespace.MyShader ToManaged(ref readonly ConstantBuffer buffer)
|
||||
{
|
||||
Unsafe.SkipInit(out global::MyNamespace.MyShader shader);
|
||||
|
||||
|
||||
@@ -423,6 +423,7 @@ public class Test_ComputeShaderDescriptorGenerator
|
||||
|
||||
buffer.__x = x;
|
||||
buffer.__y = y;
|
||||
|
||||
loader.LoadConstantBuffer(new global::System.ReadOnlySpan<byte>(&buffer, sizeof(global::ComputeSharp.Generated.ConstantBuffer)));
|
||||
}
|
||||
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする