4 * Copyright 2014 Intel Corporation
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:
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
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
26 <%block filter='fake_whitespace'>\
27 % for alias_set in gl_registry.command_alias_map:
28 <% f0 = alias_set.primary_command %>\
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)) %>
38 % if req.has_extension:
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})
50 ................................................................................................)
53 ................................................................................................. || .
57 % if req.has_extension:
58 ....................................................................................................)
59 >------- && check_extension("${req.extension.name}")
61 ...............................................................) {
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}");
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}();
81 % if f0.c_return_type != 'void':
84 ...............piglit_dispatch_${f0.name}(${f0.c_untyped_param_list});
87 PFN${f0.name.upper()}PROC piglit_dispatch_${f0.name} = stub_${f0.name};
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};
98 static const char * function_names[] = {
99 % for command in gl_registry.commands:
100 >-------"${command.name}",
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},