blob: 5083a8a0a3ca83fe9369aefb9bd8617302487617 [file] [log] [blame] [view]
Daniele Vettorelda0c7ac2022-04-04 17:04:27 +00001Runtime 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
Nicolas Capens79d4c6c2022-04-22 17:20:26 -040011The 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):
Daniele Vettorelda0c7ac2022-04-04 17:04:27 +000012```
13[Processor]
14ThreadCount=4
15AffinityMask=0xf
16
17# Comment
Nicolas Capens79d4c6c2022-04-22 17:20:26 -040018[Profiler]
19EnableSpirvProfiling=true
Daniele Vettorelda0c7ac2022-04-04 17:04:27 +000020```
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