Ejemplo n.º 1
0
        public GlslProgram Decompile(int[] Code, GalShaderType ShaderType)
        {
            ShaderIrBlock Block = ShaderDecoder.DecodeBasicBlock(Code, 0);

            ShaderIrNode[] Nodes = Block.GetNodes();

            Decl = new GlslDecl(Nodes, ShaderType);

            SB = new StringBuilder();

            SB.AppendLine("#version 410 core");

            PrintDeclTextures();
            PrintDeclUniforms();
            PrintDeclInAttributes();
            PrintDeclOutAttributes();
            PrintDeclGprs();
            PrintDeclPreds();

            PrintBlockScope("void main()", 1, Nodes);

            string GlslCode = SB.ToString();

            return(new GlslProgram(
                       GlslCode,
                       Decl.Textures.Values,
                       Decl.Uniforms.Values));
        }
Ejemplo n.º 2
0
        public GlslProgram Decompile(IGalMemory Memory, long Position, GalShaderType ShaderType)
        {
            Blocks = ShaderDecoder.Decode(Memory, Position);

            Decl = new GlslDecl(Blocks, ShaderType);

            SB = new StringBuilder();

            SB.AppendLine("#version 410 core");

            PrintDeclTextures();
            PrintDeclUniforms();
            PrintDeclInAttributes();
            PrintDeclOutAttributes();
            PrintDeclGprs();
            PrintDeclPreds();

            PrintBlockScope(Blocks[0], null, null, "void main()", IdentationStr);

            string GlslCode = SB.ToString();

            return(new GlslProgram(
                       GlslCode,
                       Decl.Textures.Values,
                       Decl.Uniforms.Values));
        }
Ejemplo n.º 3
0
        public GlslProgram Decompile(IGalMemory Memory, long Position, GalShaderType ShaderType)
        {
            Blocks  = ShaderDecoder.Decode(Memory, Position);
            BlocksB = null;

            Decl = new GlslDecl(Blocks, ShaderType);

            return(Decompile());
        }
Ejemplo n.º 4
0
        public GlslProgram Decompile(byte[] Binary, GalShaderType ShaderType)
        {
            Header  = new ShaderHeader(Binary);
            HeaderB = null;

            Blocks  = ShaderDecoder.Decode(Binary);
            BlocksB = null;

            Decl = new GlslDecl(Blocks, ShaderType, Header);

            return(Decompile());
        }
Ejemplo n.º 5
0
        public GlslProgram Decompile(
            IGalMemory Memory,
            long VpAPosition,
            long VpBPosition,
            GalShaderType ShaderType)
        {
            Blocks  = ShaderDecoder.Decode(Memory, VpAPosition);
            BlocksB = ShaderDecoder.Decode(Memory, VpBPosition);

            GlslDecl DeclVpA = new GlslDecl(Blocks, ShaderType);
            GlslDecl DeclVpB = new GlslDecl(BlocksB, ShaderType);

            Decl = GlslDecl.Merge(DeclVpA, DeclVpB);

            return(Decompile());
        }
Ejemplo n.º 6
0
        public GlslProgram Decompile(
            byte[]        BinaryA,
            byte[]        BinaryB,
            GalShaderType ShaderType)
        {
            Header  = new ShaderHeader(BinaryA);
            HeaderB = new ShaderHeader(BinaryB);

            Blocks  = ShaderDecoder.Decode(BinaryA);
            BlocksB = ShaderDecoder.Decode(BinaryB);

            GlslDecl DeclVpA = new GlslDecl(Blocks, ShaderType, Header);
            GlslDecl DeclVpB = new GlslDecl(BlocksB, ShaderType, HeaderB);

            Decl = GlslDecl.Merge(DeclVpA, DeclVpB);

            return(Decompile());
        }