After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 300162 - Syntax file for OpenGL Shading Language (GLSL)
Syntax file for OpenGL Shading Language (GLSL)
Status: RESOLVED FIXED
Product: gtksourceview
Classification: Platform
Component: Syntax files
unspecified
Other All
: High enhancement
: ---
Assigned To: GTK Sourceview maintainers
GTK Sourceview maintainers
Depends on:
Blocks:
 
 
Reported: 2005-04-11 09:24 UTC by Chong Kai Xiong
Modified: 2014-02-15 12:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GLSL .lang file (11.10 KB, text/plain)
2005-04-11 09:25 UTC, Chong Kai Xiong
  Details
Noise-demo GLSL files from clockworkcoders.com (2.34 KB, application/x-compressed-tar)
2005-08-04 00:51 UTC, Chong Kai Xiong
  Details
Syntax file with updated MIME types (11.12 KB, text/plain)
2006-03-19 06:30 UTC, Chong Kai Xiong
  Details
lang file for GLSL (15.68 KB, patch)
2009-09-09 21:33 UTC, Simon Wenner
none Details | Review
updated GLSL lang (14.07 KB, patch)
2009-09-09 23:08 UTC, Simon Wenner
none Details | Review
GLSL lang file update2 (357 bytes, patch)
2009-09-09 23:48 UTC, Simon Wenner
none Details | Review
test file (226 bytes, application/octet-stream)
2009-09-09 23:50 UTC, Simon Wenner
  Details
real GLSL update 2 (13.75 KB, patch)
2009-09-09 23:54 UTC, Simon Wenner
none Details | Review

Description Chong Kai Xiong 2005-04-11 09:24:33 UTC
Hi. I've created a .lang file for GLSL version 1.10.
Comment 1 Chong Kai Xiong 2005-04-11 09:25:40 UTC
Created attachment 45125 [details]
GLSL .lang file

GLSL .lang file
Comment 2 Paolo Maggi 2005-08-03 17:07:20 UTC
Sorry for the very late reply.

Can you please attach some sample files so we can test you .lang file?
Comment 3 Chong Kai Xiong 2005-08-04 00:51:41 UTC
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
Comment 4 Chong Kai Xiong 2005-08-04 00:57:29 UTC
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.
Comment 5 Paolo Maggi 2005-12-30 15:50:51 UTC
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.
Comment 6 Chong Kai Xiong 2006-03-15 13:52:38 UTC
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.
Comment 7 Chong Kai Xiong 2006-03-19 06:28:13 UTC
I've filed the request at:
https://bugs.freedesktop.org/show_bug.cgi?id=6314
Comment 8 Chong Kai Xiong 2006-03-19 06:30:42 UTC
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.
Comment 9 Paolo Maggi 2006-12-13 13:40:47 UTC
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. 
Comment 10 Simon Wenner 2009-09-09 21:33:04 UTC
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
Comment 11 Ignacio Casal Quinteiro (nacho) 2009-09-09 21:42:14 UTC
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.
Comment 12 Simon Wenner 2009-09-09 23:08:41 UTC
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)
Comment 13 Ignacio Casal Quinteiro (nacho) 2009-09-09 23:12:49 UTC
The file looks good to me, could you please attach a test file no more than 10 lines too, please?
Comment 14 Simon Wenner 2009-09-09 23:15:29 UTC
I was wrong again... I can use the if0-comment. Please wait for another update. I have to check the specs once again.
Comment 15 Simon Wenner 2009-09-09 23:48:47 UTC
Created attachment 142836 [details] [review]
GLSL lang file update2

+ use c:if0-comment
Comment 16 Simon Wenner 2009-09-09 23:50:37 UTC
Created attachment 142837 [details]
test file

A small test file.
Comment 17 Simon Wenner 2009-09-09 23:54:21 UTC
Created attachment 142838 [details] [review]
real GLSL update 2

sorry, wrong file.
Comment 18 Ignacio Casal Quinteiro (nacho) 2009-09-10 08:39:41 UTC
Thanks for the files. They were added to the master branch and they will be available in the next major release.
Comment 19 Chong Kai Xiong 2009-09-11 11:04:13 UTC
Hi Simon, thanks for the update and finishing touch :)