danielscherzer / GLSL

VSIX Project that provides GLSL language integration.
258 stars 28 forks source link

Option to disable shader compilation #3

Closed TheHugeManatee closed 6 years ago

TheHugeManatee commented 6 years ago

In larger projects, often some kind of shader preprocessor is implemented which can obviously not be correctly handled by this extension.

However, this results in a lot of "squigglies" because the compiler does not know about the precompiler-specific syntax. Thus, it would be nice to have an option for the extension to turn off the shader compiler.

In the long term, of course more custimization points would be awesome (or even a basic preprocessor that at least handle "#include", as this is a very common extension projects tend to implement..

Other desirable options would be to select the GPU/driver for which the context gets created (in case of several GPUs), as different drivers generate different error messages.

danielscherzer commented 6 years ago

Thank's for you input! Would you like to switch off the shader compiler globally or individually for each shader file? I'm thinking it could be useful to be able to dynamically switch on the shader compiler, if you decide you want some compiler feedback and then switch off again to avoid the distracting squigglies.

TheHugeManatee commented 6 years ago

For my use case, it would be enough to completely disable it, as in our case the precompiler even injects #version so the compiler complains about every texture() etc. so its feedback is more or less unusable right now. However, I guess the more flexible the feature, the more reusable it will be for others.

I just noticed that something actually tries to parse the #include, as I get an error message "error C0109: Can't open include file "tools/shading.frag"". Is that something from the shader compiler (I am currently not sure if it's using my Intel integrated GPU/Driver or compiling using an NVidia driver) or from your code? In any case, is it possible to provide include directories somehow?

danielscherzer commented 6 years ago

Hi! Disable compilation option is now available and "simple" include (not recursive) support. Cheers!