/// <param name="ObjectType">The type of the object</param>
 /// <param name="Object">The handle of the object, cast to uint64_t</param>
 /// <param name="TagName">The name of the tag to set on the object</param>
 /// <param name="Tag">Tag data to attach to the object</param>
 public DebugMarkerObjectTagInfoEXT(DebugReportObjectTypeEXT ObjectType, UInt64 Object, UInt64 TagName, IntPtr[] Tag) : this()
 {
     this.ObjectType = ObjectType;
     this.Object     = Object;
     this.TagName    = TagName;
     this.Tag        = Tag;
 }
Ejemplo n.º 2
0
 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);
 }
Ejemplo n.º 3
0
 public DebugMarkerObjectNameInfoEXT
 (
     StructureType sType = StructureType.DebugMarkerObjectNameInfoExt,
     void *pNext         = default,
     DebugReportObjectTypeEXT objectType = default,
     ulong @object     = default,
     byte *pObjectName = default
 )
 {
     SType       = sType;
     PNext       = pNext;
     ObjectType  = objectType;
     Object      = @object;
     PObjectName = pObjectName;
 }
Ejemplo n.º 4
0
        Boolean32 OnDebugReport(
            DebugReportFlagBitsEXT flags,
            DebugReportObjectTypeEXT objectType,
            ulong @object,
            int location,
            int messageCode,
            byte *pLayerPrefix,
            byte *pMessage,
            IntPtr pUserData)
        {
            var layerPrefix = new string ((sbyte *)pLayerPrefix );
            var message     = new string ((sbyte *)pMessage );

            Console.WriteLine("FlagBits:{0}; ObjType:{1}; Obj:0x{2:x}; Loc:{3}; MsgCode:{4}; Layer:{5}; Msg:{6};",
                              flags, objectType, @object, location, messageCode, layerPrefix, message);
            return(false);
        }
Ejemplo n.º 5
0
        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);
        }
 public DebugMarkerObjectTagInfoEXT
 (
     StructureType sType = StructureType.DebugMarkerObjectTagInfoExt,
     void *pNext         = default,
     DebugReportObjectTypeEXT objectType = default,
     ulong @object   = default,
     ulong tagName   = default,
     UIntPtr tagSize = default,
     void *pTag      = default
 )
 {
     SType      = sType;
     PNext      = pNext;
     ObjectType = objectType;
     Object     = @object;
     TagName    = tagName;
     TagSize    = tagSize;
     PTag       = pTag;
 }
 /// <param name="ObjectType">The type of the object</param>
 /// <param name="Object">The handle of the object, cast to uint64_t</param>
 /// <param name="ObjectName">Name to apply to the object</param>
 public DebugMarkerObjectNameInfoEXT(DebugReportObjectTypeEXT ObjectType, UInt64 Object, String ObjectName) : this()
 {
     this.ObjectType = ObjectType;
     this.Object     = Object;
     this.ObjectName = ObjectName;
 }
Ejemplo n.º 8
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());
 }
Ejemplo n.º 9
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, [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());
 }
Ejemplo n.º 10
0
 /// <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);
 }
Ejemplo n.º 11
0
 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);