Example #1
0
        public static Device CreateD3DDevice(D3D11DxgiOptions creationOpts)
        {
            var adapter           = creationOpts.Adapter;
            var flags             = creationOpts.CreationFlags;
            var levels            = creationOpts.Levels;
            var type              = creationOpts.Type;
            var allowWarpFallback = creationOpts.WarpFallbackEnabled;

            if (adapter != null)
            {
                return(new Device(adapter, flags));
            }
            try { return(levels != null ? new Device(type, flags, levels) : new Device(type, flags)); }
            catch
            {
                const DriverType warpDriverType = DriverType.Warp;
                if (allowWarpFallback && (type != warpDriverType))
                {
                    return(levels != null
                        ? new Device(warpDriverType, flags, levels)
                        : new Device(warpDriverType, flags));
                }
                throw;
            }
        }
Example #2
0
 public static Device1 CreateD3DDevice1(D3D11DxgiOptions creationOpts)
 {
     using (var device = CreateD3DDevice(creationOpts)) { return(device.QueryInterface <Device1>()); }
 }
Example #3
0
 public D3D11Dxgi1_2MetaResource(D3D11DxgiOptions opts)
 {
     this.m_opts = opts;
 }