adayoegi
adayoegi

Reputation: 117

What is the difference between .hlsl and .hlsli?

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.

Upvotes: 5

Views: 2910

Answers (2)

KeyC0de
KeyC0de

Reputation: 5287

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.

Upvotes: 2

Pop Catalin
Pop Catalin

Reputation: 62990

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

Upvotes: 4

Related Questions