Fix build errors in ComputeSharp.Dynamic

このコミットが含まれているのは:
Sergio Pedri committed 2021-12-19 16:45:12 +01:00
1 親 b532a9cdfb
コミット d17c9ab004
9ファイル変更
+44 -30

検索条件に一致するファイルはありません

+1
ファイルの表示
@@ -86,6 +86,7 @@ Global
src\TerraFX.Interop.Windows\TerraFX.Interop.Windows.projitems*{514ff00e-bbf0-4d55-a47c-eeeb6208adce}*SharedItemsImports = 13
samples\ComputeSharp.Sample.Shared\ComputeSharp.Sample.Shared.projitems*{7048deea-0a6f-46a0-b951-b682a8f1cb75}*SharedItemsImports = 5
samples\ComputeSharp.SwapChain.Core.Shared\ComputeSharp.SwapChain.Core.Shared.projitems*{751bb05b-563d-4b3a-94c6-15e2d79d35ea}*SharedItemsImports = 13
src\TerraFX.Interop.Windows.Dynamic\TerraFX.Interop.Windows.Dynamic.projitems*{76c66257-fdaa-47ab-85e7-ef757eab10c0}*SharedItemsImports = 5
samples\ComputeSharp.Sample.Shared\ComputeSharp.Sample.Shared.projitems*{8cefc324-ca6c-4845-9ad9-70b92bd87057}*SharedItemsImports = 13
src\ComputeSharp.NetStandard\ComputeSharp.NetStandard.projitems*{a5997814-d8d2-4541-87ac-c3e53caa67c0}*SharedItemsImports = 13
src\ComputeSharp.UI\ComputeSharp.UI.projitems*{afaafdc9-be42-45d4-8c79-0ee8c8edbf52}*SharedItemsImports = 5
+10 -4
ファイルの表示
@@ -7,6 +7,16 @@
<Platforms>AnyCPU;x64;ARM64</Platforms>
</PropertyGroup>
<!-- Referece to the main non-dynamic library-->
<ItemGroup>
<ProjectReference Include="..\ComputeSharp\ComputeSharp.csproj" />
</ItemGroup>
<!-- Shared project with .NET Standard 2.0 polyfills for Dxc -->
<Import Condition="'$(TargetFramework)' == 'netstandard2.0'"
Project="..\TerraFX.Interop.Windows.Dynamic\TerraFX.Interop.Windows.Dynamic.projitems"
Label="Shared" />
<Choose>
<!-- When building locally for x64/ARM64 (using the project through a project reference),
@@ -68,8 +78,4 @@
</ItemGroup>
</Otherwise>
</Choose>
<ItemGroup>
<ProjectReference Include="..\ComputeSharp\ComputeSharp.csproj" />
</ItemGroup>
</Project>
+2 -13
ファイルの表示
@@ -1,17 +1,12 @@
using System;
#if !DISABLE_RUNTIME_SHADER_COMPILATION_SUPPORT
using System.Runtime.CompilerServices;
#endif
using ComputeSharp.__Internals;
#if !DISABLE_RUNTIME_SHADER_COMPILATION_SUPPORT
using ComputeSharp.Core.Extensions;
using ComputeSharp.Shaders.Translation;
#else
using Microsoft.Toolkit.Diagnostics;
#endif
#if !DISABLE_RUNTIME_SHADER_COMPILATION_SUPPORT
using TerraFX.Interop.DirectX;
using TerraFX.Interop.Windows;
#if !NET6_0_OR_GREATER
using DirectX = TerraFX.Interop.DirectX.DirectX2;
#endif
#pragma warning disable CS0618
@@ -110,11 +105,6 @@ public static class ReflectionServices
private static unsafe void GetNonGenericShaderInfo<T>(in T shader, out ShaderInfo shaderInfo)
where T : struct, IShader
{
#if DISABLE_RUNTIME_SHADER_COMPILATION_SUPPORT
ThrowHelper.ThrowNotSupportedException("Runtime shader compilation is not supported by the current configuration.");
shaderInfo = default;
#else
Unsafe.AsRef(in shader).BuildHlslString(out ArrayPoolStringBuilder shaderSource, 1, 1, 1);
using ComPtr<IDxcBlob> dxcBlobBytecode = ShaderCompiler.Instance.CompileShader(shaderSource.WrittenSpan);
@@ -169,6 +159,5 @@ public static class ReflectionServices
Unsafe.AsRef(shaderInfo.MovInstructionCount) = d3D12ShaderReflection.Get()->GetMovInstructionCount();
Unsafe.AsRef(shaderInfo.InterfaceSlotCount) = d3D12ShaderReflection.Get()->GetNumInterfaceSlots();
Unsafe.AsRef(shaderInfo.RequiresDoublePrecisionSupport) = (d3D12ShaderReflection.Get()->GetRequiresFlags() & (D3D.D3D_SHADER_REQUIRES_DOUBLES | D3D.D3D_SHADER_REQUIRES_11_1_DOUBLE_EXTENSIONS)) != 0;
#endif
}
}
+1 -1
ファイルの表示
@@ -1,4 +1,4 @@
#if !DISABLE_RUNTIME_SHADER_COMPILATION_SUPPORT && NET6_0_OR_GREATER
#if NET6_0_OR_GREATER
using System;
using System.IO;
+4 -5
ファイルの表示
@@ -1,12 +1,13 @@
#if !DISABLE_RUNTIME_SHADER_COMPILATION_SUPPORT
using System;
using System;
using System.Diagnostics.Contracts;
using System.Runtime.CompilerServices;
using ComputeSharp.Core.Extensions;
using ComputeSharp.Exceptions;
using TerraFX.Interop.DirectX;
using TerraFX.Interop.Windows;
#if !NET6_0_OR_GREATER
using DirectX = TerraFX.Interop.DirectX.DirectX2;
#endif
namespace ComputeSharp.Shaders.Translation;
@@ -155,5 +156,3 @@ internal sealed unsafe partial class ShaderCompiler
throw new HlslCompilationException(message);
}
}
#endif
+6 -6
ファイルの表示
@@ -22,14 +22,10 @@
</ItemGroup>
<!-- Shared project with .NET Standard 2.0 polyfills -->
<Import Condition="'$(TargetFramework)' == 'netstandard2.0'"
Project="..\ComputeSharp.NetStandard\ComputeSharp.NetStandard.projitems"
Label="Shared" />
<Import Condition="'$(TargetFramework)' == 'netstandard2.0'" Project="..\ComputeSharp.NetStandard\ComputeSharp.NetStandard.projitems" Label="Shared" />
<!-- Shared project with TerraFX.Interop.Windows fork -->
<Import Condition="'$(TargetFramework)' == 'netstandard2.0'"
Project="..\TerraFX.Interop.Windows\TerraFX.Interop.Windows.projitems"
Label="Shared" />
<Import Condition="'$(TargetFramework)' == 'netstandard2.0'" Project="..\TerraFX.Interop.Windows\TerraFX.Interop.Windows.projitems" Label="Shared" />
<!-- Ignore the warnings on the .NET Standard 2.0 profile -->
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
@@ -234,4 +230,8 @@
<LastGenOutput>UIntMxN.g.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<Folder Include="Shaders\Dispatching\__Internals\" />
</ItemGroup>
</Project>
+18
ファイルの表示
@@ -64,6 +64,24 @@ public interface IShader
;
#endif
/// <summary>
/// Builds the HLSL source code for the current shader instance.
/// </summary>
/// <param name="builder">The resulting <see cref="ArrayPoolStringBuilder"/> instance containing the HLSL source.</param>
/// <param name="threadsX">The number of threads in each thread group for the X axis.</param>
/// <param name="threadsY">The number of threads in each thread group for the Y axis.</param>
/// <param name="threadsZ">The number of threads in each thread group for the Z axis.</param>
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("This method is not intended to be called directly by user code")]
void BuildHlslString(out ArrayPoolStringBuilder builder, int threadsX, int threadsY, int threadsZ)
#if NET6_0_OR_GREATER
{
throw new NotImplementedException();
}
#else
;
#endif
/// <summary>
/// Loads the bytecode for the current shader.
/// </summary>
+2 -1
ファイルの表示
@@ -9,7 +9,8 @@ using TerraFX.Interop.Windows;
namespace TerraFX.Interop.DirectX
{
internal static unsafe partial class DirectX
// This type is named DirectX2 to avoid naming conflicts in ComputeSharp.Dynamic
internal static unsafe partial class DirectX2
{
[DllImport("dxcompiler", ExactSpelling = true)]
public static extern HRESULT DxcCreateInstance([NativeTypeName("const IID &")] Guid* rclsid, [NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("LPVOID *")] void** ppv);