Пример #1
0
        public ShaderProgram Translate(
            out ShaderProgramInfo shaderProgramInfo,
            TranslatorContext nextStage = null,
            TranslatorContext other     = null)
        {
            if (nextStage != null)
            {
                _config.MergeFromtNextStage(nextStage._config);
            }

            FunctionCode[] code = EmitShader(_program, _config, initializeOutputs: other == null, out _);

            if (other != null)
            {
                other._config.MergeOutputUserAttributes(_config.UsedOutputAttributes, 0);

                FunctionCode[] otherCode = EmitShader(other._program, other._config, initializeOutputs: true, out int aStart);

                code = Combine(otherCode, code, aStart);

                _config.InheritFrom(other._config);
            }

            return(Translator.Translate(code, _config, out shaderProgramInfo));
        }
Пример #2
0
 public void SetNextStage(TranslatorContext nextStage)
 {
     _config.MergeFromtNextStage(nextStage._config);
 }