GLSL icon indicating copy to clipboard operation
GLSL copied to clipboard

Local includes and extension settings per solution

Open helviett opened this issue 2 years ago • 0 comments

Installed product versions

  • Visual Studio 2022 Community
  • Extension version 0.11.160

Description

In game engines there's always complex shader system with includes. I've found two issues that make it hard to use this awesome extension:

  • Extension compiles shader somewhere in the temp directory and sets working directory to temp directory so shader compiler doesn't see local includes
  • Extension settings are global which make it hard to use extension with multiple solutions because the only way to specify additional include directories is to pass them via compiler arguments.

Consider the following example: we have a game project which contains a game engine submodule which has a plugin\extension system. Game engine, game itself and engine extensions can have their own shaders. Game engine, game and extensions have their own solutions. I use relative paths starting woth $(SolutionDir). I have to provide external include directories paths for each solution (e.g. path to some engine global includes) and for each folder which contains shader includes (e.g. we usually have ShaderShared.h include file which cotains uniforms). That's a lot of arguments for compiler.

I suggest to set working directory to the directory where shader is located. That should solve the first issue. Besides that I suggest to make extension settings per solution or at least to give a way to override settings on solution level.

helviett avatar Oct 06 '22 06:10 helviett