Ejemplo n.º 1
0
        protected virtual object EvalPixelShader_Pass_Expression(ParseTree tree, params object[] paramlist)
        {
            PassInfo pass = paramlist[0] as PassInfo;

            pass.psModel    = this.GetValue(tree, TokenType.ShaderModel, 0) as string;
            pass.psFunction = this.GetValue(tree, TokenType.Identifier, 0) as string;
            return(null);
        }
Ejemplo n.º 2
0
        protected virtual object EvalPass_Declaration(ParseTree tree, params object[] paramlist)
        {
            PassInfo pass = new PassInfo();

            pass.name = this.GetValue(tree, TokenType.Identifier, 0) as string ?? string.Empty;

            foreach (ParseNode node in Nodes)
            {
                node.Eval(tree, pass);
            }

            return(pass);
        }
Ejemplo n.º 3
0
        protected virtual object EvalPass_Declaration(ParseTree tree, params object[] paramlist)
        {
            var pass = new PassInfo();

            pass.name = this.GetValue(tree, TokenType.Identifier, 0) as string ?? string.Empty;

            foreach (var node in Nodes)
            {
                node.Eval(tree, pass);
            }

            // We need to have a pixel or vertex shader to keep this pass.
            if (!string.IsNullOrEmpty(pass.psFunction) || !string.IsNullOrEmpty(pass.vsFunction))
            {
                var technique = paramlist[0] as TechniqueInfo;
                technique.Passes.Add(pass);
            }

            return(null);
        }
Ejemplo n.º 4
0
        internal override void ValidateShaderModels(PassInfo pass)
        {
            int major, minor;

            if (!string.IsNullOrEmpty(pass.vsFunction))
            {
                ParseShaderModel(pass.vsModel, GlslVertexShaderRegex, out major, out minor);
                if (major > 3)
                {
                    throw new Exception(String.Format("Invalid profile '{0}'. Vertex shader '{1}' must be SM 3.0 or lower!", pass.vsModel, pass.vsFunction));
                }
            }

            if (!string.IsNullOrEmpty(pass.psFunction))
            {
                ParseShaderModel(pass.psModel, GlslPixelShaderRegex, out major, out minor);
                if (major > 3)
                {
                    throw new Exception(String.Format("Invalid profile '{0}'. Pixel shader '{1}' must be SM 3.0 or lower!", pass.vsModel, pass.psFunction));
                }
            }
        }
Ejemplo n.º 5
0
 internal abstract void ValidateShaderModels(PassInfo pass);