private static void debugCallback(DebugSource source, DebugType type, int id, DebugSeverity severity, int length, IntPtr message, IntPtr userParam) { string _messageString = Marshal.PtrToStringAnsi(message, length); string _messageSource = source.ToString().Remove(0, 11); switch (severity) { case DebugSeverity.DebugSeverityHigh: Logger.Log(new LogMessage(LogSeverity.Error, _messageString, null, _messageSource)); break; case DebugSeverity.DebugSeverityMedium: Logger.Log(new LogMessage(LogSeverity.Error, _messageString, null, _messageSource)); break; case DebugSeverity.DebugSeverityLow: Logger.Log(new LogMessage(LogSeverity.Warning, _messageString, null, _messageSource)); break; case DebugSeverity.DebugSeverityNotification: case DebugSeverity.DontCare: Logger.Log(new LogMessage(LogSeverity.Info, _messageString, null, _messageSource)); break; } }
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(); }
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); }
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(); }
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)); }