GPU基盤を専用プロジェクトへ分離
このコミットが含まれているのは:
6ファイル変更
+71
-7
検索条件に一致するファイルはありません
@@ -0,0 +1,48 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0-windows10.0.19041.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Version>1.19.2</Version>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
<Nullable>enable</Nullable>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<InternalsVisibleTo Include="LuaScript" />
|
||||
<InternalsVisibleTo Include="LuaScript.Tests" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\LuaScript.Runtime\LuaScript.Runtime.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="SharpGen.Runtime">
|
||||
<HintPath>$(YMM4DirPath)SharpGen.Runtime.dll</HintPath>
|
||||
<Private>false</Private>
|
||||
</Reference>
|
||||
<Reference Include="Vortice.Direct3D11">
|
||||
<HintPath>$(YMM4DirPath)Vortice.Direct3D11.dll</HintPath>
|
||||
<Private>false</Private>
|
||||
</Reference>
|
||||
<Reference Include="Vortice.DirectX">
|
||||
<HintPath>$(YMM4DirPath)Vortice.DirectX.dll</HintPath>
|
||||
<Private>false</Private>
|
||||
</Reference>
|
||||
<Reference Include="Vortice.D3DCompiler.dll">
|
||||
<HintPath>$(YMM4DirPath)Vortice.D3DCompiler.dll</HintPath>
|
||||
<Private>false</Private>
|
||||
</Reference>
|
||||
<Reference Include="Vortice.DXGI.dll">
|
||||
<HintPath>$(YMM4DirPath)Vortice.DXGI.dll</HintPath>
|
||||
<Private>false</Private>
|
||||
</Reference>
|
||||
<Reference Include="Vortice.Mathematics">
|
||||
<HintPath>$(YMM4DirPath)Vortice.Mathematics.dll</HintPath>
|
||||
<Private>false</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
+7
-4
@@ -7,7 +7,6 @@ using Vortice.Direct3D;
|
||||
using Vortice.Direct3D11;
|
||||
using Vortice.DXGI;
|
||||
using Vortice.Mathematics;
|
||||
using YukkuriMovieMaker.Commons;
|
||||
|
||||
namespace LuaScript.Engine.Shader
|
||||
{
|
||||
@@ -51,6 +50,8 @@ namespace LuaScript.Engine.Shader
|
||||
|
||||
public IBufferCompositor Compositor { get; set; } = SoftwareCompositor.Instance;
|
||||
|
||||
public Action<string, Exception?>? Logger { get; set; }
|
||||
|
||||
private ID3D11Device? _device;
|
||||
private ID3D11DeviceContext? _context;
|
||||
private ID3D11VertexShader? _vertexShader;
|
||||
@@ -503,7 +504,7 @@ namespace LuaScript.Engine.Shader
|
||||
if (!_failureLogged)
|
||||
{
|
||||
_failureLogged = true;
|
||||
Log.Default.Write("LuaScript: obj.pixelshader execution failed; the call is skipped.", ex);
|
||||
WriteLog("LuaScript: obj.pixelshader execution failed; the call is skipped.", ex);
|
||||
}
|
||||
ReleaseDeviceObjects();
|
||||
if (_recreateBudget <= 0)
|
||||
@@ -517,11 +518,13 @@ namespace LuaScript.Engine.Shader
|
||||
return;
|
||||
_failureLogged = true;
|
||||
if (ex is null)
|
||||
Log.Default.Write("LuaScript: Direct3D 11 is unavailable; obj.pixelshader is disabled.");
|
||||
WriteLog("LuaScript: Direct3D 11 is unavailable; obj.pixelshader is disabled.", null);
|
||||
else
|
||||
Log.Default.Write("LuaScript: Direct3D 11 initialization failed; obj.pixelshader is disabled.", ex);
|
||||
WriteLog("LuaScript: Direct3D 11 initialization failed; obj.pixelshader is disabled.", ex);
|
||||
}
|
||||
|
||||
private void WriteLog(string message, Exception? exception) => Logger?.Invoke(message, exception);
|
||||
|
||||
private void ReleaseShaders()
|
||||
{
|
||||
foreach (var compiled in _shaders.Values)
|
||||
@@ -1,4 +1,4 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0-windows10.0.19041.0</TargetFramework>
|
||||
@@ -10,6 +10,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<InternalsVisibleTo Include="LuaScript.Gpu" />
|
||||
<InternalsVisibleTo Include="LuaScript" />
|
||||
<InternalsVisibleTo Include="LuaScript.Tests" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -16,6 +16,9 @@
|
||||
<Project Path="LuaScript.Runtime/LuaScript.Runtime.csproj">
|
||||
<Platform Solution="*|x64" Project="Any CPU" />
|
||||
</Project>
|
||||
<Project Path="LuaScript.Gpu/LuaScript.Gpu.csproj">
|
||||
<Platform Solution="*|x64" Project="Any CPU" />
|
||||
</Project>
|
||||
<Project Path="LuaScript.Tests/LuaScript.Tests.csproj" />
|
||||
<Project Path="LuaScript/LuaScript.csproj">
|
||||
<Platform Solution="*|x64" Project="x64" />
|
||||
|
||||
@@ -187,7 +187,7 @@ namespace LuaScript
|
||||
new SynchronizedCompositor(new HardwareCompositor(_ownCtx), _pixelLoaderSemaphore),
|
||||
SoftwareCompositor.Instance,
|
||||
WarnBufferCompositorDegraded);
|
||||
_pixelShaderRunner = new PixelShaderRunner { Compositor = _bufferCompositor };
|
||||
_pixelShaderRunner = new PixelShaderRunner { Compositor = _bufferCompositor, Logger = WriteGpuLog };
|
||||
_context.ResolverProvider = GetFrameResolver;
|
||||
_context.Compositor = _bufferCompositor;
|
||||
_context.SceneImageLoader = _loadSceneImage ??= LoadSceneImage;
|
||||
@@ -199,6 +199,14 @@ namespace LuaScript
|
||||
private static void WarnBufferCompositorDegraded(Exception ex) =>
|
||||
Log.Default.Write("LuaScript: hardware buffer compositing failed; falling back to the software compositor.", ex);
|
||||
|
||||
private static void WriteGpuLog(string message, Exception? exception)
|
||||
{
|
||||
if (exception is null)
|
||||
Log.Default.Write(message);
|
||||
else
|
||||
Log.Default.Write(message, exception);
|
||||
}
|
||||
|
||||
private AviUtlScriptContext CreateScriptContext()
|
||||
{
|
||||
var context = new AviUtlScriptContext { ResolverProvider = GetFrameResolver };
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0-windows10.0.19041.0</TargetFramework>
|
||||
@@ -97,6 +97,7 @@
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\LuaScript.Kernel\LuaScript.Kernel.csproj" />
|
||||
<ProjectReference Include="..\LuaScript.Compat\LuaScript.Compat.csproj" />
|
||||
<ProjectReference Include="..\LuaScript.Gpu\LuaScript.Gpu.csproj" />
|
||||
<ProjectReference Include="..\LuaScript.Media\LuaScript.Media.csproj" />
|
||||
<ProjectReference Include="..\LuaScript.Runtime\LuaScript.Runtime.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする