public void PrepareForReturn() { if (_config.Stage == ShaderStage.Fragment) { if (_config.OmapDepth) { Operand dest = Attribute(AttributeConsts.FragmentOutputDepth); Operand src = Register(_config.GetDepthRegister(), RegisterType.Gpr); this.Copy(dest, src); } int regIndex = 0; for (int attachment = 0; attachment < 8; attachment++) { OutputMapTarget target = _config.OmapTargets[attachment]; for (int component = 0; component < 4; component++) { if (target.ComponentEnabled(component)) { Operand dest = Attribute(AttributeConsts.FragmentOutputColorBase + attachment * 16 + component * 4); Operand src = Register(regIndex, RegisterType.Gpr); this.Copy(dest, src); regIndex++; } } } } }