<!--
These are the strategies used for auto-detect.

Variables used for the tests include:
* hal: 0 if running in software, 1 if running hardware
* pixelversion/vertexversion: shader versions supported by the driver.
* videomem: dedicated video memory.  -1 if not able to detect.
* vendorid: the id number of the video card vendor.
* deviceid: the id number of the video card.
* weid3d: the 'gaming' subscore of the machine's Windows Experience Index, times 10.  NaN if unavailable.
* weidwm: the 'graphics' subscore of the machine's Windows Experience Index, times 10.  NaN if unavailable.
* winsatalpha: the 'GamingMetrics/AlphaFps' value in the WinSAT XML file.  NaN if unavailable.
* winsatalu: the 'GamingMetrics/ALUFps' value in the WinSAT XML file.  NaN if unavailable.
* winsattex: the 'GamingMetrics/TexFps' value in the WinSAT XML file.  NaN if unavailable.
* winsatdwm: the 'GraphicsMetrics/DWMFps' value in the WinSAT XML file.  NaN if unavailable.
* winsatvideomembandwidth: the Graphics/VideoMemBandwidth' value in the WinSAT XML file.  NaN if unavailable.

The settings can be:
detailmin: the lowest detail setting to use on this computer.
detailmax: the highest detail setting to use on this computer.
detail: the exact detail setting to use on this computer. Equivalent to using the same value for detailmin and detailmax.
mpmin: the lowest number of megapixels to use as a basis for guessing the best resolution.
mpmax: the highest number of megapixels to use as a basis for guessing the best resolution.
mp: the exact number of megapixels to use as a basis for guessing the best resolution. Equivalent to using the same value for mpmin and mpmax.

If mp* may be 'desktop', if the machine can handle any resolution.

The autodetect algorithm steps through each strategy keeping track of the minimum and
maximum allowable settings.  When in conflict, the earlier strategy is favoured.
At the end, the maximum allowable setting is used.
-->
<autodetect>
	<!-- If running in software mode, turn the settings all the way down. -->
	<strategy test="hal == 0">
		<detail>lowest</detail>
		<mp>800</mp>
	</strategy>

	<!-- If the shader versions are < 3, we're probably running an old card. -->
	<strategy test="pixelversion < 3 || vertexversion < 3">
		<detailmax>medium</detailmax>
		<mpmax>1300</mpmax>
	</strategy>

	<include file="presets/nVidia.xml"/>
	<include file="presets/ATI.xml"/>

	<!-- Some educated guesses based on the ALU score in WinSAT -->
	<strategy test="winsatalu <= 40">
		<detail>lowest</detail>
		<mp>800</mp>
	</strategy>
	<strategy test="winsatalu <= 100">
		<detail>low</detail>
		<mp>1300</mp>
	</strategy>
	<strategy test="winsatalu <= 300">
		<detail>medium</detail>
		<mp>1800</mp>
	</strategy>
	<strategy test="winsatalu > 300">
		<detail>high</detail>
		<mp>desktop</mp>
	</strategy>

	<!-- If the mem test returns -1, then we can't use any libraries to test for video memory,
	which probably means we're running a version of Windows older than XP. -->
	<strategy test="videomem == -1">
		<detail>lowest</detail>
		<mp>800</mp>
	</strategy>

	<!-- If the mem test returns 0, then it's probably all shared memory. -->
	<strategy test="videomem == 0">
		<detail>medium</detail>
		<mp>1000</mp>
	</strategy>

	<!-- These are fairly conservative guesses based on memory.  Hopefully we already made a better guess with WinSAT scores or a specific profile. -->
	<strategy test="videomem <= 128">
		<detail>lowest</detail>
		<mp>800</mp>
	</strategy>
	<strategy test="videomem <= 256">
		<detail>low</detail>
		<mp>1300</mp>
	</strategy>
	<strategy test="videomem <= 512">
		<detail>medium</detail>
		<mp>1800</mp>
	</strategy>
	<strategy test="videomem > 512">
		<detail>high</detail>
		<mp>desktop</mp>
	</strategy>
</autodetect>
