<?xml version="1.0"?>
<driconf>
    <!--
         The android game hall of shame:

         Workarounds for android games that are not aware of open source drivers.
         These can be removed as games have their allowlists updated.
     -->
    <device driver="msm" device="FD618">
        <application name="Call of Duty Mobile" executable="com.activision.callofduty.shooter">
            <option name="force_gl_renderer" value="Adreno (TM) 618"/>
            <option name="force_gl_vendor" value="Qualcomm"/>
        </application>
        <application name="Asphalt 8" executable="com.gameloft.android.ANMP.GloftA8HM">
            <!-- Note: asphalt8's allowlist seems to not have been updated recently
                 enough to be aware of "Adreno (TM) 618", but we seem to otherwise
                 have enough headroom to opt into the higher settings.  (Conversely
                 the allowlist seems to allow G72-MP3 into the higher tier, despite
                 not being able to maintain fps.. possibly it is not properly
                 differentiating between various core MPn configurations.  So I'm
                 going to use that to justify claiming to be a618's *slightly*
                 bigger brother)
             -->
            <option name="force_gl_renderer" value="Adreno (TM) 630"/>
            <option name="force_gl_vendor" value="Qualcomm"/>
        </application>
        <application name="Asphalt 9" executable="com.gameloft.android.ANMP.GloftA9HM">
            <option name="force_gl_renderer" value="Adreno (TM) 618"/>
            <option name="force_gl_vendor" value="Qualcomm"/>
        </application>
        <application name="PUBG Mobile" executable="com.tencent.ig">
            <!-- Note: Maxed out a630 settings still limits max framerate, yet GPU
                 is below 45% utilization (mostly closer to 40%).  If I claim to
                 be a640, that unlocks "Extreme" framerate (and "Ultra HD" graphics).
                 With "Extreme" + "HDR" we are comfortably at 60fps with plenty of
                 headroom.  "Extreme" + "Ultra HD" (max settings for a640) we are
                 starting to approach the limit.  I'll stick with a630 to be
                 conservative, but argueably we could go higher.  (This flagship
                 gaming phone thing is a scam!)
             -->
            <option name="force_gl_renderer" value="Adreno (TM) 630"/>
            <option name="force_gl_vendor" value="Qualcomm"/>
        </application>
    </device>

    <device driver="msm">
        <!--
            ANGLE is catastrophically broken, see:

               https://issues.angleproject.org/u/1/issues/431097618

            This broken codepath is exposed when skia detects vendor
            freedreno (as well as closed mali/img/adreno drivers.. maybe
            the issue will actually get fixed when a new enough skia+
            ANGLE hits the closed drivers on android).

            Workaround the issue by spoofing the vendor string so
            skia doesn't pick the broken ANGLE codepath.  Other
            electron apps will have the same problem, and should be
            listed here as well.
         -->
        <application name="Chromium" executable="chromium">
            <option name="force_gl_vendor" value="angleisbroken"/>
        </application>
        <application name="Chromium" executable="chromium-browser">
            <option name="force_gl_vendor" value="angleisbroken"/>
        </application>
        <application name="Chromium" executable="chrome">
            <option name="force_gl_vendor" value="angleisbroken"/>
        </application>
        <application name="VS Code" executable="code">
            <option name="force_gl_vendor" value="angleisbroken"/>
        </application>
        <application name="element-desktop" executable="element-desktop">
            <option name="force_gl_vendor" value="angleisbroken"/>
        </application>
        <application name="vivaldi-bin" executable="vivaldi-bin">
            <option name="force_gl_vendor" value="angleisbroken"/>
        </application>
        <application name="code" executable="vivaldi-bin">
            <option name="force_gl_vendor" value="angleisbroken"/>
        </application>
        <!--
            Xwayland mixes implicit and explicit sync, depending on the
            client app.  This trips up the heuristic that switches to
            explicit sync once it sees that the "app" is using explicit
            sync, causing flickering for implicit sync clients
         -->
        <application name="Xwayland" executable="Xwayland">
            <option name="disable_explicit_sync_heuristic" value="true"/>
        </application>
    </device>
</driconf>
