Пример #1
0
        public static DebugShaderVersion ParseAon9(DebugBytecodeReader reader)
        {
            byte   minor      = reader.ReadByte("minorVersion");
            byte   major      = reader.ReadByte("majorVersion");
            ushort shaderType = reader.ReadUInt16("programType");

            return(new DebugShaderVersion
            {
                MinorVersion = minor,
                MajorVersion = major,
                ProgramType = shaderType == 0xFFFF ? ProgramType.PixelShader : ProgramType.VertexShader
            });
        }
Пример #2
0
        internal static DebugShaderVersion ParseRdef(DebugBytecodeReader reader)
        {
            byte        minorVersion     = reader.ReadByte("minorVersion");
            byte        majorVersion     = reader.ReadByte("majorVersion");
            ushort      programTypeValue = reader.ReadUInt16("programTypeValue");
            ProgramType programType;

            switch (programTypeValue)
            {
            case 0xFFFF:
                programType = ProgramType.PixelShader;
                break;

            case 0xFFFE:
                programType = ProgramType.VertexShader;
                break;

            case 0x4853:
                programType = ProgramType.HullShader;
                break;

            case 0x4753:
                programType = ProgramType.GeometryShader;
                break;

            case 0x4453:
                programType = ProgramType.DomainShader;
                break;

            case 0x4353:
                programType = ProgramType.ComputeShader;
                break;

            case 0x4C46:
                programType = ProgramType.LibraryShader;
                break;

            default:
                throw new ParseException(string.Format("Unknown program type: 0x{0:X}", programTypeValue));
            }
            return(new DebugShaderVersion
            {
                MajorVersion = majorVersion,
                MinorVersion = minorVersion,
                ProgramType = programType
            });
        }
Пример #3
0
        public static DebugNumber Parse(DebugBytecodeReader reader)
        {
            const int byteCount = 4;
            var       bytes     = new byte[byteCount];

            for (int i = 0; i < byteCount; i++)
            {
                bytes[i] = reader.ReadByte($"NumberByte{i}");
            }
            return(new DebugNumber(bytes));
        }