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); }
public static DebugAssignment Parse(DebugBytecodeReader reader, DebugBytecodeReader assignmentReader) { var result = new DebugAssignment(); result.Type = assignmentReader.ReadEnum32 <StateType>("Type"); result.ArrayIndex = assignmentReader.ReadUInt32("ArrayIndex"); result.TypeOffset = assignmentReader.ReadUInt32("TypeOffset"); result.ValueOffset = assignmentReader.ReadUInt32("ValueOffset"); var variableReader = reader.CopyAtOffset("AssignmentTypeReader", assignmentReader, (int)result.TypeOffset); result.Parameter = DebugParameter.Parse(reader, variableReader); var valueReader = reader.CopyAtOffset("ValueReader", assignmentReader, (int)result.ValueOffset); result.Value = result.Parameter.ReadParameterValue(valueReader); return(result); }
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); }