| 1082 | } |
| 1083 | |
| 1084 | void HLSLCompiler::translateStructure(M4::HLSLStruct* structure) |
| 1085 | { |
| 1086 | m_structures.push_back(Structure()); |
| 1087 | Structure& str = m_structures[m_structures.size() - 1]; |
| 1088 | str.Name = structure->name; |
| 1089 | str.ID = m_gen.AddObject(str.Name); |
| 1090 | |
| 1091 | M4::HLSLStructField* field = structure->field; |
| 1092 | while (field != NULL) |
| 1093 | { |
| 1094 | if (!field->hidden) |
| 1095 | { |
| 1096 | Variable fieldData; |
| 1097 | |
| 1098 | fieldData.Name = field->name; |
| 1099 | m_gen.AddProperty(str.Name, fieldData.Name); |
| 1100 | |
| 1101 | M4::HLSLType ftype = field->type; |
| 1102 | HLSLCompiler::ExpressionType etype = m_convertType(ftype); |
| 1103 | fieldData.Type = etype.Name; |
| 1104 | fieldData.Semantic = field->sv_semantic ? field->sv_semantic : (field->semantic ? field->semantic : ""); |
| 1105 | fieldData.IsArray = ftype.array; |
| 1106 | |
| 1107 | str.Members.push_back(fieldData); |
| 1108 | } |
| 1109 | field = field->nextField; |
| 1110 | } |
| 1111 | } |
| 1112 | void HLSLCompiler::translateFunction(M4::HLSLFunction* func) |
| 1113 | { |
| 1114 | m_func.push_back(Function()); |