internal GraphicsDeviceFeatures(GraphicsDevice deviceRoot)
        {
            var nativeDevice = deviceRoot.NativeDevice;

            HasSRgb = true;

            mapFeaturesPerFormat = new FeaturesPerFormat[256];

            // Set back the real GraphicsProfile that is used
            // TODO D3D12
            RequestedProfile = deviceRoot.RequestedProfile;
            CurrentProfile   = GraphicsProfileHelper.FromFeatureLevel(deviceRoot.CurrentFeatureLevel);

            // TODO D3D12
            HasComputeShaders  = true;
            HasDoublePrecision = nativeDevice.D3D12Options.DoublePrecisionFloatShaderOps;

            // TODO D3D12 Confirm these are correct
            // Some docs: https://msdn.microsoft.com/en-us/library/windows/desktop/ff476876(v=vs.85).aspx
            HasDepthAsSRV            = true;
            HasDepthAsReadOnlyRT     = true;
            HasMultisampleDepthAsSRV = true;

            HasResourceRenaming = false;

            HasMultiThreadingConcurrentResources = true;
            HasDriverCommandLists = true;

            // Check features for each DXGI.Format
            foreach (var format in Enum.GetValues(typeof(SharpDX.DXGI.Format)))
            {
                var dxgiFormat = (SharpDX.DXGI.Format)format;
                var maximumMultisampleCount = MultisampleCount.None;
                var formatSupport           = FormatSupport.None;

                if (!ObsoleteFormatToExcludes.Contains(dxgiFormat))
                {
                    SharpDX.Direct3D12.FeatureDataFormatSupport formatSupportData;
                    formatSupportData.Format   = dxgiFormat;
                    formatSupportData.Support1 = FormatSupport1.None;
                    formatSupportData.Support2 = FormatSupport2.None;
                    if (nativeDevice.CheckFeatureSupport(Feature.FormatSupport, ref formatSupportData))
                    {
                        formatSupport = (FormatSupport)formatSupportData.Support1;
                    }
                    maximumMultisampleCount = GetMaximumMultisampleCount(nativeDevice, dxgiFormat);
                }

                mapFeaturesPerFormat[(int)dxgiFormat] = new FeaturesPerFormat((PixelFormat)dxgiFormat, maximumMultisampleCount, formatSupport);
            }
        }
        internal GraphicsDeviceFeatures(GraphicsDevice deviceRoot)
        {
            var nativeDevice = deviceRoot.NativeDevice;

            HasSRgb = true;

            mapFeaturesPerFormat = new FeaturesPerFormat[256];

            // Set back the real GraphicsProfile that is used
            // TODO D3D12
            RequestedProfile = deviceRoot.RequestedProfile;
            CurrentProfile   = GraphicsProfileHelper.FromFeatureLevel(deviceRoot.CurrentFeatureLevel);

            // TODO D3D12
            HasComputeShaders  = true;
            HasDoublePrecision = nativeDevice.D3D12Options.DoublePrecisionFloatShaderOps;

            // TODO D3D12 Confirm these are correct
            HasDepthAsSRV        = true;
            HasDepthAsReadOnlyRT = true;

            HasResourceRenaming = false;

            HasMultiThreadingConcurrentResources = true;
            HasDriverCommandLists = true;

            // TODO D3D12
            //// Check features for each DXGI.Format
            //foreach (var format in Enum.GetValues(typeof(SharpDX.DXGI.Format)))
            //{
            //    var dxgiFormat = (SharpDX.DXGI.Format)format;
            //    var maximumMSAA = MSAALevel.None;
            //    var computeShaderFormatSupport = ComputeShaderFormatSupport.None;
            //    var formatSupport = FormatSupport.None;

            //    if (!ObsoleteFormatToExcludes.Contains(dxgiFormat))
            //    {
            //        maximumMSAA = GetMaximumMSAASampleCount(nativeDevice, dxgiFormat);
            //        if (HasComputeShaders)
            //            computeShaderFormatSupport = nativeDevice.CheckComputeShaderFormatSupport(dxgiFormat);

            //        formatSupport = (FormatSupport)nativeDevice.CheckFormatSupport(dxgiFormat);
            //    }

            //    //mapFeaturesPerFormat[(int)dxgiFormat] = new FeaturesPerFormat((PixelFormat)dxgiFormat, maximumMSAA, computeShaderFormatSupport, formatSupport);
            //    mapFeaturesPerFormat[(int)dxgiFormat] = new FeaturesPerFormat((PixelFormat)dxgiFormat, maximumMSAA, formatSupport);
            //}
        }
Ejemplo n.º 3
0
        internal GraphicsDeviceFeatures(GraphicsDevice deviceRoot)
        {
            var nativeDevice = deviceRoot.NativeDevice;

            HasSRgb = true;

            mapFeaturesPerFormat = new FeaturesPerFormat[256];

            // Set back the real GraphicsProfile that is used
            RequestedProfile = deviceRoot.RequestedProfile;
            CurrentProfile   = GraphicsProfileHelper.FromFeatureLevel(nativeDevice.FeatureLevel);

            HasResourceRenaming = true;

            HasComputeShaders  = nativeDevice.CheckFeatureSupport(Feature.ComputeShaders);
            HasDoublePrecision = nativeDevice.CheckFeatureSupport(Feature.ShaderDoubles);
            nativeDevice.CheckThreadingSupport(out HasMultiThreadingConcurrentResources, out this.HasDriverCommandLists);

            HasDepthAsSRV            = (CurrentProfile >= GraphicsProfile.Level_10_0);
            HasDepthAsReadOnlyRT     = CurrentProfile >= GraphicsProfile.Level_11_0;
            HasMultisampleDepthAsSRV = CurrentProfile >= GraphicsProfile.Level_11_0;

            // Check features for each DXGI.Format
            foreach (var format in Enum.GetValues(typeof(SharpDX.DXGI.Format)))
            {
                var dxgiFormat = (SharpDX.DXGI.Format)format;
                var maximumMultisampleCount    = MultisampleCount.None;
                var computeShaderFormatSupport = ComputeShaderFormatSupport.None;
                var formatSupport = FormatSupport.None;

                if (!ObsoleteFormatToExcludes.Contains(dxgiFormat))
                {
                    maximumMultisampleCount = GetMaximumMultisampleCount(nativeDevice, dxgiFormat);
                    if (HasComputeShaders)
                    {
                        computeShaderFormatSupport = nativeDevice.CheckComputeShaderFormatSupport(dxgiFormat);
                    }

                    formatSupport = (FormatSupport)nativeDevice.CheckFormatSupport(dxgiFormat);
                }

                //mapFeaturesPerFormat[(int)dxgiFormat] = new FeaturesPerFormat((PixelFormat)dxgiFormat, maximumMultisampleCount, computeShaderFormatSupport, formatSupport);
                mapFeaturesPerFormat[(int)dxgiFormat] = new FeaturesPerFormat((PixelFormat)dxgiFormat, maximumMultisampleCount, formatSupport);
            }
        }
Ejemplo n.º 4
0
        internal GraphicsDeviceFeatures(GraphicsDevice deviceRoot)
        {
            var nativeDevice = deviceRoot.NativeDevice;

            HasSRgb = true;

            mapFeaturesPerFormat = new FeaturesPerFormat[256];

            // Set back the real GraphicsProfile that is used
            Profile = GraphicsProfileHelper.FromFeatureLevel(nativeDevice.FeatureLevel);

#if SILICONSTUDIO_PLATFORM_WINDOWS_DESKTOP
            IsProfiled = PixHelper.IsCurrentlyProfiled;
#else
            IsProfiled = false;
#endif

            HasComputeShaders  = nativeDevice.CheckFeatureSupport(Feature.ComputeShaders);
            HasDoublePrecision = nativeDevice.CheckFeatureSupport(Feature.ShaderDoubles);
            nativeDevice.CheckThreadingSupport(out HasMultiThreadingConcurrentResources, out this.HasDriverCommandLists);

            // Check features for each DXGI.Format
            foreach (var format in Enum.GetValues(typeof(SharpDX.DXGI.Format)))
            {
                var dxgiFormat  = (SharpDX.DXGI.Format)format;
                var maximumMSAA = MSAALevel.None;
                var computeShaderFormatSupport = ComputeShaderFormatSupport.None;
                var formatSupport = FormatSupport.None;

                if (!ObsoleteFormatToExcludes.Contains(dxgiFormat))
                {
                    maximumMSAA = GetMaximumMSAASampleCount(nativeDevice, dxgiFormat);
                    if (HasComputeShaders)
                    {
                        computeShaderFormatSupport = nativeDevice.CheckComputeShaderFormatSupport(dxgiFormat);
                    }

                    formatSupport = (FormatSupport)nativeDevice.CheckFormatSupport(dxgiFormat);
                }

                //mapFeaturesPerFormat[(int)dxgiFormat] = new FeaturesPerFormat((PixelFormat)dxgiFormat, maximumMSAA, computeShaderFormatSupport, formatSupport);
                mapFeaturesPerFormat[(int)dxgiFormat] = new FeaturesPerFormat((PixelFormat)dxgiFormat, maximumMSAA, formatSupport);
            }
        }