コード例 #1
0
 public void GetOrCreate(VertexInputLayout layout, out InputLayoutPair currentPassPreviousPair)
 {
     lock (Cache)
     {
         if (!Cache.TryGetValue(layout, out currentPassPreviousPair))
         {
             currentPassPreviousPair = new InputLayoutPair(layout, ToDispose(new InputLayout(device, Bytecode, layout.InputElements)));
             Cache.Add(layout, currentPassPreviousPair);
         }
     }
 }
コード例 #2
0
        public void GetOrCreate(VertexInputLayout layout, out InputLayoutPair currentPassPreviousPair)
        {
            lock (Cache)
            {
                if (!Cache.TryGetValue(layout, out currentPassPreviousPair))
                {

                    currentPassPreviousPair = new InputLayoutPair(layout, ToDispose(new InputLayout(device, Bytecode, layout.InputElements)));
                    Cache.Add(layout, currentPassPreviousPair);
                }
            }
        }
コード例 #3
0
        public void GetOrCreate(VertexInputLayout layout, out InputLayoutPair currentPassPreviousPair)
        {
            if (!ContextCache.TryGetValue(layout, out currentPassPreviousPair))
            {
                lock (DeviceCache)
                {
                    if (!DeviceCache.TryGetValue(layout, out currentPassPreviousPair))
                    {

                        currentPassPreviousPair.InputLayout = new InputLayout(device, Bytecode, layout.InputElements);
                        currentPassPreviousPair.VertexInputLayout = layout;
                        DeviceCache.Add(layout, currentPassPreviousPair);
                    }
                }

                ContextCache.Add(layout, currentPassPreviousPair);
            }
        }