SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components


Hi ,

I’m trying to use DirectX acceleration on my graphs. I have Windows 10, DirectX 12 with a nvidia gtx 660 graphic card.

I read your article easy fallback… and I’m trying to make it works.

I get true from Direct3D10CompatibilityHelper.SupportsDirectX10 property , but your method OnTryApplyDirectXRendererChanged fails to create

var directXSurface = new Direct3D10RenderSurface();

I always get this error

Additional information: Could not load type 'SharpDX.Color4' from assembly 'SharpDX, Version=, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1'.

I updated via nuget all assemblies and:
SharpDx version Runtime v4.0.30319
ShaprDX.D3DCompiler version Runtime v4.0.30319
ShaprDX.Direct3D10 version Runtime v4.0.30319
ShaprDX.Direct3D11 version Runtime v4.0.30319
ShaprDX.Direct3D9 version Runtime v4.0.30319

This is the definition of my surface

<s:SciChartSurface Name="sciChart" 
                    s:ThemeManager.Theme="{Binding ElementName=ChangeThemeCombo, Path=SelectedItem}"

Could you help me please?

  • You must to post comments

Hi Lorenzo,

We internally reference SharpDX v2.6.3 so I think you need to ensure all SharpDX assemblies are the same version.

Let me know if that helps,

Best regards,

  • You must to post comments

Thank you for your reply Andrew

after some investigations, I disinstalled all sharpdx reference from my project previously installed via nuget and reinstalled with the “normal” add reference, now ( I would like to upload the image to let you see, but I always get a “forbidden”) I have all the sharpdx with version 2.6.3.

please look at these pictures

But now, on OnTryApplyDirectXRendererChanged this line: if (Direct3D10CompatibilityHelper.SupportsDirectX10)

I get another error:

An exception of type ‘System.TypeInitializationException’ occurred in myprogram.exe but was not handled in user code

Additional information: The type initializer for ‘SciChart.Drawing.DirectX.Context.D3D10.Direct3D10CompatibilityHelper’ threw an exception.

here you can see the screenshot with the error

am I doing something wrong?

  • You must to post comments

Hi Lorenzo,

I’m still assuming something is wrong with the references here. The implementation of Direct3D10CompatbilityHelper.SupportsDirectX10 simply returns three static properties:

public static bool SupportsDirectX10 
        return IsSupportedOperatingSystem && HasDirectX10RuntimeInstalled && HasDirectX10CapableGpu; 

The static constructor of Direct3D10CompatbilityHelper does do some checking of minimum requirements and attempts to create a SharpDX.Direct3D10.Device1 to assess compatibility, however this is thrown & caught like this:

    static Direct3D10CompatibilityHelper()
        // Sets IsSupportedOperatingSystem=True if OS is greater than or equal to Windows Vista (e.g. XP should return false) 
        IsSupportedOperatingSystem = Environment.OSVersion.Version.Major >= 6;
        if (!IsSupportedOperatingSystem) return;

        // Checks Windows directories for presence of D3DX9, D3DX10 DLLs. 
        // If they don't exist, outputs the dependencies packaged with SciChart3D.Wpf.dll to user LocalAppData dir and loads those
        // Failure to find these means you need to install the DirectX runtime at
        HasDirectX10RuntimeInstalled = CheckDirectXDependencies();

            // Values taken from d3d10.h to check DirectX version
            const uint D3D10_SDK_VERSION = 29;
            const uint D3DX10_SDK_VERSION = 43;

            // Checks DirectX 10 GPU compatibility with the DirectX10 runtime
            HResult hResult = D3DX10CheckVersion(D3D10_SDK_VERSION, D3DX10_SDK_VERSION);
            HasDirectX10RuntimeInstalled |= hResult == HResult.S_OK;
        catch { HasDirectX10RuntimeInstalled = false; }

        Device1 d3D10Device = null;
            d3D10Device = new SharpDX.Direct3D10.Device1(DriverType.Hardware, DeviceCreationFlags.BgraSupport, FeatureLevel.Level_10_0);
            HasDirectX10CapableGpu = true;
        catch { HasDirectX10CapableGpu = false; }
        finally { Disposer.RemoveAndDispose(d3D10Device); }

So you can see there is nothing here to actually throw an exception UNLESS there is a TypeInitializationException which would occur because of bad references.

Try to do this:

  1. Create a new WPF Application (completely new solution + project)
  2. Add a NuGet package reference to SciChart.DirectX from our NuGet Feed
  3. Call the method Direct3D10CompatibilityHelper.SupportsDirectX10 in the constructor of MainWindow

Does this work? Or fail?

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.