Пример #1
0
        public override string ToString()
        {
            var sb = new StringBuilder();

            sb.AppendLine(string.Format("// {0} {1}", BufferType.GetDescription(), Name));
            sb.AppendLine("// {");

            foreach (var variable in Variables)
            {
                sb.Append(variable);
            }

            sb.AppendLine("//");
            sb.AppendLine("// }");
            sb.AppendLine("//");

            return(sb.ToString());
        }
Пример #2
0
        public override string ToString()
        {
            var sb             = new StringBuilder();
            var bufferType     = BufferType.GetDescription();
            var registerPrefix = BufferType == ConstantBufferType.ConstantBuffer ? "b" : "t";

            sb.Append(string.Format("{0} {1}",
                                    bufferType, Name));
            if (RegisterNumber != uint.MaxValue)
            {
                sb.Append(string.Format(" : register({0}{1})", registerPrefix, RegisterNumber));
            }
            sb.AppendLine();
            sb.AppendLine("{");
            foreach (var variable in Variables)
            {
                sb.AppendLine(variable.ToString());
            }
            sb.AppendLine("}");
            return(sb.ToString());
        }