Bool32 DebugReport(DebugReportFlagsEXT flags, DebugReportObjectTypeEXT objectType, ulong @object, IntPtr location, int messageCode, string layerPrefix, string message, IntPtr userData) { if (messageCode != 0) { Console.WriteLine(message); } return(false); }
public DebugReportCallbackCreateInfoEXT ( StructureType sType = StructureType.DebugReportCallbackCreateInfoExt, void *pNext = default, DebugReportFlagsEXT flags = default, FuncPtr pfnCallback = default, void *pUserData = default ) { SType = sType; PNext = pNext; Flags = flags; PfnCallback = pfnCallback; PUserData = pUserData; }
private unsafe static uint DebugReport( uint flags, DebugReportObjectTypeEXT objectType, ulong @object, nuint location, int messageCode, byte *layerPrefix, byte *message, void *userData) { var msg = Marshal.PtrToStringAnsi((IntPtr)message); foreach (string excludedMessagePart in ExcludedMessages) { if (msg.Contains(excludedMessagePart)) { return(0); } } DebugReportFlagsEXT debugFlags = (DebugReportFlagsEXT)flags; if (debugFlags.HasFlag(DebugReportFlagsEXT.DebugReportErrorBitExt)) { Logger.Error?.Print(LogClass.Gpu, msg); //throw new Exception(msg); } else if (debugFlags.HasFlag(DebugReportFlagsEXT.DebugReportWarningBitExt)) { Logger.Warning?.Print(LogClass.Gpu, msg); } else if (debugFlags.HasFlag(DebugReportFlagsEXT.DebugReportInformationBitExt)) { Logger.Info?.Print(LogClass.Gpu, msg); } else if (debugFlags.HasFlag(DebugReportFlagsEXT.DebugReportPerformanceWarningBitExt)) { Logger.Warning?.Print(LogClass.Gpu, msg); } else { Logger.Debug?.Print(LogClass.Gpu, msg); } return(0); }
/// <summary>To be documented.</summary> public static unsafe void DebugReportMessage(this ExtDebugReport thisApi, [Count(Count = 0)] Instance instance, [Count(Count = 0)] DebugReportFlagsEXT flags, [Count(Count = 0)] DebugReportObjectTypeEXT objectType, [Count(Count = 0)] ulong @object, [Count(Count = 0)] nuint location, [Count(Count = 0)] int messageCode, [Flow(FlowDirection.In), UnmanagedType(Silk.NET.Core.Native.UnmanagedType.LPUTF8Str)] string pLayerPrefix, [Count(Count = 0), Flow(FlowDirection.In)] ReadOnlySpan <byte> pMessage) { // SpanOverloader thisApi.DebugReportMessage(instance, flags, objectType, @object, location, messageCode, pLayerPrefix, in pMessage.GetPinnableReference()); }
/// <summary>To be documented.</summary> public static unsafe void DebugReportMessage(this ExtDebugReport thisApi, [Count(Count = 0)] Instance instance, [Count(Count = 0)] DebugReportFlagsEXT flags, [Count(Count = 0)] DebugReportObjectTypeEXT objectType, [Count(Count = 0)] ulong @object, [Count(Count = 0)] nuint location, [Count(Count = 0)] int messageCode, [Count(Count = 0), Flow(FlowDirection.In)] ReadOnlySpan <byte> pLayerPrefix, [Count(Count = 0), Flow(FlowDirection.In)] ReadOnlySpan <byte> pMessage) { // SpanOverloader thisApi.DebugReportMessage(instance, flags, objectType, @object, location, messageCode, in pLayerPrefix.GetPinnableReference(), in pMessage.GetPinnableReference()); }
/// <summary>To be added.</summary> public unsafe void DebugReportMessage([Count(Count = 0)] Instance instance, [Count(Count = 0)] DebugReportFlagsEXT flags, [Count(Count = 0)] DebugReportObjectTypeEXT objectType, [Count(Count = 0)] ulong @object, [Count(Count = 0)] uint location, [Count(Count = 0)] int messageCode, [Flow(FlowDirection.In)] string pLayerPrefix, [Flow(FlowDirection.In)] string pMessage) { // IntPtrOverloader DebugReportMessage(instance, flags, objectType, @object, new UIntPtr(location), messageCode, pLayerPrefix, pMessage); }
public abstract void DebugReportMessage([Count(Count = 0)] Instance instance, [Count(Count = 0)] DebugReportFlagsEXT flags, [Count(Count = 0)] DebugReportObjectTypeEXT objectType, [Count(Count = 0)] ulong @object, [Count(Count = 0)] UIntPtr location, [Count(Count = 0)] int messageCode, [Flow(FlowDirection.In)] string pLayerPrefix, [Flow(FlowDirection.In)] string pMessage);
/// <param name="Flags">Indicates which events call this callback</param> /// <param name="Callback">Function pointer of a callback function</param> public DebugReportCallbackCreateInfoEXT(DebugReportFlagsEXT Flags, IntPtr Callback) : this() { this.Flags = Flags; this.Callback = Callback; }