GL: Change array macro to not conflict with opensubdiv variable names

Fix T97449 GPU subdivision: Crash on adding subdivision surface modifier
This commit is contained in:
Clément Foucault 2022-04-20 21:31:54 +02:00
parent 4a03c5acf9
commit b67ccc333a
Notes: blender-bot 2023-02-14 06:42:53 +01:00
Referenced by issue #98646, crash in preview mode with volume shader
Referenced by issue #97595, Regression: GeoNode attribute output passing does not work in the latest nightly
Referenced by issue #97449, GPU subdivision: Crash on adding subdivision surface modifier
1 changed files with 2 additions and 2 deletions

View File

@ -855,7 +855,7 @@ static char *glsl_patch_default_get()
STR_CONCAT(patch, slen, "#define gpu_InstanceIndex (gl_InstanceID + gpu_BaseInstance)\n");
/* Array compat. */
STR_CONCAT(patch, slen, "#define array(_type) _type[]\n");
STR_CONCAT(patch, slen, "#define gpu_Array(_type) _type[]\n");
/* Derivative sign can change depending on implementation. */
STR_CONCATF(patch, slen, "#define DFDX_SIGN %1.1f\n", GLContext::derivative_signs[0]);
@ -882,7 +882,7 @@ static char *glsl_patch_compute_get()
STR_CONCAT(patch, slen, "#extension GL_ARB_compute_shader :enable\n");
/* Array compat. */
STR_CONCAT(patch, slen, "#define array(_type) _type[]\n");
STR_CONCAT(patch, slen, "#define gpu_Array(_type) _type[]\n");
BLI_assert(slen < sizeof(patch));
return patch;