More profiling

This commit is contained in:
Simon Lübeß
2022-05-09 22:53:48 +02:00
parent b37b1b4bf9
commit fe0d5fa529
2 changed files with 76 additions and 48 deletions
+17 -2
View File
@@ -67,6 +67,8 @@ namespace GlitchyEngine.Renderer
*/
public void Bind(GraphicsContext context)
{
Debug.Profiler.ProfileRendererFunction!();
for(let (name, texture) in _textures)
{
_effect.SetTexture(name, texture);
@@ -106,11 +108,24 @@ namespace GlitchyEngine.Renderer
[Inline]
private void SetVariable<T>(String name, T value) where T : struct
{
if(_variables.TryGetValue(name, let entry))
bool b = false;
(uint32 Offset, BufferVariable Variable) entry;
{
Debug.Profiler.ProfileRendererScope!("TryGetValue");
b = _variables.TryGetValue(name, out entry);
}
if(b)
{
entry.Variable.EnsureTypeMatch<T>();
{
Debug.Profiler.ProfileRendererScope!("RawPointer!");
RawPointer!<T>(entry.Offset) = value;
RawPointer!<T>(entry.Offset) = value;
}
}
else
{