glsl/pp: Do not try to enable extension `all'.
authorMichal Krol <michal@vmware.com>
Tue, 16 Feb 2010 09:04:58 +0000 (10:04 +0100)
committerMichal Krol <michal@vmware.com>
Tue, 16 Feb 2010 09:04:58 +0000 (10:04 +0100)
src/glsl/pp/sl_pp_extension.c

index 677fb8a0e6f5d688b713fbbc82a06b0f0d935778..1f00d94ebac64920f5504f21f000b95d0549bb45 100644 (file)
@@ -137,8 +137,11 @@ sl_pp_process_extension(struct sl_pp_context *context,
          return -1;
       }
       out.token = SL_PP_EXTENSION_REQUIRE;
-      assert(extension);
-      extension->enabled = 1;
+
+      if (extension_name != context->dict.all) {
+         assert(extension);
+         extension->enabled = 1;
+      }
    } else if (behavior == context->dict.enable) {
       if (out.data.extension == -1) {
          /* Warning: the extension cannot be enabled. */
@@ -149,24 +152,33 @@ sl_pp_process_extension(struct sl_pp_context *context,
          return -1;
       }
       out.token = SL_PP_EXTENSION_ENABLE;
-      assert(extension);
-      extension->enabled = 1;
+
+      if (extension_name != context->dict.all) {
+         assert(extension);
+         extension->enabled = 1;
+      }
    } else if (behavior == context->dict.warn) {
       if (out.data.extension == -1) {
          /* Warning: the extension is not supported. */
          return 0;
       }
       out.token = SL_PP_EXTENSION_WARN;
-      assert(extension);
-      extension->enabled = 1;
+
+      if (extension_name != context->dict.all) {
+         assert(extension);
+         extension->enabled = 1;
+      }
    } else if (behavior == context->dict.disable) {
       if (out.data.extension == -1) {
          /* Warning: the extension is not supported. */
          return 0;
       }
       out.token = SL_PP_EXTENSION_DISABLE;
-      assert(extension);
-      extension->enabled = 0;
+
+      if (extension_name != context->dict.all) {
+         assert(extension);
+         extension->enabled = 0;
+      }
    } else {
       strcpy(context->error_msg, "unrecognised behavior name");
       return -1;