df8bad3202372233e778ddaf88e94a515077a869
[mesa.git] / src / gallium / drivers / swr / rasterizer / core / rdtsc_core.cpp
1 /****************************************************************************
2 * Copyright (C) 2014-2015 Intel Corporation. All Rights Reserved.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21 * IN THE SOFTWARE.
22 ****************************************************************************/
23
24 #include "rdtsc_core.h"
25 #include "common/rdtsc_buckets.h"
26
27 // must match CORE_BUCKETS enum order
28 BUCKET_DESC gCoreBuckets[] = {
29 { "APIClearRenderTarget", "", true, 0xff0b8bea },
30 { "APIDraw", "", true, 0xff000066 },
31 { "APIDrawWakeAllThreads", "", false, 0xffffffff },
32 { "APIDrawIndexed", "", true, 0xff000066 },
33 { "APIDispatch", "", true, 0xff660000 },
34 { "APIStoreTiles", "", true, 0xff00ffff },
35 { "APIGetDrawContext", "", false, 0xffffffff },
36 { "APISync", "", true, 0xff6666ff },
37 { "APIWaitForIdle", "", true, 0xff0000ff },
38 { "FEProcessDraw", "", true, 0xff009900 },
39 { "FEProcessDrawIndexed", "", true, 0xff009900 },
40 { "FEFetchShader", "", false, 0xffffffff },
41 { "FEVertexShader", "", false, 0xffffffff },
42 { "FEHullShader", "", false, 0xffffffff },
43 { "FETessellation", "", false, 0xffffffff },
44 { "FEDomainShader", "", false, 0xffffffff },
45 { "FEGeometryShader", "", false, 0xffffffff },
46 { "FEStreamout", "", false, 0xffffffff },
47 { "FEPAAssemble", "", false, 0xffffffff },
48 { "FEBinPoints", "", false, 0xff29b854 },
49 { "FEBinLines", "", false, 0xff29b854 },
50 { "FEBinTriangles", "", false, 0xff29b854 },
51 { "FETriangleSetup", "", false, 0xffffffff },
52 { "FEViewportCull", "", false, 0xffffffff },
53 { "FEGuardbandClip", "", false, 0xffffffff },
54 { "FEClipPoints", "", false, 0xffffffff },
55 { "FEClipLines", "", false, 0xffffffff },
56 { "FEClipTriangles", "", false, 0xffffffff },
57 { "FECullZeroAreaAndBackface", "", false, 0xffffffff },
58 { "FECullBetweenCenters", "", false, 0xffffffff },
59 { "FEProcessStoreTiles", "", true, 0xff39c864 },
60 { "FEProcessInvalidateTiles", "", true, 0xffffffff },
61 { "WorkerWorkOnFifoBE", "", false, 0xff40261c },
62 { "WorkerFoundWork", "", false, 0xff573326 },
63 { "BELoadTiles", "", true, 0xffb0e2ff },
64 { "BEDispatch", "", true, 0xff00a2ff },
65 { "BEClear", "", true, 0xff00ccbb },
66 { "BERasterizeLine", "", true, 0xffb26a4e },
67 { "BERasterizeTriangle", "", true, 0xffb26a4e },
68 { "BETriangleSetup", "", false, 0xffffffff },
69 { "BEStepSetup", "", false, 0xffffffff },
70 { "BECullZeroArea", "", false, 0xffffffff },
71 { "BEEmptyTriangle", "", false, 0xffffffff },
72 { "BETrivialAccept", "", false, 0xffffffff },
73 { "BETrivialReject", "", false, 0xffffffff },
74 { "BERasterizePartial", "", false, 0xffffffff },
75 { "BEPixelBackend", "", false, 0xffffffff },
76 { "BESetup", "", false, 0xffffffff },
77 { "BEBarycentric", "", false, 0xffffffff },
78 { "BEEarlyDepthTest", "", false, 0xffffffff },
79 { "BEPixelShader", "", false, 0xffffffff },
80 { "BESingleSampleBackend", "", false, 0xffffffff },
81 { "BEPixelRateBackend", "", false, 0xffffffff },
82 { "BESampleRateBackend", "", false, 0xffffffff },
83 { "BENullBackend", "", false, 0xffffffff },
84 { "BELateDepthTest", "", false, 0xffffffff },
85 { "BEOutputMerger", "", false, 0xffffffff },
86 { "BEStoreTiles", "", true, 0xff00cccc },
87 { "BEEndTile", "", false, 0xffffffff },
88 { "WorkerWaitForThreadEvent", "", false, 0xffffffff },
89 };
90
91 /// @todo bucketmanager and mapping should probably be a part of the SWR context
92 std::vector<uint32_t> gBucketMap;
93 BucketManager gBucketMgr(KNOB_BUCKETS_ENABLE_THREADVIZ);
94
95 uint32_t gCurrentFrame = 0;