Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Bug 2023.2 Does not show as <DX12> when selected as graphics API

Discussion in 'General Graphics' started by horeaper, Mar 21, 2024.

  1. horeaper

    horeaper

    Joined:
    Oct 30, 2013
    Posts:
    53
    In any 2023.2 version I used (Start from 2023.2.7 all the way to 2023.2.14), when DX12 is selected as the Graphics API in project setting, the editor's title still shows as "DX11":

    Steps to reproduce:
    1. Create a empty URP/HDRP project
    2. Go to Project Settings -> Player
    3. Uncheck "Auto Graphics API for Windows", add "Direct3D 12" and drag it to the top of the list.
    4. Restart the Editor.
    5. The title still shows "DX11".
    1.png
    Even after "Direct3D 11" entry is removed, the title won't change.

    With HDRP, click the "Fix" button in HDRP Wizard inside the "HDRP + DXR" tab, restarts the Editor, yet nothing changed.
    3.png

    It's not just "DX11". I switched to Vulkan API, editor shows correctly as <Vulkan> in title. Then switched back to DX12, it still shows as Vulkan.

    Build the game, MSI Afterburner shows it correctly runs as D3D12.

    With 2022.3.x, this problem does not exist in any version I used (And any prior versions, including and not limited to 2022.2.x, 2021.3.x, etc.)
    2.png

    Hardware: 3700X + RTX 2060
    NVIDIA Driver: 546.33
    OS: Windows 10 22H2 build 19045.4170

    (I can't say if the editor's rendering API actually switched to DX12 or not. My game scene runs almost the same FPS whether it's DX11 or DX12 selected)
     
    Last edited: Mar 21, 2024
  2. horeaper

    horeaper

    Joined:
    Oct 30, 2013
    Posts:
    53
    Tested with a plugin, shows the editor (2023.2.17) are still on DX11:
    20240422184228.jpg

    So.. basically, I can't switch the editor to DX12 mode
     
  3. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,046
    What does the Editor log say? It should try to initialize DX12 first. I suppose that fails somehow and it falls back to DX11.
     
  4. horeaper

    horeaper

    Joined:
    Oct 30, 2013
    Posts:
    53
    It does have one line says:
    d3d12: failed to create D3D12 device (0x887e0003).

    And then went on to create a Direct3D 11.0 device and succeeded.

    I checked 0x887e0003:
    Error 0x887E0003: The D3D12 SDK version configuration of the host exe is invalid.
    D3D12_ERROR_INVALID_REDIST - download and install the required version of the Direct3D 12 Agility SDK runtime.


    ❓❓❓❓❓❓❓


    So, is it 2022 LTS works fine because it uses an older SDK version and it's included in my Windows? But I do use the latest Windows 10 22H2 with the latest patch (10.0.19045.4291). I don't think you can get a newer Win10 than this (other than Win11, which I try to avoid, for now)

    The file version of my C:\Windows\System32\D3D12Core.dll is 10.0.19041.3996
    I tried download the latest Agility SDK 1.613.2 from nuget, extract build\native\bin\x64\D3D12Core.dll and d3d12SDKLayers.dll to Unity's install folder, didn't work.

    Editor's log attached, just in case.

    (Sorry for the late reply:p)
     

    Attached Files:

    Last edited: Apr 30, 2024
  5. SamuelSiltanenUnity

    SamuelSiltanenUnity

    Unity Technologies

    Joined:
    Dec 30, 2019
    Posts:
    2
    The Windows version that you have is fine. There no need to install anything, but the Unity editor installation should copy the necessary files under the editor folder, where Unity.exe is located. If you look in the editor folder, there should be a subfolder named "D3D12" and inside it, there should be the correct version of D3D12Core.dll (and possibly d3d12sdklayers.dll). Can you check if the subfolder exists?
     
    Last edited: Apr 30, 2024
  6. horeaper

    horeaper

    Joined:
    Oct 30, 2013
    Posts:
    53
    No, the subfolder doesn't exist.

    The only D3D12Core.dll I can find are located under "[Unity Install]\Editor\Data\PlaybackEngines\windowsstandalonesupport\External\AgilitySDK" folder.
    So I created the folder "[Unity Install]\Editor\D3D12", copy those 2 files from AgilitySDK\x64 into it, and it FIXED THE PROBLEM! :D

    Maybe an installer bug?
     
  7. horeaper

    horeaper

    Joined:
    Oct 30, 2013
    Posts:
    53
    Here is something interesting:
    I installed 2023.2.20f1 (the latest "official" version), and the D3D12 folder do exist.
    Then I installed 2023.2.19f1c1 (the latest "china variant" version), it does not have D3D12 folder!

    I think I found who to blame :D someone at unity china forgot to pack those files into the installer, for the ENTIRE 2023 TECH STREAM!
    2023.2.19f1c1.png 2023.2.20f1.png
     
    Last edited: May 1, 2024