DirectXShaderCompiler icon indicating copy to clipboard operation
DirectXShaderCompiler copied to clipboard

New include path behaviour

Open KStocky opened this issue 1 year ago • 0 comments

Description

Due to #6317 include paths are now passed to IDxcIncludeHandler::LoadSource normalized to the operating system's path style. i.e. On Windows "/" is replaced with "\".

The issue with this is that it likely breaks some implementations of IDxcIncludeHandler because users have been expecting the argument of IDxcIncludeHandler::LoadSource to be exactly what was in the include directive in the shader source. There are not many programmers who would prefer to write "\" over "/" in their header includes, so for some, upgrading to 1.8.2405.17 will have broken their include handler.

Steps to Reproduce

Write a shader that has an include such as #include "Mylibrary/MyHeader.hlsli" and compile it with DXC using a custom IDxcIncludeHandler.

Actual Behavior

Notice that the string passed to IDxcIncludeHandler::LoadSource is ".\\MyLibrary\\Myheader.hlsli" which is different from the string used in the #include directive

Environment

  • DXC version 1.8.2405.17
  • Host Operating System Windows 10 Pro 22H2

KStocky avatar Jun 02 '24 17:06 KStocky