DirectX HLSL 包含指令不起作用
该文件: http://msdn.microsoft.com/en- us/library/dd607349(v=vs.85).aspx
声明 #include "foobar.fx" 将在与当前效果文件相同的目录中查找该文件。
不行,但是使用绝对路径可以,这当然没用。
谷歌没有拿出任何东西。我这里缺少什么吗?
The document:
http://msdn.microsoft.com/en-us/library/dd607349(v=vs.85).aspx
states that #include "foobar.fx" will look for that file in the same directory as the current effect file.
It doesn't work, but using an absolute path does, which is of course useless.
Google doesn't come up with anything. Anything I'm missing here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Direct3D 11 动态着色器编译器有一个默认包含处理程序。
这是一个宏:(c++)
D3D_COMPILE_STANDARD_FILE_INCLUDE
这是 D3DCompile 函数的链接。
http://msdn.microsoft .com/en-us/library/windows/desktop/dd607324(v=vs.85).aspx
该宏在include变量的解释中提到。
奇怪的是,我花了一段时间才用谷歌找到,但我在途中经过了这里。
我想我会把它发布出来以防其他人最终来到这里。
There is a default include handler for the Direct3D 11 On-the-fly shader compiler.
It's a macro: (c++)
D3D_COMPILE_STANDARD_FILE_INCLUDE
Here's a link to the D3DCompile function.
http://msdn.microsoft.com/en-us/library/windows/desktop/dd607324(v=vs.85).aspx
The macro is mentioned in the explanation of the include variable.
It took me a while to find with google oddly enough, but I passed here on the way.
I thought I'd post it in case anyone else ends up here.
该自动处理仅适用于离线着色器编译器工具,如您提供的链接中所述。如果您使用其中一个 API 进行编译,则需要指定一个包含处理程序,供编译器在遇到包含指令时使用:ID3DIinclude
That automatic handling only works for the offline shader compiler tool, as mentioned in the link you provided. If you're compiling using one of the APIs, you'll need to specify an include handler for the compiler to use whenever it encounters an include directive: ID3DInclude