public string GetDestinationName(InstructionToken instruction)
        {
            int         destIndex   = instruction.GetDestinationParamIndex();
            RegisterKey registerKey = instruction.GetParamRegisterKey(destIndex);

            string registerName = GetRegisterName(registerKey);

            registerName = registerName ?? instruction.GetParamRegisterName(destIndex);
            var    registerLength = GetRegisterFullLength(registerKey);
            string writeMaskName  = instruction.GetDestinationWriteMaskName(registerLength, true);

            return(string.Format("{0}{1}", registerName, writeMaskName));
        }
Beispiel #2
0
        string GetDestinationName(InstructionToken instruction)
        {
            var resultModifier = instruction.GetDestinationResultModifier();

            int destIndex = instruction.GetDestinationParamIndex();

            string    registerName    = instruction.GetParamRegisterName(destIndex);
            const int registerLength  = 4;
            string    writeMaskName   = instruction.GetDestinationWriteMaskName(registerLength, false);
            string    destinationName = $"{registerName}{writeMaskName}";

            if (resultModifier != ResultModifier.None)
            {
                //destinationName += "TODO:Modifier!!!";
            }
            return(destinationName);
        }
        private static IEnumerable <RegisterComponentKey> GetDestinationKeys(InstructionToken instruction)
        {
            int         index       = instruction.GetDestinationParamIndex();
            RegisterKey registerKey = instruction.GetParamRegisterKey(index);

            if (registerKey.Type == RegisterType.Sampler)
            {
                yield break;
            }

            ComponentFlags mask = instruction.GetDestinationWriteMask();

            for (int component = 0; component < 4; component++)
            {
                if ((mask & (ComponentFlags)(1 << component)) == 0)
                {
                    continue;
                }

                yield return(new RegisterComponentKey(registerKey, component));
            }
        }