diff options
author | Michal Krol <[email protected]> | 2010-02-17 11:18:03 +0100 |
---|---|---|
committer | Michal Krol <[email protected]> | 2010-02-17 11:22:01 +0100 |
commit | cb66e9f2b427afeffc0b92801e6943f0b17bf1f1 (patch) | |
tree | 00a9640eb7519e1c03c9f4d755d014146b28ee8f /src | |
parent | 27a68bd14aea55ee4653520403c29e3e16f55e63 (diff) |
glsl/pp: Remove sl_pp_get_extension_state().
Parse extension tokens to track current state of extension enables.
Diffstat (limited to 'src')
-rw-r--r-- | src/glsl/pp/sl_pp_context.h | 8 | ||||
-rw-r--r-- | src/glsl/pp/sl_pp_extension.c | 41 | ||||
-rw-r--r-- | src/glsl/pp/sl_pp_public.h | 4 |
3 files changed, 0 insertions, 53 deletions
diff --git a/src/glsl/pp/sl_pp_context.h b/src/glsl/pp/sl_pp_context.h index 1232f1e9e31..8abb9708b85 100644 --- a/src/glsl/pp/sl_pp_context.h +++ b/src/glsl/pp/sl_pp_context.h @@ -43,16 +43,8 @@ #define SL_PP_MAX_PREDEFINED 16 -enum sl_pp_extension_state { - SL_PP_EXTENSION_STATE_ENABLED, - SL_PP_EXTENSION_STATE_DISABLED, - SL_PP_EXTENSION_STATE_WARN, - SL_PP_EXTENSION_STATE_REQUIRE -}; - struct sl_pp_extension { int name; /*< GL_VENDOR_extension_name */ - enum sl_pp_extension_state state; }; struct sl_pp_predefined { diff --git a/src/glsl/pp/sl_pp_extension.c b/src/glsl/pp/sl_pp_extension.c index 0816e815a4b..d119677c268 100644 --- a/src/glsl/pp/sl_pp_extension.c +++ b/src/glsl/pp/sl_pp_extension.c @@ -53,8 +53,6 @@ sl_pp_context_add_extension(struct sl_pp_context *context, return -1; } - ext.state = SL_PP_EXTENSION_STATE_DISABLED; - context->extensions[context->num_extensions++] = ext; assert(context->num_extensions <= sizeof(context->extensions)); @@ -63,23 +61,6 @@ sl_pp_context_add_extension(struct sl_pp_context *context, } -enum sl_pp_extension_state -sl_pp_get_extension_state(const struct sl_pp_context *context, - int extension_name) -{ - unsigned i; - - for (i = 0; i < context->num_extensions; i++) { - if (extension_name == context->extensions[i].name) { - return context->extensions[i].state; - } - } - - assert(0 && "unknown extension"); - return SL_PP_EXTENSION_STATE_DISABLED; -} - - /** * Process a "#extension name: behavior" directive. */ @@ -93,7 +74,6 @@ sl_pp_process_extension(struct sl_pp_context *context, int extension_name = -1; int behavior = -1; struct sl_pp_token_info out; - struct sl_pp_extension *extension = NULL; /* Grab the extension name. */ if (first < last && input[first].token == SL_PP_IDENTIFIER) { @@ -115,7 +95,6 @@ sl_pp_process_extension(struct sl_pp_context *context, for (i = 0; i < context->num_extensions; i++) { if (extension_name == context->extensions[i].name) { out.data.extension = extension_name; - extension = &context->extensions[i]; break; } } @@ -155,11 +134,6 @@ sl_pp_process_extension(struct sl_pp_context *context, return -1; } out.token = SL_PP_EXTENSION_REQUIRE; - - if (extension_name != context->dict.all) { - assert(extension); - extension->state = SL_PP_EXTENSION_STATE_REQUIRE; - } } else if (behavior == context->dict.enable) { if (out.data.extension == -1) { /* Warning: the extension cannot be enabled. */ @@ -170,33 +144,18 @@ sl_pp_process_extension(struct sl_pp_context *context, return -1; } out.token = SL_PP_EXTENSION_ENABLE; - - if (extension_name != context->dict.all) { - assert(extension); - extension->state = SL_PP_EXTENSION_STATE_ENABLED; - } } 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; - - if (extension_name != context->dict.all) { - assert(extension); - extension->state = SL_PP_EXTENSION_STATE_WARN; - } } 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; - - if (extension_name != context->dict.all) { - assert(extension); - extension->state = SL_PP_EXTENSION_STATE_DISABLED; - } } else { strcpy(context->error_msg, "unrecognised behavior name"); return -1; diff --git a/src/glsl/pp/sl_pp_public.h b/src/glsl/pp/sl_pp_public.h index e4ad80d0b2a..ca6f722543d 100644 --- a/src/glsl/pp/sl_pp_public.h +++ b/src/glsl/pp/sl_pp_public.h @@ -55,10 +55,6 @@ int sl_pp_context_add_extension(struct sl_pp_context *context, const char *name); -enum sl_pp_extension_state -sl_pp_get_extension_state(const struct sl_pp_context *context, - int extension_name); - int sl_pp_context_add_predefined(struct sl_pp_context *context, const char *name, |