示例#1
0
        /// <summary>
        /// Creates an uniform parameter.
        /// </summary>
        /// <param name="fmt">The format of parameter.</param>
        /// <param name="size">The size of array, 0 means no array.</param>
        /// <param name="bufferID">The constant buffer ID.</param>
        /// <param name="placementInBuffer">The placement inside constant buffer.</param>
        /// <returns>The actual input.</returns>
        public Operand CreateConstant(PinFormat fmt, uint size,
                                      uint bufferID, uint placementInBuffer)
        {
            int name = GenerateNextUniqueName();

            // We first "create" variable at global scope.
            compiler.RegisterConstant(name, fmt, size, bufferID, placementInBuffer);

            // Returns the input element that can be used in operations.
            return(new Operand(fmt, name, size, false));
        }