swr/rast: Support USE_SIMD16_FRONTEND=0 for EarlyRast
[mesa.git] / src / gallium / drivers / swr / rasterizer / codegen / knob_defs.py
1 # Copyright (C) 2014-2016 Intel Corporation. All Rights Reserved.
2 #
3 # Permission is hereby granted, free of charge, to any person obtaining a
4 # copy of this software and associated documentation files (the "Software"),
5 # to deal in the Software without restriction, including without limitation
6 # the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 # and/or sell copies of the Software, and to permit persons to whom the
8 # Software is furnished to do so, subject to the following conditions:
9 #
10 # The above copyright notice and this permission notice (including the next
11 # paragraph) shall be included in all copies or substantial portions of the
12 # Software.
13 #
14 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
20 # IN THE SOFTWARE.
21 import sys
22
23 # Python source
24 KNOBS = [
25
26 ['ENABLE_ASSERT_DIALOGS', {
27 'type' : 'bool',
28 'default' : 'true',
29 'desc' : ['Use dialogs when asserts fire.',
30 'Asserts are only enabled in debug builds'],
31 'category' : 'debug',
32 }],
33
34 ['SINGLE_THREADED', {
35 'type' : 'bool',
36 'default' : 'false',
37 'desc' : ['If enabled will perform all rendering on the API thread.',
38 'This is useful mainly for debugging purposes.'],
39 'category' : 'debug',
40 }],
41
42 ['DUMP_SHADER_IR', {
43 'type' : 'bool',
44 'default' : 'false',
45 'desc' : ['Dumps shader LLVM IR at various stages of jit compilation.'],
46 'category' : 'debug',
47 }],
48
49 ['USE_GENERIC_STORETILE', {
50 'type' : 'bool',
51 'default' : 'false',
52 'desc' : ['Always use generic function for performing StoreTile.',
53 'Will be slightly slower than using optimized (jitted) path'],
54 'category' : 'debug',
55 }],
56
57 ['FAST_CLEAR', {
58 'type' : 'bool',
59 'default' : 'true',
60 'desc' : ['Replace 3D primitive execute with a SWRClearRT operation and',
61 'defer clear execution to first backend op on hottile, or hottile store'],
62 'category' : 'perf',
63 }],
64
65 ['BASE_NUMA_NODE', {
66 'type' : 'uint32_t',
67 'default' : '0',
68 'desc' : ['Starting NUMA node index to use when allocating compute resources.',
69 'Setting this to a non-zero value will reduce the maximum # of NUMA nodes used.'],
70 'category' : 'perf',
71 'advanced' : True,
72 }],
73
74 ['MAX_NUMA_NODES', {
75 'type' : 'uint32_t',
76 'default' : '1' if sys.platform == 'win32' else '0',
77 'desc' : ['Maximum # of NUMA-nodes per system used for worker threads',
78 ' 0 == ALL NUMA-nodes in the system',
79 ' N == Use at most N NUMA-nodes for rendering'],
80 'category' : 'perf',
81 }],
82
83 ['BASE_CORE', {
84 'type' : 'uint32_t',
85 'default' : '0',
86 'desc' : ['Starting core index to use when allocating compute resources.',
87 'Setting this to a non-zero value will reduce the maximum # of cores used.'],
88 'category' : 'perf',
89 'advanced' : True,
90 }],
91
92 ['MAX_CORES_PER_NUMA_NODE', {
93 'type' : 'uint32_t',
94 'default' : '0',
95 'desc' : ['Maximum # of cores per NUMA-node used for worker threads.',
96 ' 0 == ALL non-API thread cores per NUMA-node',
97 ' N == Use at most N cores per NUMA-node'],
98 'category' : 'perf',
99 }],
100
101 ['BASE_THREAD', {
102 'type' : 'uint32_t',
103 'default' : '0',
104 'desc' : ['Starting thread index to use when allocating compute resources.',
105 'Setting this to a non-zero value will reduce the maximum # of threads used.'],
106 'category' : 'perf',
107 'advanced' : True,
108 }],
109
110 ['MAX_THREADS_PER_CORE', {
111 'type' : 'uint32_t',
112 'default' : '1',
113 'desc' : ['Maximum # of (hyper)threads per physical core used for worker threads.',
114 ' 0 == ALL hyper-threads per core',
115 ' N == Use at most N hyper-threads per physical core'],
116 'category' : 'perf',
117 }],
118
119 ['MAX_WORKER_THREADS', {
120 'type' : 'uint32_t',
121 'default' : '0',
122 'desc' : ['Maximum worker threads to spawn.',
123 '',
124 'IMPORTANT: If this is non-zero, no worker threads will be bound to',
125 'specific HW threads. They will all be "floating" SW threads.',
126 'In this case, the above 3 KNOBS will be ignored.'],
127 'category' : 'perf',
128 }],
129
130 ['BUCKETS_START_FRAME', {
131 'type' : 'uint32_t',
132 'default' : '1200',
133 'desc' : ['Frame from when to start saving buckets data.',
134 '',
135 'NOTE: KNOB_ENABLE_RDTSC must be enabled in core/knobs.h',
136 'for this to have an effect.'],
137 'category' : 'perf',
138 }],
139
140 ['BUCKETS_END_FRAME', {
141 'type' : 'uint32_t',
142 'default' : '1400',
143 'desc' : ['Frame at which to stop saving buckets data.',
144 '',
145 'NOTE: KNOB_ENABLE_RDTSC must be enabled in core/knobs.h',
146 'for this to have an effect.'],
147 'category' : 'perf',
148 }],
149
150 ['WORKER_SPIN_LOOP_COUNT', {
151 'type' : 'uint32_t',
152 'default' : '5000',
153 'desc' : ['Number of spin-loop iterations worker threads will perform',
154 'before going to sleep when waiting for work'],
155 'category' : 'perf',
156 }],
157
158 ['MAX_DRAWS_IN_FLIGHT', {
159 'type' : 'uint32_t',
160 'default' : '256',
161 'desc' : ['Maximum number of draws outstanding before API thread blocks.',
162 'This value MUST be evenly divisible into 2^32'],
163 'category' : 'perf',
164 }],
165
166 ['MAX_PRIMS_PER_DRAW', {
167 'type' : 'uint32_t',
168 'default' : '49152',
169 'desc' : ['Maximum primitives in a single Draw().',
170 'Larger primitives are split into smaller Draw calls.',
171 'Should be a multiple of (3 * vectorWidth).'],
172 'category' : 'perf',
173 }],
174
175 ['MAX_TESS_PRIMS_PER_DRAW', {
176 'type' : 'uint32_t',
177 'default' : '16',
178 'desc' : ['Maximum primitives in a single Draw() with tessellation enabled.',
179 'Larger primitives are split into smaller Draw calls.',
180 'Should be a multiple of (vectorWidth).'],
181 'category' : 'perf',
182 }],
183
184
185 ['DEBUG_OUTPUT_DIR', {
186 'type' : 'std::string',
187 'default' : r'%TEMP%\Rast\DebugOutput' if sys.platform == 'win32' else '/tmp/Rast/DebugOutput',
188 'desc' : ['Output directory for debug data.'],
189 'category' : 'debug',
190 }],
191
192 ['JIT_ENABLE_CACHE', {
193 'type' : 'bool',
194 'default' : 'false',
195 'desc' : ['Enables caching of compiled shaders'],
196 'category' : 'debug',
197 }],
198
199 ['JIT_CACHE_DIR', {
200 'type' : 'std::string',
201 'default' : r'%TEMP%\SWR\JitCache' if sys.platform == 'win32' else '${HOME}/.swr/jitcache',
202 'desc' : ['Cache directory for compiled shaders.'],
203 'category' : 'debug',
204 }],
205
206 ['TOSS_DRAW', {
207 'type' : 'bool',
208 'default' : 'false',
209 'desc' : ['Disable per-draw/dispatch execution'],
210 'category' : 'perf',
211 }],
212
213 ['TOSS_QUEUE_FE', {
214 'type' : 'bool',
215 'default' : 'false',
216 'desc' : ['Stop per-draw execution at worker FE',
217 '',
218 'NOTE: Requires KNOB_ENABLE_TOSS_POINTS to be enabled in core/knobs.h'],
219 'category' : 'perf',
220 'advanced' : 'true',
221 }],
222
223 ['TOSS_FETCH', {
224 'type' : 'bool',
225 'default' : 'false',
226 'desc' : ['Stop per-draw execution at vertex fetch',
227 '',
228 'NOTE: Requires KNOB_ENABLE_TOSS_POINTS to be enabled in core/knobs.h'],
229 'category' : 'perf',
230 'advanced' : 'true',
231 }],
232
233 ['TOSS_IA', {
234 'type' : 'bool',
235 'default' : 'false',
236 'desc' : ['Stop per-draw execution at input assembler',
237 '',
238 'NOTE: Requires KNOB_ENABLE_TOSS_POINTS to be enabled in core/knobs.h'],
239 'category' : 'perf',
240 'advanced' : 'true',
241 }],
242
243 ['TOSS_VS', {
244 'type' : 'bool',
245 'default' : 'false',
246 'desc' : ['Stop per-draw execution at vertex shader',
247 '',
248 'NOTE: Requires KNOB_ENABLE_TOSS_POINTS to be enabled in core/knobs.h'],
249 'category' : 'perf',
250 'advanced' : 'true',
251 }],
252
253 ['TOSS_SETUP_TRIS', {
254 'type' : 'bool',
255 'default' : 'false',
256 'desc' : ['Stop per-draw execution at primitive setup',
257 '',
258 'NOTE: Requires KNOB_ENABLE_TOSS_POINTS to be enabled in core/knobs.h'],
259 'category' : 'perf',
260 'advanced' : 'true',
261 }],
262
263 ['TOSS_BIN_TRIS', {
264 'type' : 'bool',
265 'default' : 'false',
266 'desc' : ['Stop per-draw execution at primitive binning',
267 '',
268 'NOTE: Requires KNOB_ENABLE_TOSS_POINTS to be enabled in core/knobs.h'],
269 'category' : 'perf',
270 'advanced' : 'true',
271 }],
272
273 ['TOSS_RS', {
274 'type' : 'bool',
275 'default' : 'false',
276 'desc' : ['Stop per-draw execution at rasterizer',
277 '',
278 'NOTE: Requires KNOB_ENABLE_TOSS_POINTS to be enabled in core/knobs.h'],
279 'category' : 'perf',
280 'advanced' : 'true',
281 }],
282
283 ]