glx-multithread-texture: Avoid front-buffer rendering.
[piglit.git] / tests / util / piglit-dispatch-gen.c.mako
blob21c8384a1670dff5e5c48d6762f04b0c64ce51ac
1 /**
2  * ${warning}
3  *
4  * Copyright 2014 Intel Corporation
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a
7  * copy of this software and associated documentation files (the "Software"),
8  * to deal in the Software without restriction, including without limitation
9  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  * and/or sell copies of the Software, and to permit persons to whom the
11  * Software is furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice (including the next
14  * paragraph) shall be included in all copies or substantial portions of the
15  * Software.
16  *
17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
20  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
23  * IN THE SOFTWARE.
24  */
26 <%block filter='fake_whitespace'>\
27 % for alias_set in gl_registry.command_alias_map:
28 <% f0 = alias_set.primary_command %>\
29 static void*
30 resolve_${f0.name}(void)
32 % for req in alias_set.requirements:
33 >-------/* ${req.command.name} (${req.provider.name}) */
34 <% apis = sorted(set(dispatch.APIS[x] for x in req.apis if x in dispatch.APIS)) %>
35 % for api in apis:
36 % if loop.first:
37 >-------if (
38 % if req.has_extension:
39 ............(
40 % endif
41 % endif
42 % if len(apis) > 1:
43 ............(
44 % endif
45 .............dispatch_api == ${api.c_piglit_token}
46 % if req.has_feature and req.feature.version_int > api.base_version_int:
47 ................................................... && check_version(${req.feature.version_int})
48 % endif
49 % if len(apis) > 1:
50 ................................................................................................)
51 % endif
52 % if not loop.last:
53 ................................................................................................. || .
54 % endif
55 % endfor
56 % if apis:
57 % if req.has_extension:
58 ....................................................................................................)
59 >-------    && check_extension("${req.extension.name}")
60 % endif
61 ...............................................................) {
62 % if req.has_feature:
63 >------->-------return get_core_proc("${req.command.name}", ${api.base_version_int});
64 % elif req.has_extension:
65 >------->-------return get_ext_proc("${req.command.name}");
66 % endif
67 >-------}
68 % endif
70 % endfor
71 >-------unsupported("${f0.name}");
72 >-------return piglit_dispatch_${f0.name};
75 static ${f0.c_return_type} APIENTRY
76 stub_${f0.name}(${f0.c_named_param_list})
78 >-------check_initialized();
79 >-------piglit_dispatch_${f0.name} = resolve_${f0.name}();
80 >-------
81 % if f0.c_return_type != 'void':
82 ........return .
83 % endif
84 ...............piglit_dispatch_${f0.name}(${f0.c_untyped_param_list});
87 PFN${f0.name.upper()}PROC piglit_dispatch_${f0.name} = stub_${f0.name};
89 % endfor
90 static void reset_dispatch_pointers(void)
92 % for alias_set in gl_registry.command_alias_map:
93 <% f0 = alias_set.primary_command %>\
94 >-------piglit_dispatch_${f0.name} = stub_${f0.name};
95 % endfor
98 static const char * function_names[] = {
99 % for command in gl_registry.commands:
100 >-------"${command.name}",
101 % endfor
104 static void* (*const function_resolvers[])(void) = {
105 % for alias_set in gl_registry.command_alias_map:
106 <% f0 = alias_set.primary_command %>\
107 >-------resolve_${f0.name},
108 % endfor
110 </%block>\