GNOME Bugzilla – Bug 300162
Syntax file for OpenGL Shading Language (GLSL)
Last modified: 2014-02-15 12:53:14 UTC
Hi. I've created a .lang file for GLSL version 1.10.
Created attachment 45125 [details] GLSL .lang file GLSL .lang file
Sorry for the very late reply. Can you please attach some sample files so we can test you .lang file?
Created attachment 50201 [details] Noise-demo GLSL files from clockworkcoders.com The fragment and vertex shader sources were extracted from the noise-demo download here: http://www.clockworkcoders.com/oglsl/downloads.html
The mime type indicated in the .lang file (text/x-glsl) was something I thought up. It is not official nor is it standardised, as far as I know.
Are .frag and .vert the extensions normally used for GLSL files? Please, file a request for the addition of the mime type to https://bugs.freedesktop.org, shared-mime-info product.
Sorry, I've almost forgotten about this report. Yes .frag and .vert are the common extensions used for fragment and vertex programs respectively. I'll file a request now.
I've filed the request at: https://bugs.freedesktop.org/show_bug.cgi?id=6314
Created attachment 61527 [details] Syntax file with updated MIME types Syntax file now matches text/x-glslvert and text/x-glslfrag instead of text/x-glsl.
Tha .lang file seems good. Please use singular names for tags, e.g. "Builtin Function" instead of "Builtin Functions". The bug against shared-mime-info has been filed but the patch has not been committed.
Created attachment 142828 [details] [review] lang file for GLSL I updated the GLSL lang file. Please add it. - Added a license header - Migrated it to the language definition v2.0 - Updated the symbols to GLSL version 1.40 Specification: http://www.opengl.org/registry/doc/GLSLangSpec.Full.1.40.05.pdf
Isn't this similar to C? In that case I think you should use a ref to some things like the if-0-comment, decimal, floating-point, octal, hexadecimal, boolean, preprocessor, common-macros etc.
Created attachment 142831 [details] [review] updated GLSL lang You are right. It is very similar, but not equal. The updated version uses the following from C: comment, comment-multiline, close-comment-outside-comment, boolean, decimal, octal, hexadecimal and float. I can't use the preprocessing stuff because: - GLSL has no strings - There is no 'include' statement - There are only the three macros available (C has more)
The file looks good to me, could you please attach a test file no more than 10 lines too, please?
I was wrong again... I can use the if0-comment. Please wait for another update. I have to check the specs once again.
Created attachment 142836 [details] [review] GLSL lang file update2 + use c:if0-comment
Created attachment 142837 [details] test file A small test file.
Created attachment 142838 [details] [review] real GLSL update 2 sorry, wrong file.
Thanks for the files. They were added to the master branch and they will be available in the next major release.
Hi Simon, thanks for the update and finishing touch :)