AB4D Forum
Application crashes while changing graphics settings - Printable Version

+- AB4D Forum (https://forum.ab4d.com)
+-- Forum: Products Forums (https://forum.ab4d.com/forumdisplay.php?fid=4)
+--- Forum: Ab3d.DXEngine (https://forum.ab4d.com/forumdisplay.php?fid=11)
+--- Thread: Application crashes while changing graphics settings (/showthread.php?tid=4273)



Application crashes while changing graphics settings - Somanna - 08-02-2021

To reproduce:
1. Open settings window provided with samples or open a window of your app containing the settings panel provided with samples.  
  
2. Select "software rendering" and then select the "ultra" option from the "rendering quality" ComboBox. Once "ultra" is selected the application crashes.  
  
My system configuration:
> Intel HD graphics, 512 MB  (Integrated), feature level: 10.1; video memory: 32 MB.  
> Intel Pentium processor 2.2Ghz, Duel core.

During debugging in visual studio it throws an ArgumentOutOfRangException with parameter name 'quality' in the override method "GetGraphicsProfileForQuality" in the file SoftwareAdapterCapabilities.cs


RE: Application crashes while changing graphics settings - abenedik - 08-03-2021

Good find. There was a small bug in the SoftwareAdapterCapabilities class that has thrown an exception in case Ultra quality setting was used for software rendering.

This can be easily fixed by changing the SoftwareAdapterCapabilities.cs file in the Ab3d.DirectX.Client.Settings project that comes with the Ab3d.DXEngine sampes. You need to update the GetGraphicsProfileForQuality method in line 63 to the following (returning HighQualitySoftwareRendering for Ultra setting):


Code:
public override GraphicsProfile GetGraphicsProfileForQuality(RenderQualityTypes quality)
{
    switch (quality)
    {
        case RenderQualityTypes.Low:
            return GraphicsProfile.LowQualitySoftwareRendering;
           
        case RenderQualityTypes.Normal:
            return GraphicsProfile.NormalQualitySoftwareRendering;
           
        case RenderQualityTypes.High:
        case RenderQualityTypes.Ultra:
            return GraphicsProfile.HighQualitySoftwareRendering;

        case RenderQualityTypes.Custom:
        default:
            throw new ArgumentOutOfRangeException("quality");
    }
}