public static DebugSamplerState Parse(DebugBytecodeReader reader, DebugBytecodeReader stateReader)
        {
            var result          = new DebugSamplerState();
            var assignmentCount = stateReader.ReadUInt32("AssignmentCount");

            for (int j = 0; j < assignmentCount; j++)
            {
                stateReader.AddIndent($"Assignment {j}");
                result.Assignments.Add(DebugAssignment.Parse(reader, stateReader));
                stateReader.RemoveIndent();
            }
            return(result);
        }
Esempio n. 2
0
        public static DebugPass Parse(DebugBytecodeReader reader, DebugBytecodeReader passReader)
        {
            var result = new DebugPass();

            result.NameOffset      = passReader.ReadUInt32("NameOffset");
            result.AnnotationCount = passReader.ReadUInt32("AnnoationCount");
            result.AssignmentCount = passReader.ReadUInt32("AssignmentCount");
            for (int i = 0; i < result.AnnotationCount; i++)
            {
                passReader.AddIndent($"Annotation {i}");
                result.Annotations.Add(DebugAnnotation.Parse(reader, passReader));
                passReader.RemoveIndent();
            }
            for (int i = 0; i < result.AssignmentCount; i++)
            {
                passReader.AddIndent($"Assignment {i}");
                result.Assignments.Add(DebugAssignment.Parse(reader, passReader));
                passReader.RemoveIndent();
            }
            var nameReader = reader.CopyAtOffset("NameReader", passReader, (int)result.NameOffset);

            result.Name = nameReader.TryReadString("Name");
            return(result);
        }