UE 5.5 Source Build - D3D12RHI Module Fails to Find 'd3dx12residency.h' Despite Build.cs Modification

Hello everyone,

I’m currently developing a GPU-accelerated audio plugin (GPUdio) using DirectX 12 Compute Shaders with an Unreal Engine 5.5 source build. I’m facing a persistent fatal error C1083: ‘d3dx12residency.h’: No such file or directory when compiling the core engine module D3D12RHI. Despite trying numerous troubleshooting steps, the issue remains unresolved, and I’m seeking your assistance.

1. Current Situation & Goal:

  • Using Unreal Engine 5.5 source build.

  • Developing a GPU-accelerated audio plugin utilizing DirectX 12 Compute Shaders.

  • Attempting to retrieve ID3D12Device* and ID3D12CommandQueue* within UGPUdioComponent (using FD3D12DynamicRHI::GetD3DRHI(), RHIGetDevice(), RHIGetCommandQueue()).

2. The Problem and Verifications Made:

  • Fatal Error: fatal error C1083: Cannot open include file: ‘d3dx12residency.h’: No such file or directory

    • Error location: A:\EngineHome\UnrealEngine-5.54\Engine\Source\Runtime\D3D12RHI\Private\D3D12Residency.h(33)

    • Verification 1: The d3dx12residency.h file physically exists at A:\EngineHome\UnrealEngine-5.54\Engine\Source\ThirdParty\Windows\D3DX12\include. I have also verified and corrected any potential case sensitivity issues in the filename.

    • Verification 2: The include statement in the engine code (D3D12Residency.h) is include <d3d12residency.h>.

  • Warnings (C4668): I’m also receiving multiple C4668 warnings about undefined preprocessor macros (these are not directly causing the build failure):

    • D3D12_MAX_COMMANDLIST_INTERFACE

    • D3D12_MAX_DEVICE_INTERFACE

    • D3D12_SUPPORTS_INFO_QUEUE

    • WITH_NVAPI

3. Attempted Solutions (in the Source Build Environment):

  • Modified D3D12RHI.Build.cs:
    I directly modified the A:\EngineHome\UnrealEngine-5.54\Engine\Source\Runtime\D3D12RHI\D3D12RHI.Build.cs file to explicitly add the ThirdParty include path to PrivateIncludePaths (as the engine is source-built and modifiable):

Generated csharp

public class D3D12RHI : ModuleRules
{
    public D3D12RHI(ReadOnlyTargetRules Target) : base(Target)
    {
        PrivateIncludePaths.AddRange(
            new string[] {
                System.IO.Path.Combine(EngineDirectory, "Source", "ThirdParty", "Windows", "D3DX12", "include"),
                System.IO.Path.Combine(EngineDirectory, "Source", "Runtime", "D3D12RHI", "Private"), // Also keeping other private paths
                System.IO.Path.Combine(EngineDirectory, "Source", "Runtime", "D3D12RHI", "Private", "Windows") // Also keeping other private paths
            }
        );
        // ... (Rest of existing D3D12RHI.Build.cs content)
    }
}

Use code with caution.C#

  • Thorough Clean and Rebuild:
    After modifying D3D12RHI.Build.cs, I performed a thorough clean and rebuild:

    • Completely deleted all Binaries, Intermediate, DerivedDataCache, and .vs folders from both the engine installation directory (A:\EngineHome\UnrealEngine-5.54\Engine) and my project directory.

    • Reran GenerateProjectFiles.bat (from the engine source root) to regenerate Visual Studio project files.

    • Performed Clean Solution followed by Rebuild Solution in Visual Studio.

4. Current Problem:

  • Despite all the steps above, the exact same fatal error C1083 for d3dx12residency.h still occurs at the same location.

Questions:
Given that the d3dx12residency.h file physically exists, its path is explicitly added to D3D12RHI.Build.cs, and I’ve performed a complete cache clear and rebuild, why is the D3D12RHI module still unable to find this header file?
What could be the underlying cause of this persistent issue?
Are there any other troubleshooting steps or debugging methods I could try in this situation?

Thank you in advance for your insights and help.