Compute Shader includes

Is the #include directive in compute shaders broken or the default search path changed in U5? I have tried both b9 and b13 and in both the compiler fails to find included files.

e.g.

#include "SomeShaderInclude.cginc"

Will return a shader error of Shader error in ‘SomeShader.compute’: failed to open source file: ‘SomeShaderInclude.cginc’ at line 28 (on ) when the file is in the same directory. I have also tried it relative to /Assets and still no luck.

I would submit a bug report but just checking I haven’t missed something in the conversion docs etc.

Just judging by the error message, have you tried removing the “.cginc” from the include statement?

Oops, helps if I proof-read my post…that was a copy paste error when writing the post, I have fixed it up.

Yea, this seems broken still in b20.

@braaad - did you file a bug report for this?

Sorry, forgot to update this thread, includes in compute shaders and .cginc files now seem to require the full path eg, #include “Assets/Shaders/Example.cginc” even if they are at the same path.

1 Like

Ah, gotcha. Thanks!