HlslTools
HlslTools copied to clipboard
Angled includes don't lookup files hierarchy, only AdditionalIncludeDirectories.
- Added the
isAngledboolean toGetSearchDirectoriesandOpenIncludemethods, it skips the "looking through the hierarchy of files" logic and usesAdditionalIncludeDirectoriesinstead. - It also still allows the "rooted path", because I'm not sure its valid for real applications, so I keep it for editor purposes.
-
IncludeDirectiveTriviaSyntaxnow hasIsAngledboolean that indicates whether the directive uses angled brackets<file.hlsli>. - PreprocessorTests's
Parsefunction can override thefilePathofSourceFile. - Huge test for quoted and angled includes + negative test with wrong usage. Correlates with the latest DXC release again.
- There is lots of test shaders in "TestSuite\Shaders\Nvidia" uses angled brackets, so I had to add
AdditionalIncludeDirectoriesin all tests, but only for Nvidia cases.
I'm also looking at #131 and trying to figure out what it does. It has an IncludeType enum with "local" type (oh hey is it angled includes yeas?), but the code doesn't do anything - its just passes arguments and types, but the logic wasn't changed.
example
AdditionalIncludeDirectories = { "SystemAddInclude" }
SystemAddInclude:
Global.hlsli
Shaders:
header.hlsli
object.hlsl:
#include "Global.hlsli" // valid
#include <Global.hlsli> // valid
#include "header.hlsli" // valid
#include <header.hlsli> // error