Esempio n. 1
0
        private RasterizerState CreateNewRasterizerState(ref RasterizerStateDescription description)
        {
            SharpDX.Direct3D11.RasterizerStateDescription rssDesc = new SharpDX.Direct3D11.RasterizerStateDescription
            {
                CullMode                = D3D11Formats.VdToD3D11CullMode(description.CullMode),
                FillMode                = D3D11Formats.VdToD3D11FillMode(description.FillMode),
                IsDepthClipEnabled      = description.DepthClipEnabled,
                IsScissorEnabled        = description.ScissorTestEnabled,
                IsFrontCounterClockwise = description.FrontFace == FrontFace.CounterClockwise
            };

            return(new RasterizerState(_device, rssDesc));
        }
Esempio n. 2
0
        private RasterizerState CreateNewRasterizerState(ref D3D11RasterizerStateCacheKey key)
        {
            SharpDX.Direct3D11.RasterizerStateDescription rssDesc = new SharpDX.Direct3D11.RasterizerStateDescription
            {
                CullMode                = D3D11Formats.VdToD3D11CullMode(key.VeldridDescription.CullMode),
                FillMode                = D3D11Formats.VdToD3D11FillMode(key.VeldridDescription.FillMode),
                IsDepthClipEnabled      = key.VeldridDescription.DepthClipEnabled,
                IsScissorEnabled        = key.VeldridDescription.ScissorTestEnabled,
                IsFrontCounterClockwise = key.VeldridDescription.FrontFace == FrontFace.CounterClockwise,
                IsMultisampleEnabled    = key.Multisampled
            };

            return(new RasterizerState(_device, rssDesc));
        }
Esempio n. 3
0
        private ID3D11RasterizerState CreateNewRasterizerState(ref D3D11RasterizerStateCacheKey key)
        {
            RasterizerDescription rssDesc = new RasterizerDescription
            {
                CullMode              = D3D11Formats.VdToD3D11CullMode(key.VeldridDescription.CullMode),
                FillMode              = D3D11Formats.VdToD3D11FillMode(key.VeldridDescription.FillMode),
                DepthClipEnable       = key.VeldridDescription.DepthClipEnabled,
                ScissorEnable         = key.VeldridDescription.ScissorTestEnabled,
                FrontCounterClockwise = key.VeldridDescription.FrontFace == FrontFace.CounterClockwise,
                MultisampleEnable     = key.Multisampled
            };

            return(_device.CreateRasterizerState(rssDesc));
        }