-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support #include #31
Comments
Hello, and thank you for the kind words. The problem with ARB_shading_language_include - as you said - is that it's not a WebGL extension. I believe I support all the possible WebGL extensions, but I don't want to support desktop-only OpenGL extensions. There are 2 reasons for that: the first one is that I don't want to create a situation where you use a desktop-only extension, like including files, which seemingly works fine in VS Code, but it won't work in the browser. Because in WebGL you have to use the browser's built-in shader compiler, you can't use another compiler, generate SPIR-V, or do other things you can do with desktop OpenGL. The second reason is that I don't really have the time to add major features to the code, now I only do bug fixes and small updates. So I'm very sorry, but I can't support #include. |
I'd love something like this as well, even if it's implemented via comments:
if a consensus could be reached on a possible design (configurable/opt-in via settings) I'd happily explore implementing it. |
glslify seems like a good candidate to support. |
Maybe that would be too much browser centric? The other two posted ideas seems more general and simple to me (plus reuses current code):
This seems promising :) Passing the preprocessed includes to the
|
Yeah I can see that. I think glsify stood out to me because it has a lot of adoption. (Also technically, this extension is for WebGL which makes it sort of browser-centric.) But I agree — I lean towards a user-configurable, prefix/comment-based system |
Thanks for a great vs code plugin! Would it be possible to add support for #include of other files, e.g. as in ARB_shading_language_include?
WebGL2 doesn't support said extension, but rolling my own mini-preprocessor would be way better then manual copy & paste duplicate code everywhere.
Alternatively, code injection could be extended to specify a file to inject, rather than just static text. This is not as flexible, but probably easier to do and still very useful.
The text was updated successfully, but these errors were encountered: