Пример #1
0
 private static void AddDebugQueueMessage(string message)
 {
     if (DebugInfoQueue != null)
     {
         DebugInfoQueue.AddApplicationMessage(MessageSeverity.Information, message);
     }
 }
Пример #2
0
        private static string GetDebugOutput()
        {
            var stringBuilder = DebugStringBuilder;

            if (DebugInfoQueue != null &&
                // only main render thread has to be able to log to the output, otherwise race conditions happen
                MyRenderProxy.RenderThread.SystemThread == System.Threading.Thread.CurrentThread)
            {
                stringBuilder.Clear();
                for (int i = 0; i < DebugInfoQueue.NumStoredMessages; i++)
                {
                    var    msg  = DebugInfoQueue.GetMessage(i);
                    string text = String.Format("D3D11 {0}: {1} [ {2} #{3}: {4} ] {5}/{6}\n", msg.Severity.ToString(), msg.Description.Replace("\0", ""), msg.Category.ToString(), (int)msg.Id, msg.Id.ToString(), i, DebugInfoQueue.NumStoredMessages);
                    stringBuilder.AppendLine(text);
                }
                if ((DebugInfoQueue.NumMessagesDiscardedByMessageCountLimit - m_lastSkippedCount) > 0)
                {
                    stringBuilder.Append("Skipped messages: ");
                    stringBuilder.Append(DebugInfoQueue.NumMessagesDiscardedByMessageCountLimit - m_lastSkippedCount);
                    m_lastSkippedCount = DebugInfoQueue.NumMessagesDiscardedByMessageCountLimit;
                }

                DebugInfoQueue.ClearStoredMessages();
            }
            return(stringBuilder.ToString());
        }
Пример #3
0
        private static void InitDebugOutput(bool debugDevice)
        {
            if (!debugDevice)
            {
                return;
            }

            DebugInfoQueue = Device.QueryInterface <InfoQueue>();
            DebugInfoQueue.SetBreakOnSeverity(MessageSeverity.Corruption, true);
            DebugInfoQueue.SetBreakOnSeverity(MessageSeverity.Error, true);
            DebugInfoQueue.MessageCountLimit = 4096;
            DebugInfoQueue.ClearStorageFilter();
            if (!MyCompilationSymbols.DX11DebugOutputEnableInfo)
            {
                InfoQueueFilter filter = new InfoQueueFilter();
                filter.DenyList               = new InfoQueueFilterDescription();
                filter.DenyList.Severities    = new MessageSeverity[1];
                filter.DenyList.Severities[0] = MessageSeverity.Information;
                DebugInfoQueue.AddStorageFilterEntries(filter);
            }
        }