tgjones / HlslTools

A Visual Studio extension that provides enhanced support for editing High Level Shading Language (HLSL) files
http://timjones.io/blog/archive/2016/04/25/hlsl-tools-for-visual-studio-v1.0-released
Other
561 stars 97 forks source link

Problem with Unreal-style virtual directory mappings #213

Closed tgjones closed 2 years ago

tgjones commented 3 years ago

Reported on Gitter here.

hi, i'm having problems with virtual directory mappings

i have a SMAA.ushwhere i have #include "/Engine/Private/Common.ush" (ush is associated with hlsl in vscode) i've created a shadertoolsconfig.json file and placed next to my SMAA.ush shader file it contains:

{
    "hlsl.virtualDirectoryMappings": {
        "/Engine": "C:\\Program Files\\Epic Games\\UE_4.26\\Engine\\Shaders"
    }
}

the particular included file exists at C:\Program Files\Epic Games\UE_4.26\Engine\Shaders\Private\Common.ush

just to clarify, i am getting an Cannot open source file error on #include "/Engine/Private/Common.ush"

joelday commented 2 years ago

@tgjones I'm happy to take a look at this one and open a PR. For context, are there any technical constraints I should be aware of that necessitated the leading slash?

tgjones commented 2 years ago

@joelday I'm sorry for not replying before to your helpful offer - but it looks like in the meantime @KStocky has gone ahead and done a PR already :)