-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathFile_OGLAPICallsBenchmark.cpp
More file actions
408 lines (393 loc) · 21.8 KB
/
File_OGLAPICallsBenchmark.cpp
File metadata and controls
408 lines (393 loc) · 21.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
/*
# Copyright (c) 2012, Tristan Lorach & NVIDIA CORPORATION. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of NVIDIA CORPORATION nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "stdafx.h"
#define NUM_BASE_VALUES 12
#define NUM_EXP_EVENTS 11
//
// Load the API Calls benchmark report:
//
//
bool loadOGLAPICallsCSVFile(const char *name, const char *fname, const std::vector<std::string> &keywordTable, bool bDiffGraph, bool bCollapse)
{
int graphSignal, graphRawSignal, firstGraphId, firstGraphRawId;
int firstGraphIdOffset, firstGraphRawIdOffset;
char tmpstr[1024];
std::vector< std::string > itemNames;
std::vector< bool > itemIsPercent;
int graphDiff = -1;
bool bHasSignals = true;
bool bHasAnalysis = true;
int numSignals = 0, startIdxSignals = 0;
std::ifstream fs(fname);
if(!fs.is_open())
{
if(g_pLog) g_pLog->AddMessage("no>>Failure...");
return false;
}
// for size of the file so we can display a progress bar
fs.seekg( -1, std::ios_base::end );
int bSize = fs.tellg();
fs.seekg( 0, std::ios_base::beg );
g_pProgressBar->SetTitle("Loading API Calls benchmark data...");
if(g_pLog) g_pLog->AddMessage("Loading API Calls benchmark data %s", fname);
fs.getline(tmpstr, 1023); //title line
if(*tmpstr == '\0')
{
if(g_pLog) g_pLog->AddMessage("no>>Failure...");
return false;
}
g_apiCall.clear();
// Let's parse the title line : some names will be needed for the unknown signals
Pattern *patNames = Pattern::compile("([0-9/\\[\\]\\-\\(\\)\\%\\.=:\\|_\\w\\s]+)");
Matcher *matchNames = patNames->createMatcher(tmpstr);
int nNames = 0;
if(matchNames->findFirstMatch())
{
do {
std::string name = matchNames->getGroup(1);
itemNames.push_back(name);
itemIsPercent.push_back(strstr(name.c_str(), "%") ? true : false);
if((int)itemNames.size() == NUM_BASE_VALUES+1)
if(strcmp("GPU Bottleneck", itemNames[NUM_BASE_VALUES].c_str()))
bHasAnalysis = false;
} while(matchNames->findNextMatch());
}
if((int)itemNames.size() == NUM_BASE_VALUES)
{
bHasSignals = false;
bHasAnalysis = false;
}
else if(bHasAnalysis && (int)itemNames.size() == (NUM_BASE_VALUES+NUM_EXP_EVENTS) )
bHasSignals = false;
else
{
startIdxSignals = (bHasAnalysis ? NUM_BASE_VALUES+NUM_EXP_EVENTS : NUM_BASE_VALUES);
numSignals = (int)itemNames.size() - startIdxSignals;
}
IWindowFolding *pWFold, *pWFoldElts, *pWFoldEltsTotal, *pWFoldSignals, *pWFoldRawSignals, *pWFoldSignals2, *pWFoldRawSignals2;
// FOR NOW: LET's ASSUME that this is always done in display #0 :
int disp = 0;
int dispElts = disp + 1;
int dispEltsTotal = disp + 2;
int dispSignals = disp + 3;
int dispRawSignals = disp + 4;
if((int)g_pDisplays.size() == 0)
{
TLDisplay *pDisp = new TLDisplay(g_hwnd);
pDisp->name = "OGL API Calls Benchmark";
g_pDisplays.push_back(pDisp);
TLDisplay *pDispElts = new TLDisplay(g_hwnd);
pDispElts->name = "OGL Num Elts";
g_pDisplays.push_back(pDispElts);
TLDisplay *pDispEltsTotal = new TLDisplay(g_hwnd);
pDispElts->name = "OGL Total Num Elts";
g_pDisplays.push_back(pDispEltsTotal);
TLDisplay *pDispSignals = new TLDisplay(g_hwnd);
pDispSignals->name = "Instrumentation%";
g_pDisplays.push_back(pDispSignals);
TLDisplay *pDispRawSignals = new TLDisplay(g_hwnd);
pDispSignals->name = "Instrumentation";
g_pDisplays.push_back(pDispRawSignals);
//UI:
(pWFold = g_pwinHandler->CreateWindowFolding((LPCSTR)(1<<8), "API Calls Benchmark", g_pMainContainer))->UnFold();
(pWFoldElts = g_pwinHandler->CreateWindowFolding((LPCSTR)(2<<8), "API Calls Elements", g_pMainContainer))->UnFold();
(pWFoldEltsTotal= g_pwinHandler->CreateWindowFolding((LPCSTR)(3<<8), "API Calls Elements Total", g_pMainContainer))->UnFold();
(pWFoldSignals = g_pwinHandler->CreateWindowFolding((LPCSTR)(4<<8), "Signals", g_pMainContainer))->UnFold();
(pWFoldRawSignals = g_pwinHandler->CreateWindowFolding((LPCSTR)(5<<8), "RawSignals", g_pMainContainer))->UnFold();
firstGraphIdOffset = 0;
firstGraphRawIdOffset = 0;
}
else
{
pWFold = (IWindowFolding *)g_pwinHandler->Get((LPCSTR)(1<<8))->QueryInterface("IWindowFolding");
pWFoldElts = (IWindowFolding *)g_pwinHandler->Get((LPCSTR)(2<<8))->QueryInterface("IWindowFolding");
pWFoldEltsTotal = (IWindowFolding *)g_pwinHandler->Get((LPCSTR)(3<<8))->QueryInterface("IWindowFolding");
pWFoldSignals = (IWindowFolding *)g_pwinHandler->Get((LPCSTR)(4<<8))->QueryInterface("IWindowFolding");
pWFoldRawSignals = (IWindowFolding *)g_pwinHandler->Get((LPCSTR)(5<<8))->QueryInterface("IWindowFolding");
firstGraphIdOffset = (int)g_pDisplays[dispSignals]->Graphs.size();
firstGraphRawIdOffset = (int)g_pDisplays[dispRawSignals]->Graphs.size();
}
int graphTime = g_pDisplays[disp]->addGraph(name);
g_pwinHandler->CreateCtrlCheck((LPCSTR)(((disp+1)<<8) + graphTime + 1), name, pWFold)->SetChecked(true);
int graphElts = g_pDisplays[dispElts]->addGraph("OGL Elements");
int graphGLCalls = g_pDisplays[dispElts]->addGraph("GL calls");
int graphPoints = g_pDisplays[dispElts]->addGraph("Points");
int graphLines = g_pDisplays[dispElts]->addGraph("Lines");
int graphTris = g_pDisplays[dispElts]->addGraph("Triangles");
int graphQuads = g_pDisplays[dispElts]->addGraph("Quads");
g_pwinHandler->CreateCtrlCheck((LPCSTR)(((dispElts+1)<<8) + graphElts + 1), "OGL Elements", pWFoldElts)->SetChecked(true);
g_pwinHandler->CreateCtrlCheck((LPCSTR)(((dispElts+1)<<8) + graphGLCalls + 1), "GL API Calls", pWFoldElts)->SetChecked(true);
g_pwinHandler->CreateCtrlCheck((LPCSTR)(((dispElts+1)<<8) + graphPoints + 1), "Points", pWFoldElts)->SetChecked(true);
g_pwinHandler->CreateCtrlCheck((LPCSTR)(((dispElts+1)<<8) + graphLines + 1), "Lines", pWFoldElts)->SetChecked(true);
g_pwinHandler->CreateCtrlCheck((LPCSTR)(((dispElts+1)<<8) + graphTris + 1), "Triangles", pWFoldElts)->SetChecked(true);
g_pwinHandler->CreateCtrlCheck((LPCSTR)(((dispElts+1)<<8) + graphQuads + 1), "Quads", pWFoldElts)->SetChecked(true);
int graphEltsTotal = g_pDisplays[dispEltsTotal]->addGraph("OGL Total Elements");
int graphGLCallsTotal = g_pDisplays[dispEltsTotal]->addGraph("GL calls Total");
int graphPointsTotal = g_pDisplays[dispEltsTotal]->addGraph("Points");
int graphLinesTotal = g_pDisplays[dispEltsTotal]->addGraph("Lines");
int graphTrisTotal = g_pDisplays[dispEltsTotal]->addGraph("Triangles");
int graphQuadsTotal = g_pDisplays[dispEltsTotal]->addGraph("Quads");
g_pwinHandler->CreateCtrlCheck((LPCSTR)(((dispEltsTotal+1)<<8) + graphEltsTotal + 1), "OGL Elements Total", pWFoldElts)->SetChecked(true);
g_pwinHandler->CreateCtrlCheck((LPCSTR)(((dispEltsTotal+1)<<8) + graphGLCallsTotal + 1), "GL API Calls Total", pWFoldElts)->SetChecked(true);
g_pwinHandler->CreateCtrlCheck((LPCSTR)(((dispEltsTotal+1)<<8) + graphPointsTotal + 1), "Points Total", pWFoldElts)->SetChecked(true);
g_pwinHandler->CreateCtrlCheck((LPCSTR)(((dispEltsTotal+1)<<8) + graphLinesTotal + 1), "Lines Total", pWFoldElts)->SetChecked(true);
g_pwinHandler->CreateCtrlCheck((LPCSTR)(((dispEltsTotal+1)<<8) + graphTrisTotal + 1), "Triangles Total", pWFoldElts)->SetChecked(true);
g_pwinHandler->CreateCtrlCheck((LPCSTR)(((dispEltsTotal+1)<<8) + graphQuadsTotal + 1), "Quads Total", pWFoldElts)->SetChecked(true);
pWFoldSignals2 = g_pwinHandler->CreateWindowFolding((LPCSTR)((5+firstGraphIdOffset)<<8), name, pWFoldSignals);
pWFoldRawSignals2 = g_pwinHandler->CreateWindowFolding((LPCSTR)((6+firstGraphRawIdOffset)<<8), name, pWFoldRawSignals);
firstGraphId = (int)g_pDisplays[dispSignals]->Graphs.size();
firstGraphRawId = (int)g_pDisplays[dispRawSignals]->Graphs.size();
graphSignal = firstGraphId;
graphRawSignal = firstGraphRawId;
#define CREATEGRAPH(name, d, g, p)\
{ g = g_pDisplays[d]->addGraph(name);\
g_pwinHandler->CreateCtrlCheck((LPCSTR)(((d +1)<<8) + 1 + g++), name, p)->SetChecked(true); }
if(bHasAnalysis)
for(int i=0; i<10; i++)
{
std::string n = itemNames[NUM_BASE_VALUES+1 + i];
CREATEGRAPH(n.c_str(), dispSignals, graphSignal, pWFoldSignals2); // 12 : after the "GPU Bottleneck"
}
if(bHasSignals)
{
for(int i=0; i<numSignals; i++)
{
std::string n = itemNames[startIdxSignals + i];
if(itemIsPercent[startIdxSignals + i])
CREATEGRAPH(n.c_str(), dispSignals, graphSignal, pWFoldSignals2)
else
CREATEGRAPH(n.c_str(), dispRawSignals, graphRawSignal, pWFoldRawSignals2)
}
}
//Create a 3rd graph for time difference...
//if(bDiffGraph)
//{
// TLDisplay *pDisp = new TLDisplay(g_hwnd);
// pDisp->name = "API Calls time difference";
// g_pDisplays.push_back(pDisp);
// graphDiff = (int)g_pDisplays[g_pDisplays.size()-1]->addGraph(name);
//}
//Examples:
//-1,2.40242,2.40242,first_call_was_skipped,,1999,0
//0,2.4076,0.005188,Clear,,1998,1
//Examples2:
//-1,2.10559,2.10559,first_call_was_skipped,,4147,0,,,
//0,2.42992,0.32433,Clear,,4146,1,,,
//2,2.66265,0.215147,Draw,0,4144,3,ps_ea97b1f6b1cbfb27_1,vs_text_1,vdecl_text_1
//Fill in the graph
Pattern::registerPattern("int", "\\s*([\\-0-9]*)\\s*");
Pattern::registerPattern("float", "\\s*([\\-0-9\\.eE]*)\\s*");
Pattern::registerPattern("text", "\\s*(.*)\\s*");
//Pattern *p = Pattern::compile("{int},{float},{float},(\\w*),(\\w*),{int},{int},?{int},?{int},?{int},?{text}");
// Now we added some PerfSDK signals :
// there can be an undertermined # of signals to read. And we don't know them
//Pattern *pInst = Pattern::compile(",?{float}");
// ,GPU Bottleneck,IDX Bottleneck, IDX SOL,GEOM Bottleneck,GEOM SOL,SHD Bottleneck,SHD SOL,FB Bottleneck,FB SOL,ROP Bottleneck,ROP SOL
//Pattern *pInst = Pattern::compile(",?([\\w\\s]*),?{int},?{int},?{int},?{int},?{int},?{int},?{int},?{int},?{int},?{int},?{text}"); // we still need to gather the comments at the end
//Matcher *m = p->createMatcher("");
//Matcher *mInst = pInst->createMatcher("");
int benchmarkable_call_number_collapsed = 0;
int prevFBO = 0;
int nEltsTotal = 0;
int nGLCalls_total = 0;
unsigned int nPointsTotal=0, nLinesTotal=0, nTrisTotal=0, nQuadsTotal=0;
do {
int benchmarkable_call_number;
int nGLCalls;
float frame_time_ms;
std::string call_type;
std::string prim_type;
unsigned int nElts, curFBO;
unsigned int nPoints, nLines, nTris, nQuads;
std::string comment;
// PerfKit Signals
int IDX_Bottleneck
,IDX_SOL
,GEOM_Bottleneck
,GEOM_SOL
,SHD_Bottleneck
,SHD_SOL
,FB_Bottleneck
,FB_SOL
,ROP_Bottleneck
,ROP_SOL;
std::string GPU_Bottleneck;
fs.getline(tmpstr, 1023);
if(fs.eof())
break;
matchNames->setString(tmpstr);
if(matchNames->findFirstMatch())
{
// We know in advance what to read...
benchmarkable_call_number = atoi(matchNames->getGroup(1).c_str()); matchNames->findNextMatch();
nGLCalls = atoi(matchNames->getGroup(1).c_str()); matchNames->findNextMatch();
nGLCalls_total += nGLCalls;
frame_time_ms = (float)atof(matchNames->getGroup(1).c_str()); matchNames->findNextMatch();
call_type = matchNames->getGroup(1); matchNames->findNextMatch();
prim_type = matchNames->getGroup(1); matchNames->findNextMatch();
nElts = atoi(matchNames->getGroup(1).c_str()); matchNames->findNextMatch();
nEltsTotal += nElts;
nPoints = atoi(matchNames->getGroup(1).c_str()); matchNames->findNextMatch();
nPointsTotal += nPoints;
nLines = atoi(matchNames->getGroup(1).c_str()); matchNames->findNextMatch();
nLinesTotal += nLines;
nTris = atoi(matchNames->getGroup(1).c_str()); matchNames->findNextMatch();
nTrisTotal += nTris;
nQuads = atoi(matchNames->getGroup(1).c_str()); matchNames->findNextMatch();
nQuadsTotal += nQuads;
curFBO = atoi(matchNames->getGroup(1).c_str()); matchNames->findNextMatch();
comment = matchNames->getGroup(1); matchNames->findNextMatch();
// If we have the bottleneck analysis
if(bHasAnalysis)
{
GPU_Bottleneck = matchNames->getGroup(1); matchNames->findNextMatch();
IDX_Bottleneck = atoi(matchNames->getGroup(1).c_str()); matchNames->findNextMatch();
IDX_SOL = atoi(matchNames->getGroup(1).c_str()); matchNames->findNextMatch();
GEOM_Bottleneck = atoi(matchNames->getGroup(1).c_str()); matchNames->findNextMatch();
GEOM_SOL = atoi(matchNames->getGroup(1).c_str()); matchNames->findNextMatch();
SHD_Bottleneck = atoi(matchNames->getGroup(1).c_str()); matchNames->findNextMatch();
SHD_SOL = atoi(matchNames->getGroup(1).c_str()); matchNames->findNextMatch();
FB_Bottleneck = atoi(matchNames->getGroup(1).c_str()); matchNames->findNextMatch();
FB_SOL = atoi(matchNames->getGroup(1).c_str()); matchNames->findNextMatch();
ROP_Bottleneck = atoi(matchNames->getGroup(1).c_str()); matchNames->findNextMatch();
ROP_SOL = atoi(matchNames->getGroup(1).c_str()); matchNames->findNextMatch();
comment += std::string("|Bottleneck: ") + GPU_Bottleneck;
}
for(int i=0; i< (int)keywordTable.size(); i++)
{
if(call_type == keywordTable[i])
{
benchmarkable_call_number = -1;
break;
}
}
if((!fs.eof()) && (benchmarkable_call_number >= 0))// && (frame_time_ms != 0.0f))
{
char eltsStr[100];
eltsStr[0] = '\0';
if(!prim_type.empty() && (prim_type != std::string(" ")))
sprintf_s(eltsStr,100,"(%s, %d)",prim_type.c_str(), nElts);
else if(nElts > 0)
sprintf_s(eltsStr,100,"(%d)",nElts);
call_type += std::string(eltsStr);
if(bCollapse)
benchmarkable_call_number = benchmarkable_call_number_collapsed;
//if(bDiffGraph)
// g_pDisplays[1]->addMeasure(graphDiff, TMeasure(time_difference, draw_call_number, call_type.c_str(),curFBO), benchmarkable_call_number,curFBO);
g_pDisplays[disp]->addMeasure(graphTime, TMeasure(frame_time_ms, benchmarkable_call_number, call_type.c_str(),curFBO), benchmarkable_call_number,(float)curFBO);
g_pDisplays[dispElts]->addMeasure(graphElts, TMeasure((float)nElts, benchmarkable_call_number, call_type.c_str(),curFBO), benchmarkable_call_number);
g_pDisplays[dispElts]->addMeasure(graphGLCalls, TMeasure((float)nGLCalls, benchmarkable_call_number, call_type.c_str(),curFBO), benchmarkable_call_number);
g_pDisplays[dispElts]->addMeasure(graphPoints, TMeasure((float)nPoints, benchmarkable_call_number, call_type.c_str(),curFBO), benchmarkable_call_number);
g_pDisplays[dispElts]->addMeasure(graphLines, TMeasure((float)nLines, benchmarkable_call_number, call_type.c_str(),curFBO), benchmarkable_call_number);
g_pDisplays[dispElts]->addMeasure(graphTris, TMeasure((float)nTris, benchmarkable_call_number, call_type.c_str(),curFBO), benchmarkable_call_number);
g_pDisplays[dispElts]->addMeasure(graphQuads, TMeasure((float)nQuads, benchmarkable_call_number, call_type.c_str(),curFBO), benchmarkable_call_number);
g_pDisplays[dispEltsTotal]->addMeasure(graphEltsTotal, TMeasure((float)nEltsTotal, benchmarkable_call_number, call_type.c_str(),curFBO), benchmarkable_call_number);
g_pDisplays[dispEltsTotal]->addMeasure(graphGLCallsTotal, TMeasure((float)nGLCalls_total, benchmarkable_call_number, call_type.c_str(),curFBO), benchmarkable_call_number);
g_pDisplays[dispEltsTotal]->addMeasure(graphPointsTotal, TMeasure((float)nPointsTotal, benchmarkable_call_number, call_type.c_str(),curFBO), benchmarkable_call_number);
g_pDisplays[dispEltsTotal]->addMeasure(graphLinesTotal, TMeasure((float)nLinesTotal, benchmarkable_call_number, call_type.c_str(),curFBO), benchmarkable_call_number);
g_pDisplays[dispEltsTotal]->addMeasure(graphTrisTotal, TMeasure((float)nTrisTotal, benchmarkable_call_number, call_type.c_str(),curFBO), benchmarkable_call_number);
g_pDisplays[dispEltsTotal]->addMeasure(graphQuadsTotal, TMeasure((float)nQuadsTotal, benchmarkable_call_number, call_type.c_str(),curFBO), benchmarkable_call_number);
int id = firstGraphId - firstGraphIdOffset;
int idRaw = firstGraphRawId - firstGraphRawIdOffset;
if(bHasAnalysis)
{
g_pDisplays[dispSignals]->addMeasure(id++, TMeasure((float)IDX_Bottleneck, benchmarkable_call_number, call_type.c_str(),curFBO), benchmarkable_call_number);
g_pDisplays[dispSignals]->addMeasure(id++, TMeasure((float)IDX_SOL, benchmarkable_call_number, call_type.c_str(),curFBO), benchmarkable_call_number);
g_pDisplays[dispSignals]->addMeasure(id++, TMeasure((float)GEOM_Bottleneck, benchmarkable_call_number, call_type.c_str(),curFBO), benchmarkable_call_number);
g_pDisplays[dispSignals]->addMeasure(id++, TMeasure((float)GEOM_SOL, benchmarkable_call_number, call_type.c_str(),curFBO), benchmarkable_call_number);
g_pDisplays[dispSignals]->addMeasure(id++, TMeasure((float)SHD_Bottleneck, benchmarkable_call_number, call_type.c_str(),curFBO), benchmarkable_call_number);
g_pDisplays[dispSignals]->addMeasure(id++, TMeasure((float)SHD_SOL, benchmarkable_call_number, call_type.c_str(),curFBO), benchmarkable_call_number);
g_pDisplays[dispSignals]->addMeasure(id++, TMeasure((float)FB_Bottleneck, benchmarkable_call_number, call_type.c_str(),curFBO), benchmarkable_call_number);
g_pDisplays[dispSignals]->addMeasure(id++, TMeasure((float)FB_SOL, benchmarkable_call_number, call_type.c_str(),curFBO), benchmarkable_call_number);
g_pDisplays[dispSignals]->addMeasure(id++, TMeasure((float)ROP_Bottleneck, benchmarkable_call_number, call_type.c_str(),curFBO), benchmarkable_call_number);
g_pDisplays[dispSignals]->addMeasure(id++, TMeasure((float)ROP_SOL, benchmarkable_call_number, call_type.c_str(),curFBO), benchmarkable_call_number);
}
// Now take care of other signals that may have been added
if(bHasSignals) do {
float f = (float)atof(matchNames->getGroup(1).c_str());
if(id > ((int)g_pDisplays[dispSignals]->Graphs.size()))
{
if(g_pLog) g_pLog->AddMessage("error>>Error Too many data in the line !");
break;
}
if(idRaw > ((int)g_pDisplays[dispRawSignals]->Graphs.size()))
{
if(g_pLog) g_pLog->AddMessage("error>>Error Too many data in the line !");
break;
}
if(itemIsPercent[(bHasAnalysis?1:0)+NUM_BASE_VALUES+id+idRaw])
g_pDisplays[dispSignals]->addMeasure(id++, TMeasure((float)f, benchmarkable_call_number, call_type.c_str(),curFBO), benchmarkable_call_number);
else
g_pDisplays[dispRawSignals]->addMeasure(idRaw++, TMeasure((float)f, benchmarkable_call_number, call_type.c_str(),curFBO), benchmarkable_call_number);
} while(matchNames->findNextMatch());
char FBONum[10];
FBONum[0] = '\0';
if(prevFBO != curFBO)
{
sprintf_s(FBONum, 10, "FBO=%d", curFBO);
g_pDisplays[disp]->setCommentForMeasure(graphTime, benchmarkable_call_number, FBONum, NULL, RGB(128,160,128));
}
if(!strncmp(call_type.c_str(), "BlitFramebuffer", 15))
{
char blitStr[60];
sprintf_s(blitStr, 60, "%s to FBO #%d", call_type.c_str(), curFBO);
g_pDisplays[disp]->setCommentForMeasure(graphTime, benchmarkable_call_number, blitStr, NULL, RGB(128,160,128));
}
prevFBO = curFBO;
//if(call_type == "Draw")
//{
// g_apiCall.push_back(benchmarkable_call_number);
// //assert(((int)g_apiCall.size()-1) == draw_call_number);
//}
if(!comment.empty())
{
int i;
while((i=(int)comment.find_first_of("|")) >= 0)
{
comment.replace(i, 1,"\n");
}
g_pDisplays[disp]->Graphs[graphTime].Measures[benchmarkable_call_number].tooltipComments = comment;
g_pDisplays[dispElts]->Graphs[graphElts].Measures[benchmarkable_call_number].tooltipComments = comment;
}
benchmarkable_call_number_collapsed++;
}
}
else
{
assert(!"ERROR in parsing the line");
if(g_pLog) g_pLog->AddMessage("error>>Error in parsing a line");
}
if((benchmarkable_call_number % 200)==0)
g_pProgressBar->SetPercent((float)(100*fs.tellg()/bSize));
} while(!fs.eof());
if(g_pLog) g_pLog->AddMessage("yes>>Done");
// Let's do a quick search of possible issues
g_pDisplays[disp]->searchHighlight("WARNING");
g_pDisplays[disp]->searchHighlight("ERROR");
return true;
}