mojoshader_compiler.c
changeset 1009 ba0ed22a4bac
parent 1007 7bd3a6b86fd7
child 1010 bbfed6061a2e
equal deleted inserted replaced
1008:9cbe3e4bfba5 1009:ba0ed22a4bac
   675                  MOJOSHADER_AST_OP_DEREF_STRUCT);
   675                  MOJOSHADER_AST_OP_DEREF_STRUCT);
   676     retval->datatype = NULL;
   676     retval->datatype = NULL;
   677     retval->identifier = identifier;
   677     retval->identifier = identifier;
   678     retval->member = member;  // cached; don't copy string.
   678     retval->member = member;  // cached; don't copy string.
   679     retval->isswizzle = 0;  // may change during semantic analysis.
   679     retval->isswizzle = 0;  // may change during semantic analysis.
       
   680     retval->member_index = 0;  // set during semantic analysis.
   680     return (MOJOSHADER_astExpression *) retval;
   681     return (MOJOSHADER_astExpression *) retval;
   681 } // new_deref_struct_expr
   682 } // new_deref_struct_expr
   682 
   683 
   683 static MOJOSHADER_astExpression *new_literal_int_expr(Context *ctx,
   684 static MOJOSHADER_astExpression *new_literal_int_expr(Context *ctx,
   684                                                        const int value)
   685                                                        const int value)
  2657             for (i = 0; i < reduced->structure.member_count; i++)
  2658             for (i = 0; i < reduced->structure.member_count; i++)
  2658             {
  2659             {
  2659                 if (strcmp(mbrs[i].identifier, member) == 0)
  2660                 if (strcmp(mbrs[i].identifier, member) == 0)
  2660                 {
  2661                 {
  2661                     ast->derefstruct.datatype = mbrs[i].datatype;
  2662                     ast->derefstruct.datatype = mbrs[i].datatype;
       
  2663                     ast->derefstruct.member_index = i;
  2662                     break;
  2664                     break;
  2663                 } // if
  2665                 } // if
  2664             } // for
  2666             } // for
  2665 
  2667 
  2666             if (ast->derefstruct.datatype == NULL)
  2668             if (ast->derefstruct.datatype == NULL)