private void RequestOpenXRFeatures()
        {
            var instance = OpenXRSettings.Instance;

            if (instance == null || instance.features == null)
            {
                return;
            }

            StringBuilder requestedLog = new StringBuilder("");
            StringBuilder failedLog    = new StringBuilder("");
            uint          count        = 0;
            uint          failedCount  = 0;

            foreach (var feature in instance.features)
            {
                if (feature == null || !feature.enabled)
                {
                    continue;
                }

                ++count;

                requestedLog.Append($"  {feature.nameUi}: Version={feature.version}, Company=\"{feature.company}\"");

                if (!string.IsNullOrEmpty(feature.openxrExtensionStrings))
                {
                    requestedLog.Append($", Extensions=\"{feature.openxrExtensionStrings}\"");

                    // Check to see if any of the required extensions are not supported by the runtime
                    foreach (var extensionString in feature.openxrExtensionStrings.Split(' '))
                    {
                        if (string.IsNullOrWhiteSpace(extensionString))
                        {
                            continue;
                        }
                        if (!Internal_RequestEnableExtensionString(extensionString))
                        {
                            ++failedCount;
                            failedLog.Append($"  {extensionString}: Feature=\"{feature.nameUi}\": Version={feature.version}, Company=\"{feature.company}\"\n");
                        }
                    }
                }

                requestedLog.Append("\n");
            }

            var section = DiagnosticReport.GetSection("OpenXR Runtime Info");

            DiagnosticReport.AddSectionBreak(section);
            DiagnosticReport.AddSectionEntry(section, "Features requested to be enabled", $"({count})\n{requestedLog.ToString()}");
            DiagnosticReport.AddSectionBreak(section);
            DiagnosticReport.AddSectionEntry(section, "Requested feature extensions not supported by runtime", $"({failedCount})\n{failedLog.ToString()}");
        }
Beispiel #2
0
        private void RequestOpenXRFeatures()
        {
            var instance = OpenXRSettings.Instance;

            if (instance == null || instance.features == null)
            {
                return;
            }

            StringBuilder requestedLog = new StringBuilder("");
            StringBuilder failedLog    = new StringBuilder("");
            uint          count        = 0;
            uint          failedCount  = 0;

            foreach (var feature in instance.features)
            {
                if (feature != null && feature.enabled)
                {
                    ++count;
                    if (string.IsNullOrEmpty(feature.openxrExtensionStrings))
                    {
                        requestedLog.Append($"    Name={feature.nameUi} Extension=NA Version={feature.version}\n");
                        continue;
                    }
                    else
                    {
                        requestedLog.Append($"    Name={feature.nameUi} Extension={feature.openxrExtensionStrings} Version={feature.version}\n");
                    }

                    foreach (var extensionString in feature.openxrExtensionStrings.Split(' '))
                    {
                        if (string.IsNullOrEmpty(extensionString))
                        {
                            continue;
                        }
                        if (!Internal_RequestEnableExtensionString(extensionString))
                        {
                            ++failedCount;
                            failedLog.Append($"    Name={feature.nameUi} Extension={extensionString}  Version={feature.version}\n");
                        }
                    }
                }
            }

            var section = DiagnosticReport.GetSection("OpenXR Runtime Info");

            DiagnosticReport.AddSectionBreak(section);
            DiagnosticReport.AddSectionEntry(section, "Features requested to be enabled", $"{count}\n{requestedLog.ToString()}");
            DiagnosticReport.AddSectionBreak(section);
            DiagnosticReport.AddSectionEntry(section, "Features failed to be enabled", $"{failedCount}\n{failedLog.ToString()}");
        }
Beispiel #3
0
        private static void DebugLogEnabledSpecExtensions()
        {
            var section = DiagnosticReport.GetSection("OpenXR Runtime Info");

            DiagnosticReport.AddSectionBreak(section);

            var extensions = OpenXRRuntime.GetEnabledExtensions();
            var log        = new StringBuilder($"({extensions.Length})\n");

            foreach (var extension in extensions)
            {
                log.Append($"  Name={extension} Version={OpenXRRuntime.GetExtensionVersion(extension)}\n");
            }

            DiagnosticReport.AddSectionEntry(section, "Spec extensions enabled", log.ToString());
        }