Пример #1
0
        private void OnDebugMessage(DebugSource source, DebugType type, int id, DebugSeverity severity, int length, IntPtr message, IntPtr user)
        {
            // Ignores
            if (id == 0x00020071)
            {
                return;                   // memory usage
            }
            if (id == 0x00020084)
            {
                return;                   // Texture state usage warning: Texture 0 is base level inconsistent. Check texture size.
            }
            if (id == 0x00020061)
            {
                return;                   // Framebuffer detailed info: The driver allocated storage for renderbuffer 1.
            }
            if (id == 0x00020004)
            {
                return;                   // Usage warning: Generic vertex attribute array ... uses a pointer with a small value (...). Is this intended to be used as an offset into a buffer object?
            }
            if (id == 0x00020072)
            {
                return;                   // Buffer performance warning: Buffer object ... (bound to ..., usage hint is GL_STATIC_DRAW) is being copied/moved from VIDEO memory to HOST memory.
            }
            if (id == 0x00020074)
            {
                return;                   // Buffer usage warning: Analysis of buffer object ... (bound to ...) usage indicates that the GPU is the primary producer and consumer of data for this buffer object.  The usage hint s upplied with this buffer object, GL_STATIC_DRAW, is inconsistent with this usage pattern.  Try using GL_STREAM_COPY_ARB, GL_STATIC_COPY_ARB, or GL_DYNAMIC_COPY_ARB instead.
            }
            string sourceString = source.ToString();

            if (sourceString.StartsWith("DebugSource"))
            {
                sourceString = sourceString.Remove(0, "DebugSource".Length);
            }

            string typeString = type.ToString();

            if (typeString.StartsWith("DebugType"))
            {
                typeString = typeString.Remove(0, "DebugType".Length);
            }

            string severityString = severity.ToString();

            if (severityString.StartsWith("DebugSeverity"))
            {
                severityString = severityString.Remove(0, "DebugSeverity".Length);
            }

            string messageString = string.Format("(OpenGL) ({0}) ({1}) ({2}) {3}", severityString, sourceString, typeString, Marshal.PtrToStringAnsi(message, length));


            Log.Debug(messageString);
            Log.FlushBuffer();
        }
Пример #2
0
        private static string FormatMsg(DebugSeverity severity, string msg, object[] param)
        {
            string retVal = msg;

            if (param != null)
            {
                for (int i = 0; i < param.Length; i++)
                {
                    msg.Replace("{" + i + "}", param[i].ToString());
                }
            }

            return(String.Format("{2} [{3}] :{0} #{1}", msg, Thread.CurrentThread.ManagedThreadId,
                                 DateTime.Now.ToString("g"), severity.ToString()));
        }
Пример #3
0
        static void ProcessMessage(DebugSource source, DebugType type, int id, DebugSeverity severity, string message)
        {
            if (type == DebugType.DebugTypePushGroup || type == DebugType.DebugTypePopGroup)
            {
                return;
            }
            string msg = message + " (source: " + source.ToString() + "; type: " + type.ToString() + "; id: " + id.ToString() + "; severity: " + severity.ToString() + ")";

            OutputTypeGlob outputType = OutputTypeGlob.LogOnly;

            if (severity == DebugSeverity.DebugSeverityMedium || severity == DebugSeverity.DebugSeverityHigh)
            {
                outputType = OutputTypeGlob.PerformanceWarning;
            }
            if (id == 131185 || id == 131186 || id == 131154)            // Buffer memory info, pixel path performance (warning generated by blitFramebuffers)
            {
                return;
            }

            _debugOutput.Print(outputType, msg);
            _debugOutput.Print(OutputTypeGlob.LogOnly, Environment.StackTrace);
        }
Пример #4
0
    public static void GLDebugProc(DebugSource source, DebugType type, int id, DebugSeverity severity, int length, IntPtr message, IntPtr userParam)
    {
        string strMessage = Marshal.PtrToStringAnsi(message);


        Console.WriteLine($"[{ (type == DebugType.DebugTypeError ? "**GL ERROR**" : type.ToString())}; {severity.ToString()}]: {strMessage}; From: {source.ToString()}");
        Debugger.Break();
    }
Пример #5
0
 private void DBGProc(DebugSource source, DebugType type, int id, DebugSeverity severity, int length, IntPtr message, IntPtr userParam)
 {
     Debug.WriteLine("OpenGL: [" + severity.ToString() + "] [" + type.ToString() + "] [" + source.ToString() + "] : " + Marshal.PtrToStringAnsi(message));
 }
Пример #6
0
        private static string FormatMsg(DebugSeverity severity, string msg, object[] param)
        {
            string retVal = msg;
            if (param != null)
            {
                for (int i = 0; i < param.Length; i++)
                {
                    msg.Replace("{" + i + "}", param[i].ToString());
                }
            }

            return String.Format("{2} [{3}] :{0} #{1}", msg, Thread.CurrentThread.ManagedThreadId,
                                                                DateTime.Now.ToString("g"), severity.ToString());
        }