1Runtime Configuration 2========================= 3 4SwiftShader provides a simple configuration mechanism based on a configuration file to control a variety of runtime options without needing to re-compile from source. 5 6Configuration file 7------------ 8 9SwiftShader looks for a file named `SwiftShader.ini` (case-sensitive) in the working directory. At startup, SwiftShader reads this file, if it exists, and sets the options specified in it. 10 11The configuration file syntax is a series of key-value pairs, divided into sections. The following example shows three key-value pairs in two sections (`ThreadCount` and `AffinityMask` in the `[Processor]` section, and `EnableSpirvProfiling` in the `[Profiler]` section): 12``` 13[Processor] 14ThreadCount=4 15AffinityMask=0xf 16 17# Comment 18[Profiler] 19EnableSpirvProfiling=true 20``` 21 22The syntax rules are as follows: 23* Sections are defined via a name in brackets, e.g. `[Processor]`. 24* Key-value pairs are in the format `Key=Value`. 25* Keys are always strings, while values can be strings, booleans or integers depending on the semantics of the option: 26 * For integer options, both decimal and hexademical values are supported. 27 * For boolean options, both decimal (`1` and `0`) and alphabetical (`true` and `false`) values are supported. 28* Comments are supported through the use of the `#` character at the beginning of a line. 29 30Options 31------------ 32 33Refer to the [SwiftConfig.hpp](../src/System/SwiftConfig.hpp) header for an up-to-date overview of available options. 34 35