glsl/pp: Add sl_pp_context_add_extension().
[mesa.git] / src / glsl / pp / sl_pp_macro.c
index 29f1229dd7d835a8994c1067aadfa55e61e8ec5b..05466c9a7c39f8cbcb0b6292c08f1d8be83890aa 100644 (file)
@@ -163,6 +163,18 @@ sl_pp_macro_expand(struct sl_pp_context *context,
       return 0;
    }
 
+   /* Replace extension names with 1.
+    */
+   for (j = 0; j < context->num_extensions; j++) {
+      if (macro_name == context->extensions[j].name) {
+         if (!mute && _out_number(context, state, 1)) {
+            return -1;
+         }
+         (*pi)++;
+         return 0;
+      }
+   }
+
    /* TODO: For FEATURE_es2_glsl, expand to 1 the following symbols.
     *       GL_ES
     *       GL_FRAGMENT_PRECISION_HIGH