Example #1
0
        public IResultSet Compile(string shader, ICompileOptions opts)
        {
            if (opts.Language != Languages.GLSL)
                return null;

            IGLSLOptions glOpts = (IGLSLOptions)opts;

            GLSlangOptions slangOpts = new GLSlangOptions();
            slangOpts.ShaderType = glOpts.ShaderType;
            slangOpts.Config = m_Config;
            GLSlang.IShader result = m_Compiler.Compile(shader, slangOpts);
            return new GLSLangResultSet(result);
        }
Example #2
0
        public IResultSet Compile(IShader shader, IBackendOptions options)
        {
            if (!(shader is GLSLShader) )
                return null;

            GLSLShader sh = (GLSLShader)shader;
            IGLSLOptions glOpts = sh.CompileOptions;

            GLSlangOptions slangOpts = new GLSlangOptions();
            slangOpts.ShaderType = glOpts.ShaderType;
            slangOpts.Config = m_Config;
            GLSlang.IShader result = m_Compiler.Compile(sh.Code, slangOpts);
            return new GLSLangResultSet(result);
        }