| 1149 | } |
| 1150 | |
| 1151 | void GFXDevice::describeResources(const char* resNames, const char* filePath, bool unflaggedOnly) |
| 1152 | { |
| 1153 | const U32 numResourceTypes = 9; |
| 1154 | Vector<GFXResource*> resVectors[numResourceTypes]; |
| 1155 | const char* reslabels[numResourceTypes] = { "texture", "texture target", "window target", "vertex buffers", "primitive buffers", "fences", "cubemaps", "shaders", "stateblocks" }; |
| 1156 | |
| 1157 | // Fill the vectors with the right resources |
| 1158 | fillResourceVectors(resNames, unflaggedOnly, resVectors[0], resVectors[1], resVectors[2], resVectors[3], |
| 1159 | resVectors[4], resVectors[5], resVectors[6], resVectors[7], resVectors[8]); |
| 1160 | |
| 1161 | // Helper object |
| 1162 | DescriptionOutputter output(filePath); |
| 1163 | |
| 1164 | // Print the info to the file |
| 1165 | // Note that we check if we have any objects of that type. |
| 1166 | for (U32 i = 0; i < numResourceTypes; i++) |
| 1167 | { |
| 1168 | if (resVectors[i].size()) |
| 1169 | { |
| 1170 | // Header |
| 1171 | String header = String::ToString("--------Dumping GFX %s descriptions...----------", reslabels[i]); |
| 1172 | output.write(header); |
| 1173 | // Data |
| 1174 | for (U32 j = 0; j < resVectors[i].size(); j++) |
| 1175 | { |
| 1176 | GFXResource* resource = resVectors[i][j]; |
| 1177 | String dataline = String::ToString("Addr: %x %s", resource, resource->describeSelf().c_str()); |
| 1178 | output.write(dataline.c_str()); |
| 1179 | } |
| 1180 | // Footer |
| 1181 | output.write("--------------------Done---------------------"); |
| 1182 | output.write(""); |
| 1183 | } |
| 1184 | } |
| 1185 | } |
| 1186 | |
| 1187 | void GFXDevice::flagCurrentResources() |
| 1188 | { |
no test coverage detected