Path: blob/21.2-virgl/src/gallium/drivers/swr/rasterizer/codegen/knob_defs.py
4574 views
# Copyright (C) 2014-2018 Intel Corporation. All Rights Reserved.1#2# Permission is hereby granted, free of charge, to any person obtaining a3# copy of this software and associated documentation files (the "Software"),4# to deal in the Software without restriction, including without limitation5# the rights to use, copy, modify, merge, publish, distribute, sublicense,6# and/or sell copies of the Software, and to permit persons to whom the7# Software is furnished to do so, subject to the following conditions:8#9# The above copyright notice and this permission notice (including the next10# paragraph) shall be included in all copies or substantial portions of the11# Software.12#13# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR14# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,15# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL16# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER17# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING18# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS19# IN THE SOFTWARE.20import sys2122# Python source23KNOBS = [2425['ENABLE_ASSERT_DIALOGS', {26'type' : 'bool',27'default' : 'true',28'desc' : ['Use dialogs when asserts fire.',29'Asserts are only enabled in debug builds'],30'category' : 'debug',31}],3233['SINGLE_THREADED', {34'type' : 'bool',35'default' : 'false',36'desc' : ['If enabled will perform all rendering on the API thread.',37'This is useful mainly for debugging purposes.'],38'category' : 'debug',39}],4041['DUMP_SHADER_IR', {42'type' : 'bool',43'default' : 'false',44'desc' : ['Dumps shader LLVM IR at various stages of jit compilation.'],45'category' : 'debug',46}],4748['USE_GENERIC_STORETILE', {49'type' : 'bool',50'default' : 'false',51'desc' : ['Always use generic function for performing StoreTile.',52'Will be slightly slower than using optimized (jitted) path'],53'category' : 'debug_adv',54}],5556['FAST_CLEAR', {57'type' : 'bool',58'default' : 'true',59'desc' : ['Replace 3D primitive execute with a SWRClearRT operation and',60'defer clear execution to first backend op on hottile, or hottile store'],61'category' : 'perf_adv',62}],6364['MAX_NUMA_NODES', {65'type' : 'uint32_t',66'default' : '1' if sys.platform == 'win32' else '0',67'desc' : ['Maximum # of NUMA-nodes per system used for worker threads',68' 0 == ALL NUMA-nodes in the system',69' N == Use at most N NUMA-nodes for rendering'],70'category' : 'perf',71}],7273['MAX_CORES_PER_NUMA_NODE', {74'type' : 'uint32_t',75'default' : '0',76'desc' : ['Maximum # of cores per NUMA-node used for worker threads.',77' 0 == ALL non-API thread cores per NUMA-node',78' N == Use at most N cores per NUMA-node'],79'category' : 'perf',80}],8182['MAX_THREADS_PER_CORE', {83'type' : 'uint32_t',84'default' : '1',85'desc' : ['Maximum # of (hyper)threads per physical core used for worker threads.',86' 0 == ALL hyper-threads per core',87' N == Use at most N hyper-threads per physical core'],88'category' : 'perf',89}],9091['MAX_WORKER_THREADS', {92'type' : 'uint32_t',93'default' : '0',94'desc' : ['Maximum worker threads to spawn.',95'',96'IMPORTANT: If this is non-zero, no worker threads will be bound to',97'specific HW threads. They will all be "floating" SW threads.',98'In this case, the above 3 KNOBS will be ignored.'],99'category' : 'perf',100}],101102['BASE_NUMA_NODE', {103'type' : 'uint32_t',104'default' : '0',105'desc' : ['Starting NUMA node index to use when allocating compute resources.',106'Setting this to a non-zero value will reduce the maximum # of NUMA nodes used.'],107'category' : 'perf',108}],109110['BASE_CORE', {111'type' : 'uint32_t',112'default' : '0',113'desc' : ['Starting core index to use when allocating compute resources.',114'Setting this to a non-zero value will reduce the maximum # of cores used.'],115'category' : 'perf',116}],117118['BASE_THREAD', {119'type' : 'uint32_t',120'default' : '0',121'desc' : ['Starting thread index to use when allocating compute resources.',122'Setting this to a non-zero value will reduce the maximum # of threads used.'],123'category' : 'perf',124}],125126['BUCKETS_START_FRAME', {127'type' : 'uint32_t',128'default' : '1200',129'desc' : ['Frame from when to start saving buckets data.',130'',131'NOTE: KNOB_ENABLE_RDTSC must be enabled in core/knobs.h',132'for this to have an effect.'],133'category' : 'perf_adv',134}],135136['BUCKETS_END_FRAME', {137'type' : 'uint32_t',138'default' : '1400',139'desc' : ['Frame at which to stop saving buckets data.',140'',141'NOTE: KNOB_ENABLE_RDTSC must be enabled in core/knobs.h',142'for this to have an effect.'],143'category' : 'perf_adv',144}],145146['WORKER_SPIN_LOOP_COUNT', {147'type' : 'uint32_t',148'default' : '5000',149'desc' : ['Number of spin-loop iterations worker threads will perform',150'before going to sleep when waiting for work'],151'category' : 'perf_adv',152}],153154['MAX_DRAWS_IN_FLIGHT', {155'type' : 'uint32_t',156'default' : '256',157'desc' : ['Maximum number of draws outstanding before API thread blocks.',158'This value MUST be evenly divisible into 2^32'],159'category' : 'perf_adv',160}],161162['MAX_PRIMS_PER_DRAW', {163'type' : 'uint32_t',164'default' : '49152',165'desc' : ['Maximum primitives in a single Draw().',166'Larger primitives are split into smaller Draw calls.',167'Should be a multiple of (3 * vectorWidth).'],168'category' : 'perf_adv',169}],170171['MAX_TESS_PRIMS_PER_DRAW', {172'type' : 'uint32_t',173'default' : '16',174'desc' : ['Maximum primitives in a single Draw() with tessellation enabled.',175'Larger primitives are split into smaller Draw calls.',176'Should be a multiple of (vectorWidth).'],177'category' : 'perf_adv',178}],179180181['DEBUG_OUTPUT_DIR', {182'type' : 'std::string',183'default' : r'%TEMP%\Rast\DebugOutput' if sys.platform == 'win32' else '/tmp/Rast/DebugOutput',184'desc' : ['Output directory for debug data.'],185'category' : 'debug',186}],187188['JIT_ENABLE_CACHE', {189'type' : 'bool',190'default' : 'false',191'desc' : ['Enables caching of compiled shaders'],192'category' : 'debug_adv',193}],194195['JIT_OPTIMIZATION_LEVEL', {196'type' : 'int',197'default' : '-1',198'desc' : ['JIT compile optimization level:',],199'category' : 'debug',200'control' : 'dropdown',201'choices' : [202{203'name' : 'Automatic',204'desc' : 'Automatic based on other KNOB and build settings',205'value' : -1,206},207{208'name' : 'Debug',209'desc' : 'No optimization: -O0',210'value' : 0,211},212{213'name' : 'Less',214'desc' : 'Some optimization: -O1',215'value' : 1,216},217{218'name' : 'Optimize',219'desc' : 'Default Clang / LLVM optimizations: -O2',220'value' : 2,221},222{223'name' : 'Aggressive',224'desc' : 'Maximum optimization: -O3',225'value' : 3,226},227],228}],229230['JIT_CACHE_DIR', {231'type' : 'std::string',232'default' : r'%TEMP%\SWR\JitCache' if sys.platform == 'win32' else '${HOME}/.swr/jitcache',233'desc' : ['Cache directory for compiled shaders.'],234'category' : 'debug',235}],236237['TOSS_DRAW', {238'type' : 'bool',239'default' : 'false',240'desc' : ['Disable per-draw/dispatch execution'],241'category' : 'perf',242}],243244['TOSS_QUEUE_FE', {245'type' : 'bool',246'default' : 'false',247'desc' : ['Stop per-draw execution at worker FE',248'',249'NOTE: Requires KNOB_ENABLE_TOSS_POINTS to be enabled in core/knobs.h'],250'category' : 'perf_adv',251}],252253['TOSS_FETCH', {254'type' : 'bool',255'default' : 'false',256'desc' : ['Stop per-draw execution at vertex fetch',257'',258'NOTE: Requires KNOB_ENABLE_TOSS_POINTS to be enabled in core/knobs.h'],259'category' : 'perf_adv',260}],261262['TOSS_IA', {263'type' : 'bool',264'default' : 'false',265'desc' : ['Stop per-draw execution at input assembler',266'',267'NOTE: Requires KNOB_ENABLE_TOSS_POINTS to be enabled in core/knobs.h'],268'category' : 'perf_adv',269}],270271['TOSS_VS', {272'type' : 'bool',273'default' : 'false',274'desc' : ['Stop per-draw execution at vertex shader',275'',276'NOTE: Requires KNOB_ENABLE_TOSS_POINTS to be enabled in core/knobs.h'],277'category' : 'perf_adv',278}],279280['TOSS_SETUP_TRIS', {281'type' : 'bool',282'default' : 'false',283'desc' : ['Stop per-draw execution at primitive setup',284'',285'NOTE: Requires KNOB_ENABLE_TOSS_POINTS to be enabled in core/knobs.h'],286'category' : 'perf_adv',287}],288289['TOSS_BIN_TRIS', {290'type' : 'bool',291'default' : 'false',292'desc' : ['Stop per-draw execution at primitive binning',293'',294'NOTE: Requires KNOB_ENABLE_TOSS_POINTS to be enabled in core/knobs.h'],295'category' : 'perf_adv',296}],297298['TOSS_RS', {299'type' : 'bool',300'default' : 'false',301'desc' : ['Stop per-draw execution at rasterizer',302'',303'NOTE: Requires KNOB_ENABLE_TOSS_POINTS to be enabled in core/knobs.h'],304'category' : 'perf_adv',305}],306307['DISABLE_SPLIT_DRAW', {308'type' : 'bool',309'default' : 'false',310'desc' : ['Don\'t split large draws into smaller draws.,',311'MAX_PRIMS_PER_DRAW and MAX_TESS_PRIMS_PER_DRAW can be used to control split size.',312'',313'Useful to disable split draws for gathering archrast stats.'],314'category' : 'perf_adv',315}],316317['AR_ENABLE_PIPELINE_STATS', {318'type' : 'bool',319'default' : 'true',320'desc' : ['Enable pipeline stats when using Archrast'],321'category' : 'archrast',322}],323324['AR_ENABLE_SHADER_STATS', {325'type' : 'bool',326'default' : 'true',327'desc' : ['Enable shader stats when using Archrast'],328'category' : 'archrast',329}],330331['AR_ENABLE_SWTAG_DATA', {332'type' : 'bool',333'default' : 'false',334'desc' : ['Enable SWTag data when using Archrast'],335'category' : 'archrast',336}],337338['AR_ENABLE_SWR_EVENTS', {339'type' : 'bool',340'default' : 'true',341'desc' : ['Enable internal SWR events when using Archrast'],342'category' : 'archrast',343}],344345['AR_ENABLE_PIPELINE_EVENTS', {346'type' : 'bool',347'default' : 'true',348'desc' : ['Enable pipeline events when using Archrast'],349'category' : 'archrast',350}],351352['AR_ENABLE_SHADER_EVENTS', {353'type' : 'bool',354'default' : 'true',355'desc' : ['Enable shader events when using Archrast'],356'category' : 'archrast',357}],358359['AR_ENABLE_SWTAG_EVENTS', {360'type' : 'bool',361'default' : 'false',362'desc' : ['Enable SWTag events when using Archrast'],363'category' : 'archrast',364}],365366['AR_ENABLE_MEMORY_EVENTS', {367'type' : 'bool',368'default' : 'false',369'desc' : ['Enable memory events when using Archrast'],370'category' : 'archrast',371}],372373['AR_MEM_SET_BYTE_GRANULARITY', {374'type' : 'uint32_t',375'default' : '64',376'desc' : ['Granularity and alignment of tracking of memory accesses',377'ONLY ACTIVE UNDER ArchRast.'],378'category' : 'archrast',379}],380381382]383384385