Clean up code
This commit is contained in:
@@ -3,6 +3,7 @@ using Ghost.Editor.Models;
|
|||||||
using Ghost.Engine;
|
using Ghost.Engine;
|
||||||
using Misaki.HighPerformance.LowLevel.Buffer;
|
using Misaki.HighPerformance.LowLevel.Buffer;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
namespace Ghost.Editor;
|
namespace Ghost.Editor;
|
||||||
|
|
||||||
@@ -52,6 +53,23 @@ internal static class ActivationHandler
|
|||||||
return arguments;
|
return arguments;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void LoadDll()
|
||||||
|
{
|
||||||
|
var currentDir = AppContext.BaseDirectory;
|
||||||
|
var platform = OperatingSystem.IsWindows() ? "win" :
|
||||||
|
OperatingSystem.IsLinux() ? "linux" :
|
||||||
|
OperatingSystem.IsMacOS() ? "osx" : "unknown";
|
||||||
|
var arch = Environment.Is64BitProcess ? "x64" : "x86";
|
||||||
|
var nativeDllDir = Path.Combine(currentDir, "runtimes", platform + "-" + arch, "native");
|
||||||
|
if (Directory.Exists(nativeDllDir))
|
||||||
|
{
|
||||||
|
foreach (var dll in Directory.EnumerateFiles(nativeDllDir, "*.dll"))
|
||||||
|
{
|
||||||
|
NativeLibrary.Load(dll);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static async Task HandleAsync(LaunchArguments args)
|
public static async Task HandleAsync(LaunchArguments args)
|
||||||
{
|
{
|
||||||
var opts = new AllocationManagerInitOpts
|
var opts = new AllocationManagerInitOpts
|
||||||
@@ -66,7 +84,8 @@ internal static class ActivationHandler
|
|||||||
await Task.Run(() =>
|
await Task.Run(() =>
|
||||||
{
|
{
|
||||||
TypeCache.Init();
|
TypeCache.Init();
|
||||||
App.GetService<EngineCore>();
|
//LoadDll();
|
||||||
|
//App.GetService<EngineCore>();
|
||||||
});
|
});
|
||||||
|
|
||||||
// await ((Core.AssetHandle.AssetService)App.GetService<IAssetService>()).Init();
|
// await ((Core.AssetHandle.AssetService)App.GetService<IAssetService>()).Init();
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ public sealed partial class EngineCore : IDisposable
|
|||||||
public JobScheduler JobScheduler => _jobScheduler;
|
public JobScheduler JobScheduler => _jobScheduler;
|
||||||
public RenderSystem RenderSystem => _renderSystem;
|
public RenderSystem RenderSystem => _renderSystem;
|
||||||
|
|
||||||
internal EngineCore()
|
public EngineCore()
|
||||||
{
|
{
|
||||||
_jobScheduler = new JobScheduler(Environment.ProcessorCount - 2); // We -2 here, one for main thread, one for render thread
|
_jobScheduler = new JobScheduler(Environment.ProcessorCount - 2); // We -2 here, one for main thread, one for render thread
|
||||||
|
|
||||||
|
|||||||
@@ -357,34 +357,6 @@ public unsafe partial class TestRenderPipeline : IRenderPipeline
|
|||||||
builder.SetColorAttachment(backbuffer, 0);
|
builder.SetColorAttachment(backbuffer, 0);
|
||||||
builder.SetRenderFunc<MeshletDebugPassData>(static (data, ctx)=>
|
builder.SetRenderFunc<MeshletDebugPassData>(static (data, ctx)=>
|
||||||
{
|
{
|
||||||
//var cmd = ctx.GetCommandBufferUnsafe();
|
|
||||||
//var (backBufferDesc, err) = ctx.ResourceDatabase.GetResourceDescription(ctx.GetActualResource(data.backbuffer.AsResource()));
|
|
||||||
//if (err != Error.None)
|
|
||||||
//{
|
|
||||||
// return;
|
|
||||||
//}
|
|
||||||
|
|
||||||
//var viewportDesc = new ViewportDesc
|
|
||||||
//{
|
|
||||||
// X = 0,
|
|
||||||
// Y = 0,
|
|
||||||
// Width = backBufferDesc.TextureDescription.Width,
|
|
||||||
// Height = backBufferDesc.TextureDescription.Height,
|
|
||||||
// MinDepth = 0,
|
|
||||||
// MaxDepth = 1
|
|
||||||
//};
|
|
||||||
|
|
||||||
//var rectDesc = new ScissorRectDesc
|
|
||||||
//{
|
|
||||||
// Left = 0,
|
|
||||||
// Top = 0,
|
|
||||||
// Right = backBufferDesc.TextureDescription.Width,
|
|
||||||
// Bottom = backBufferDesc.TextureDescription.Height
|
|
||||||
//};
|
|
||||||
|
|
||||||
//cmd.SetViewport(viewportDesc);
|
|
||||||
//cmd.SetScissorRect(rectDesc);
|
|
||||||
|
|
||||||
ctx.SetGlobalData(data.globalIndex, data.viewIndex);
|
ctx.SetGlobalData(data.globalIndex, data.viewIndex);
|
||||||
ctx.SetInstanceData(data.instanceIndex);
|
ctx.SetInstanceData(data.instanceIndex);
|
||||||
ctx.SetActiveMaterial(data.material);
|
ctx.SetActiveMaterial(data.material);
|
||||||
|
|||||||
Reference in New Issue
Block a user