5
votes

Both seems to be HLSL shader language, but what is the difference between them?

Does it matter to change .hlsl extension to .hlsli, or vise versa?

One of the article I found says that .hlsli file is not going into compilation, is it correct? (Too few articles talking about .hlsli, not confident about this...)

Is it good to go with only .hlsli file, or there should always be some .hlsl files?

It would be appreciative if anyone could tell the same/difference between them, and their usage as well. Thanks.

2

2 Answers

4
votes

.hlsl is a shader file (contains the shader declaration) while .hlsli is an include file (contains only declarations and macros, no actual shader structure)

1
votes

hlsli is the HLSL equivalent of the .h/.hpp header file of the compiled file .cpp in C++. As in C++ where .h files aren't compiled, they are included to the .cpp files and then the latter are compiled, so does the .hlsli files are included to the .hlsl files and then the .hlsl files are compiled.