DirectX HLSL包含指令不起作用(DirectX HLSL Include Directive Doesn't Work)

编程入门 行业动态 更新时间:2024-10-18 12:31:26
DirectX HLSL包含指令不起作用(DirectX HLSL Include Directive Doesn't Work)

该文档: 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?

最满意答案

该自动处理仅适用于离线着色器编译器工具,如您提供的链接中所述。 如果使用其中一个API进行编译,则需要指定编译器在包含指令时使用的包含处理程序: ID3DInclude

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

更多推荐

本文发布于:2023-07-04 17:05:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1026939.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:指令   不起作用   HLSL   DirectX   Directive

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!