Example #1
0
        public MutablePipelineState(GraphicsDevice graphicsDevice)
        {
            this.graphicsDevice = graphicsDevice;

            State = new PipelineStateDescription();
            State.SetDefaults();
        }
Example #2
0
        public void Recreate(GraphicsAdapter adapter, GraphicsProfile[] profile, DeviceCreationFlags deviceCreationFlags, WindowHandle windowHandle)
        {
            if (adapter == null)
            {
                throw new ArgumentNullException("adapter");
            }
            if (profile == null)
            {
                throw new ArgumentNullException("profile");
            }

            Adapter     = adapter;
            IsDebugMode = deviceCreationFlags == DeviceCreationFlags.Debug || deviceCreationFlags == DeviceCreationFlags.DebugAndBreak ||
                          deviceCreationFlags == DeviceCreationFlags.DebugAndBreakUnique || deviceCreationFlags == DeviceCreationFlags.DebugAndLogUnique;

            // Initialize this instance
            InitializePlatformDevice(profile, deviceCreationFlags, windowHandle);

            // Create a new graphics device
            Features = new GraphicsDeviceFeatures(this);

            SamplerStates = new SamplerStateFactory(this);

            var defaultPipelineStateDescription = new PipelineStateDescription();

            defaultPipelineStateDescription.SetDefaults();
            AdjustDefaultPipelineStateDescription(ref defaultPipelineStateDescription);
            DefaultPipelineState = PipelineState.New(this, ref defaultPipelineStateDescription, null);

            InitializePostFeatures();
        }
Example #3
0
        public MutablePipelineState(GraphicsDevice graphicsDevice)
        {
            this.graphicsDevice = graphicsDevice;

            cache = graphicsDevice.GetOrCreateSharedData(GraphicsDeviceSharedDataType.PerDevice, typeof(MutablePipelineStateCache), device => new MutablePipelineStateCache()).Cache;

            State = new PipelineStateDescription();
            State.SetDefaults();
        }