summaryrefslogtreecommitdiff
path: root/src/glsl/pp/sl_pp_macro.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/glsl/pp/sl_pp_macro.c')
-rw-r--r--src/glsl/pp/sl_pp_macro.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/glsl/pp/sl_pp_macro.c b/src/glsl/pp/sl_pp_macro.c
index 05466c9a7c..08b44c7cbe 100644
--- a/src/glsl/pp/sl_pp_macro.c
+++ b/src/glsl/pp/sl_pp_macro.c
@@ -163,6 +163,23 @@ sl_pp_macro_expand(struct sl_pp_context *context,
return 0;
}
+ for (j = 0; j < context->num_predefined; j++) {
+ if (macro_name == context->predefined[j].name) {
+ if (!mute) {
+ struct sl_pp_token_info ti;
+
+ ti.token = SL_PP_UINT;
+ ti.data._uint = context->predefined[j].value;
+ if (sl_pp_process_out(state, &ti)) {
+ strcpy(context->error_msg, "out of memory");
+ return -1;
+ }
+ }
+ (*pi)++;
+ return 0;
+ }
+ }
+
/* Replace extension names with 1.
*/
for (j = 0; j < context->num_extensions; j++) {