示例#1
0
        /// <summary>
        /// 挿入または検索
        /// </summary>
        /// <param name="p">エフェクトパス</param>
        /// <param name="rInfo"></param>
        /// <param name="inputLayout"></param>
        /// <returns></returns>
        public int InsertOrSearch(EffectPass p, InputElementDescInfo rInfo, out InputLayout inputLayout)
        {
            inputLayout = null;
            foreach (var val in m_index)
            {
                if (val.Value == rInfo)
                {
                    if (val.Value.index.ContainsKey(p))
                    {
                        // 既にキーが存在しない
                        if ((inputLayout = CreateLayout(p, val.Value)) == null)
                        {
                            return(-1);
                        }
                        val.Value.index.Add(p, inputLayout);
                    }
                    else
                    {
                        inputLayout = val.Value.index[p];
                    }
                    return(0);
                }
            }

            return(-1);
        }
示例#2
0
 /// <summary>
 /// レイアウトの作成
 /// </summary>
 /// <param name="p"></param>
 /// <param name="info"></param>
 /// <returns></returns>
 private InputLayout CreateLayout(EffectPass p, InputElementDescInfo info)
 {
     return(new InputLayout(App.DXDevice, p.Description.Signature, info.aDesc));
 }