Rename and move D2D1ShaderCompilerOptions enum
このコミットが含まれているのは:
1 親
7eea2f613f
コミット
dd5e1b6262
3ファイル変更
+12
-11
検索条件に一致するファイルはありません
+3
-2
@@ -1,7 +1,8 @@
|
||||
using System;
|
||||
using ComputeSharp.D2D1.Interop;
|
||||
using TerraFX.Interop.DirectX;
|
||||
|
||||
namespace ComputeSharp.D2D1.Interop;
|
||||
namespace ComputeSharp.D2D1;
|
||||
|
||||
/// <summary>
|
||||
/// Flags to control the options that can be used to compile a D2D1 shader.
|
||||
@@ -10,7 +11,7 @@ namespace ComputeSharp.D2D1.Interop;
|
||||
/// For more info, see For more info, see <see href="https://docs.microsoft.com/windows/win32/direct3dhlsl/d3dcompile-constants"/>.
|
||||
/// </remarks>
|
||||
[Flags]
|
||||
public enum D2D1ShaderCompilerOptions
|
||||
public enum D2D1CompileOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// Directs the compiler to insert debug file/line/type/symbol information into the output code.
|
||||
@@ -29,7 +29,7 @@ public static class D2D1ShaderCompiler
|
||||
ReadOnlySpan<char> hlslSource,
|
||||
ReadOnlySpan<char> entryPoint,
|
||||
D2D1ShaderProfile shaderProfile,
|
||||
D2D1ShaderCompilerOptions options)
|
||||
D2D1CompileOptions options)
|
||||
{
|
||||
// Encode the HLSL source to ASCII
|
||||
int maxSourceLength = Encoding.ASCII.GetMaxByteCount(hlslSource.Length);
|
||||
@@ -60,13 +60,13 @@ public static class D2D1ShaderCompiler
|
||||
ReadOnlySpan<byte> hlslSourceAscii,
|
||||
ReadOnlySpan<byte> entryPointAscii,
|
||||
D2D1ShaderProfile shaderProfile,
|
||||
D2D1ShaderCompilerOptions options)
|
||||
D2D1CompileOptions options)
|
||||
{
|
||||
// Check linking support
|
||||
bool enableLinking = (options & D2D1ShaderCompilerOptions.EnableLinking) == D2D1ShaderCompilerOptions.EnableLinking;
|
||||
bool enableLinking = (options & D2D1CompileOptions.EnableLinking) == D2D1CompileOptions.EnableLinking;
|
||||
|
||||
// Remove the linking flag to make the options blittable to flags
|
||||
options &= ~D2D1ShaderCompilerOptions.EnableLinking;
|
||||
options &= ~D2D1CompileOptions.EnableLinking;
|
||||
|
||||
// Compile the standalone D2D1 full shader
|
||||
using ComPtr<ID3DBlob> d3DBlobFullShader = D3DCompiler.CompileShader(
|
||||
|
||||
@@ -31,7 +31,7 @@ public partial class D2D1ShaderCompilerTests
|
||||
source,
|
||||
"PSMain",
|
||||
D2D1ShaderProfile.PixelShader40Level93,
|
||||
D2D1ShaderCompilerOptions.Default);
|
||||
D2D1CompileOptions.Default);
|
||||
|
||||
Assert.IsTrue(bytecode.Length > 0);
|
||||
}
|
||||
@@ -57,7 +57,7 @@ public partial class D2D1ShaderCompilerTests
|
||||
source,
|
||||
"PSMain",
|
||||
D2D1ShaderProfile.PixelShader40Level93,
|
||||
D2D1ShaderCompilerOptions.Default | D2D1ShaderCompilerOptions.EnableLinking);
|
||||
D2D1CompileOptions.Default | D2D1CompileOptions.EnableLinking);
|
||||
|
||||
Assert.IsTrue(bytecode.Length > 0);
|
||||
}
|
||||
@@ -84,7 +84,7 @@ public partial class D2D1ShaderCompilerTests
|
||||
source,
|
||||
"Execute",
|
||||
D2D1ShaderProfile.PixelShader40Level93,
|
||||
D2D1ShaderCompilerOptions.Default);
|
||||
D2D1CompileOptions.Default);
|
||||
|
||||
Assert.IsTrue(bytecode.Length > 0);
|
||||
}
|
||||
@@ -111,7 +111,7 @@ public partial class D2D1ShaderCompilerTests
|
||||
source,
|
||||
"PSMain",
|
||||
D2D1ShaderProfile.PixelShader40Level93,
|
||||
D2D1ShaderCompilerOptions.Default);
|
||||
D2D1CompileOptions.Default);
|
||||
|
||||
Assert.IsTrue(bytecode.Length > 0);
|
||||
}
|
||||
@@ -158,7 +158,7 @@ public partial class D2D1ShaderCompilerTests
|
||||
source,
|
||||
"PSMain",
|
||||
D2D1ShaderProfile.PixelShader40,
|
||||
D2D1ShaderCompilerOptions.Default);
|
||||
D2D1CompileOptions.Default);
|
||||
|
||||
Assert.IsTrue(bytecode.Length > 0);
|
||||
}
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする