mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 13:01:52 +00:00
Even more Profiling
This commit is contained in:
@@ -19,11 +19,15 @@ namespace GlitchyEngine.Renderer
|
|||||||
Debug.Profiler.ProfileRendererFunction!();
|
Debug.Profiler.ProfileRendererFunction!();
|
||||||
|
|
||||||
Shader.PlattformCompileShaderFromSource(code, macros, entryPoint, "ps_5_0", DefaultCompileFlags, out nativeCode);
|
Shader.PlattformCompileShaderFromSource(code, macros, entryPoint, "ps_5_0", DefaultCompileFlags, out nativeCode);
|
||||||
|
|
||||||
var result = NativeDevice.CreatePixelShader(nativeCode.GetBufferPointer(), nativeCode.GetBufferSize(), null, &nativeShader);
|
|
||||||
if(result.Failed)
|
|
||||||
{
|
{
|
||||||
Log.EngineLogger.Error($"Failed to create pixel shader: Message ({(int)result}): {result}");
|
Debug.Profiler.ProfileResourceScope!("CreateNativePixelShader");
|
||||||
|
|
||||||
|
var result = NativeDevice.CreatePixelShader(nativeCode.GetBufferPointer(), nativeCode.GetBufferSize(), null, &nativeShader);
|
||||||
|
if(result.Failed)
|
||||||
|
{
|
||||||
|
Log.EngineLogger.Error($"Failed to create pixel shader: Message ({(int)result}): {result}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Reflect(nativeCode);
|
Reflect(nativeCode);
|
||||||
|
|||||||
@@ -56,10 +56,14 @@ namespace GlitchyEngine.Renderer
|
|||||||
Debug.Profiler.ProfileResourceFunction!();
|
Debug.Profiler.ProfileResourceFunction!();
|
||||||
|
|
||||||
ID3D11ShaderReflection* reflection = null;
|
ID3D11ShaderReflection* reflection = null;
|
||||||
var result = D3DCompiler.D3DReflect(shaderCode.GetBufferPointer(), shaderCode.GetBufferSize(), &reflection);
|
|
||||||
if(result.Failed)
|
|
||||||
{
|
{
|
||||||
Log.EngineLogger.Error($"Failed to reflect shader: Message ({(int)result}): {result}");
|
Debug.Profiler.ProfileResourceScope!("D3DReflect");
|
||||||
|
|
||||||
|
var result = D3DCompiler.D3DReflect(shaderCode.GetBufferPointer(), shaderCode.GetBufferSize(), &reflection);
|
||||||
|
if(result.Failed)
|
||||||
|
{
|
||||||
|
Log.EngineLogger.Error($"Failed to reflect shader: Message ({(int)result}): {result}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
reflection.GetDescription(let desc);
|
reflection.GetDescription(let desc);
|
||||||
|
|||||||
@@ -21,10 +21,14 @@ namespace GlitchyEngine.Renderer
|
|||||||
|
|
||||||
Shader.PlattformCompileShaderFromSource(code, macros, entryPoint, "vs_5_0", DefaultCompileFlags, out nativeCode);
|
Shader.PlattformCompileShaderFromSource(code, macros, entryPoint, "vs_5_0", DefaultCompileFlags, out nativeCode);
|
||||||
|
|
||||||
var result = NativeDevice.CreateVertexShader(nativeCode.GetBufferPointer(), nativeCode.GetBufferSize(), null, &nativeShader);
|
|
||||||
if(result.Failed)
|
|
||||||
{
|
{
|
||||||
Log.EngineLogger.Error($"Failed to create vertex shader: Message ({(int)result}): {result}");
|
Debug.Profiler.ProfileResourceScope!("CreateNativeVertexShader");
|
||||||
|
|
||||||
|
var result = NativeDevice.CreateVertexShader(nativeCode.GetBufferPointer(), nativeCode.GetBufferSize(), null, &nativeShader);
|
||||||
|
if(result.Failed)
|
||||||
|
{
|
||||||
|
Log.EngineLogger.Error($"Failed to create vertex shader: Message ({(int)result}): {result}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Reflect(nativeCode);
|
Reflect(nativeCode);
|
||||||
|
|||||||
@@ -204,7 +204,11 @@ namespace GlitchyEngine
|
|||||||
_windowClass.HInstance = (.)_instanceHandle;
|
_windowClass.HInstance = (.)_instanceHandle;
|
||||||
|
|
||||||
if (desc.Icon.Ptr != null)
|
if (desc.Icon.Ptr != null)
|
||||||
|
{
|
||||||
|
Debug.Profiler.ProfileScope!("LoadIcon");
|
||||||
|
|
||||||
_windowClass.Icon = LoadImageW(0, desc.Icon.ToScopedNativeWChar!(), .Icon, 0, 0, .LoadFromFile);
|
_windowClass.Icon = LoadImageW(0, desc.Icon.ToScopedNativeWChar!(), .Icon, 0, 0, .LoadFromFile);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
_windowClass.Icon = 0;
|
_windowClass.Icon = 0;
|
||||||
|
|
||||||
@@ -219,8 +223,12 @@ namespace GlitchyEngine
|
|||||||
Runtime.FatalError("Failed to register window class");
|
Runtime.FatalError("Failed to register window class");
|
||||||
}
|
}
|
||||||
|
|
||||||
_windowHandle = CreateWindowExW(.None, _windowClass.ClassName, desc.Title.ToScopedNativeWChar!(), .WS_OVERLAPPEDWINDOW | .WS_VISIBLE,
|
{
|
||||||
CW_USEDEFAULT, CW_USEDEFAULT, desc.Width, desc.Height, 0, 0, (.)_instanceHandle, null);
|
Debug.Profiler.ProfileScope!("CreateWindow");
|
||||||
|
|
||||||
|
_windowHandle = CreateWindowExW(.None, _windowClass.ClassName, desc.Title.ToScopedNativeWChar!(), .WS_OVERLAPPEDWINDOW | .WS_VISIBLE,
|
||||||
|
CW_USEDEFAULT, CW_USEDEFAULT, desc.Width, desc.Height, 0, 0, (.)_instanceHandle, null);
|
||||||
|
}
|
||||||
|
|
||||||
_graphicsContext = new GraphicsContext(_windowHandle);
|
_graphicsContext = new GraphicsContext(_windowHandle);
|
||||||
_graphicsContext.Init();
|
_graphicsContext.Init();
|
||||||
|
|||||||
@@ -14,25 +14,34 @@ namespace GlitchyEngine
|
|||||||
{
|
{
|
||||||
Debug.Profiler.BeginProfiling();
|
Debug.Profiler.BeginProfiling();
|
||||||
|
|
||||||
Log.EngineLogger.Info("Initializing Application...");
|
Application app;
|
||||||
|
|
||||||
Stopwatch initWatch = scope Stopwatch();
|
{
|
||||||
|
Debug.Profiler.ProfileScope!("Initialize");
|
||||||
|
|
||||||
|
Log.EngineLogger.Info("Initializing Application...");
|
||||||
|
|
||||||
var app = CreateApplication();
|
Stopwatch initWatch = scope Stopwatch();
|
||||||
|
|
||||||
initWatch.Stop();
|
app = CreateApplication();
|
||||||
|
|
||||||
Log.EngineLogger.Info($"Application initialized ({initWatch.ElapsedMilliseconds}ms).");
|
initWatch.Stop();
|
||||||
Log.EngineLogger.Info("Running App...");
|
|
||||||
|
Log.EngineLogger.Info($"Application initialized ({initWatch.ElapsedMilliseconds}ms).");
|
||||||
|
Log.EngineLogger.Info("Running App...");
|
||||||
|
}
|
||||||
|
|
||||||
app.Run();
|
app.Run();
|
||||||
|
|
||||||
Log.EngineLogger.Info("Uninitializing Application...");
|
{
|
||||||
|
Debug.Profiler.ProfileScope!("Shutdown");
|
||||||
delete app;
|
|
||||||
|
Log.EngineLogger.Info("Uninitializing Application...");
|
||||||
Log.EngineLogger.Info("Application uninitialized.");
|
|
||||||
|
delete app;
|
||||||
|
|
||||||
|
Log.EngineLogger.Info("Application uninitialized.");
|
||||||
|
}
|
||||||
Debug.Profiler.EndProfiling();
|
Debug.Profiler.EndProfiling();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user