Text Editor: Add GLSL support language #116793

Closed
Gangneron wants to merge 68 commits from Gangneron/blender:Add_GLSL into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
1 changed files with 15 additions and 12 deletions
Showing only changes of commit 246c57fa3a - Show all commits

View File

@ -27,6 +27,7 @@
*/
Gangneron marked this conversation as resolved Outdated

I don't know what this Array is. And why is it with uppercase A?

I don't know what this `Array` is. And why is it with uppercase `A`?
static const char *text_format_glsl_literals_builtinfunc_data[] = {
/* Force single column, sorted list. */
/* clang-format off */
"abs",
"acos",
"acosh",
@ -177,6 +178,7 @@ static const char *text_format_glsl_literals_builtinfunc_data[] = {
"unpackUnorm2x16",
"unpackUnorm4x8",
"usubBorrow",
/* clang-format on */
};
static const Span<const char *> text_format_glsl_literals_builtinfunc(
text_format_glsl_literals_builtinfunc_data,
@ -188,6 +190,7 @@ static const Span<const char *> text_format_glsl_literals_builtinfunc(
*/
static const char *text_format_glsl_literals_reserved_data[] = {
/* Force single column, sorted list. */
/* clang-format off */
"attribute",
"bool",
Gangneron marked this conversation as resolved Outdated

It's ldexp not idexp. If you did this list by hand, other typos might have slept in. So i would suggest to not do manually and use an official list somewhere like https://docs.gl/sl4/acos (left panel, expand all sections).

It's `ldexp` not `idexp`. If you did this list by hand, other typos might have slept in. So i would suggest to not do manually and use an official list somewhere like https://docs.gl/sl4/acos (left panel, expand all sections).
"break",
@ -277,8 +280,18 @@ static const char *text_format_glsl_literals_reserved_data[] = {
"void",
"volatile",
"while",
/* clang-format on */
};
static const Span<const char *> text_format_glsl_literals_reserved(
text_format_glsl_literals_reserved_data, ARRAY_SIZE(text_format_glsl_literals_reserved_data));
/* Built-In Variable */
/**
* GLSL special variables.
* https://registry.khronos.org/OpenGL/specs/gl/GLSLangSpec.4.60.pdf
*/
Gangneron marked this conversation as resolved Outdated

Use spaces within C-style comments, e.g. /* Built-In Variable */

Use spaces within C-style comments, e.g. `/* Built-In Variable */`

normally all comment problems are corrected

normally all comment problems are corrected
static const char *text_format_glsl_literals_specialvar_data[] = {
/* Force single column , sorted list */
/* clang-format off */
"gl_ClipDistance",
"gl_FragCoord",
"gl_FragDepth",
@ -308,17 +321,7 @@ static const char *text_format_glsl_literals_reserved_data[] = {
"gl_ViewportIndex",
"gl_WorkGroupID",
"gl_WorkGroupSize",
};
static const Span<const char *> text_format_glsl_literals_reserved(
text_format_glsl_literals_reserved_data, ARRAY_SIZE(text_format_glsl_literals_reserved_data));
/* GLSL shader types */
static const char *text_format_glsl_literals_specialvar_data[] = {
/* Force single column , sorted list */
"displacement",
"shader",
"surface",
"volume",
/* clang-format on */
};
static const Span<const char *> text_format_glsl_literals_specialvar(
text_format_glsl_literals_specialvar_data,