xref: /aosp_15_r20/external/mesa3d/src/gallium/frontends/nine/nine_quirk.c (revision 6104692788411f58d303aa86923a9ff6ecaded22)
1 /*
2  * Copyright 2011 Joakim Sindholt <[email protected]>
3  * SPDX-License-Identifier: MIT
4  */
5 
6 #include "nine_quirk.h"
7 
8 #include "util/u_debug.h"
9 
10 static const struct debug_named_value nine_quirk_table[] = {
11     { "fakecaps", QUIRK_FAKE_CAPS,
12       "Fake caps to emulate D3D specs regardless of hardware caps." },
13     { "lenientshader", QUIRK_LENIENT_SHADER,
14       "Be lenient when translating shaders." },
15     { "all", ~0U,
16       "Enable all quirks." },
17     DEBUG_NAMED_VALUE_END
18 };
19 
20 bool
_nine_get_quirk(unsigned quirk)21 _nine_get_quirk( unsigned quirk )
22 {
23     static bool first = true;
24     static unsigned long flags = 0;
25 
26     if (first) {
27         first = false;
28         flags = debug_get_flags_option("NINE_QUIRKS", nine_quirk_table, 0);
29     }
30 
31     return !!(flags & quirk);
32 }
33