Exemple #1
0
 private EffectPool(GraphicsDevice device, string name = null) : base(name)
 {
     dataGroup = new EffectData();
     mapNameToEffect = new Dictionary<string, EffectData.Effect>();
     mapNameToConstantBuffer = new Dictionary<GraphicsDevice, Dictionary<string, Dictionary<EffectConstantBufferKey, EffectConstantBuffer>>>();
     compiledShaders = new List<DeviceChild>();
     registered = new Dictionary<EffectData, bool>(new IdentityEqualityComparer<EffectData>());
     effects = new List<Effect>();
     this.graphicsDevice = device.MainDevice;
     constantBufferAllocator = DefaultConstantBufferAllocator;
 }
Exemple #2
0
        private EffectPool(GraphicsDevice device, string name = null) : base(name)
        {
            RegisteredShaders       = new List <EffectData.Shader>();
            mapNameToConstantBuffer = new Dictionary <GraphicsDevice, Dictionary <string, Dictionary <EffectConstantBufferKey, EffectConstantBuffer> > >();
            compiledShadersGroup    = new List <DeviceChild> [(int)EffectShaderType.Compute + 1];
            for (int i = 0; i < compiledShadersGroup.Length; i++)
            {
                compiledShadersGroup[i] = new List <DeviceChild>(256);
            }

            registered              = new Dictionary <EffectData, EffectData.Effect>(new IdentityEqualityComparer <EffectData>());
            effects                 = new List <Effect>();
            RegisteredEffects       = new ReadOnlyCollection <Effect>(effects);
            this.graphicsDevice     = device.MainDevice;
            constantBufferAllocator = DefaultConstantBufferAllocator;
            graphicsDevice.EffectPools.Add(this);
        }
Exemple #3
0
        private EffectPool(GraphicsDevice device, string name = null) : base(name)
        {
            RegisteredShaders = new List<EffectData.Shader>();
            mapNameToConstantBuffer = new Dictionary<GraphicsDevice, Dictionary<string, Dictionary<EffectConstantBufferKey, EffectConstantBuffer>>>();
            compiledShadersGroup = new List<DeviceChild>[(int)EffectShaderType.Compute + 1];
            for (int i = 0; i < compiledShadersGroup.Length; i++)
            {
                compiledShadersGroup[i] = new List<DeviceChild>(256);
            }

            registered = new Dictionary<EffectData, EffectData.Effect>(new IdentityEqualityComparer<EffectData>());
            effects = new List<Effect>();
            RegisteredEffects = new ReadOnlyCollection<Effect>(effects);
            this.graphicsDevice = device.MainDevice;
            constantBufferAllocator = DefaultConstantBufferAllocator;
            graphicsDevice.EffectPools.Add(this);
        }