parser: Ensure that param_binding_type is set correctly
authorIan Romanick <ian.d.romanick@intel.com>
Wed, 22 Jul 2009 23:03:32 +0000 (16:03 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Wed, 22 Jul 2009 23:03:32 +0000 (16:03 -0700)
src/mesa/shader/program_parse.tab.c
src/mesa/shader/program_parse.y

index 40d48d597b9c019e8c4a613900c0ddaac7c01e0b..0ea0e241066322982b2d6d186f723e8ae8d892e0 100644 (file)
@@ -4702,6 +4702,7 @@ initialize_symbol_from_state(struct gl_program *prog,
    memcpy(state_tokens, tokens, sizeof(state_tokens));
 
    param_var->type = at_param;
+   param_var->param_binding_type = PROGRAM_STATE_VAR;
 
    /* If we are adding a STATE_MATRIX that has multiple rows, we need to
     * unroll it and call add_state_reference() for each row
@@ -4753,6 +4754,8 @@ initialize_symbol_from_param(struct gl_program *prog,
          || (state_tokens[1] == STATE_LOCAL));
 
    param_var->type = at_param;
+   param_var->param_binding_type = (state_tokens[1] == STATE_ENV)
+     ? PROGRAM_ENV_PARAM : PROGRAM_LOCAL_PARAM;
 
    /* If we are adding a STATE_ENV or STATE_LOCAL that has multiple elements,
     * we need to unroll it and call add_state_reference() for each row
@@ -4792,6 +4795,7 @@ initialize_symbol_from_const(struct gl_program *prog,
                                       NULL, 0x0);
 
    param_var->type = at_param;
+   param_var->param_binding_type = PROGRAM_CONSTANT;
 
    if (param_var->param_binding_begin == ~0U)
       param_var->param_binding_begin = idx;
index 81b06ac13c92dce49d4e1d704832e8d51bb2d86f..a0bec96924a91647fd1a9195c62dc6be838ad895 100644 (file)
@@ -1918,6 +1918,7 @@ initialize_symbol_from_state(struct gl_program *prog,
    memcpy(state_tokens, tokens, sizeof(state_tokens));
 
    param_var->type = at_param;
+   param_var->param_binding_type = PROGRAM_STATE_VAR;
 
    /* If we are adding a STATE_MATRIX that has multiple rows, we need to
     * unroll it and call add_state_reference() for each row
@@ -1969,6 +1970,8 @@ initialize_symbol_from_param(struct gl_program *prog,
          || (state_tokens[1] == STATE_LOCAL));
 
    param_var->type = at_param;
+   param_var->param_binding_type = (state_tokens[1] == STATE_ENV)
+     ? PROGRAM_ENV_PARAM : PROGRAM_LOCAL_PARAM;
 
    /* If we are adding a STATE_ENV or STATE_LOCAL that has multiple elements,
     * we need to unroll it and call add_state_reference() for each row
@@ -2008,6 +2011,7 @@ initialize_symbol_from_const(struct gl_program *prog,
                                       NULL, 0x0);
 
    param_var->type = at_param;
+   param_var->param_binding_type = PROGRAM_CONSTANT;
 
    if (param_var->param_binding_begin == ~0U)
       param_var->param_binding_begin = idx;