summaryrefslogtreecommitdiff
path: root/src/glsl/pp/sl_pp_context.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/glsl/pp/sl_pp_context.c')
-rw-r--r--src/glsl/pp/sl_pp_context.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/glsl/pp/sl_pp_context.c b/src/glsl/pp/sl_pp_context.c
index 2fca3791a2..88a002c1c7 100644
--- a/src/glsl/pp/sl_pp_context.c
+++ b/src/glsl/pp/sl_pp_context.c
@@ -29,16 +29,24 @@
#include "sl_pp_context.h"
-void
+int
sl_pp_context_init(struct sl_pp_context *context)
{
memset(context, 0, sizeof(struct sl_pp_context));
+
+ if (sl_pp_dict_init(context)) {
+ sl_pp_context_destroy(context);
+ return -1;
+ }
+
context->macro_tail = &context->macro;
context->if_ptr = SL_PP_MAX_IF_NESTING;
context->if_value = 1;
memset(context->error_msg, 0, sizeof(context->error_msg));
context->line = 1;
context->file = 0;
+
+ return 0;
}
void