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 EnableSpirvProfiling
in the [Profiler]
section):
[Processor] ThreadCount=4 AffinityMask=0xf # Comment [Profiler] EnableSpirvProfiling=true
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.