SwiftShader provides a simple configuration mechanism based on a configuration file to control a variety of runtime options without needing to re-compile from source.
SwiftShader 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.
The 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 AsmEmitDir
in the [Debug]
section):
[Processor] ThreadCount=4 AffinityMask=0xf # Comment [Debug] AsmEmitDir=/home/user/asm_dumps
The syntax rules are as follows:
[Processor]
.Key=Value
.1
and 0
) and alphabetical (true
and false
) values are supported.#
character at the beginning of a line.Refer to the SwiftConfig.hpp header for an up-to-date overview of available options.