Skip to content

Conversation

@TIMONz1535
Copy link

  • Added the isAngled boolean to GetSearchDirectories and OpenInclude methods, it skips the "looking through the hierarchy of files" logic and uses AdditionalIncludeDirectories instead.
  • It also still allows the "rooted path", because I'm not sure its valid for real applications, so I keep it for editor purposes.
  • IncludeDirectiveTriviaSyntax now has IsAngled boolean that indicates whether the directive uses angled brackets <file.hlsli>.
  • PreprocessorTests's Parse function can override the filePath of SourceFile.
  • 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 AdditionalIncludeDirectories in 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

…for Nvidia test shaders. Add HlslParseOptions argument to SyntaxFactory.ParseAllTokens.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant