Ejemplo n.º 1
0
        public static InputLayout ConstructInputLayout(D3D10.InputElement[] inputElements, ShaderSignature ss)
        {
            if (inputLayoutCache == null)
            {
                inputLayoutCache = new Dictionary <string, InputLayout>();
            }

            string key = inputElements.GetHashCode().ToString() + "_" + ss.GetHashCode().ToString();

            if (inputLayoutCache.ContainsKey(key))
            {
                return(inputLayoutCache[key]);
            }
            else
            {
                InputLayout l = new InputLayout(Game.Device, inputElements, ss);
                inputLayoutCache.Add(key, l);
                return(l);
            }
        }