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'>\
29 #ifndef __PIGLIT_DISPATCH_GEN_H__
30 #define __PIGLIT_DISPATCH_GEN_H__
33 ## Define function pointer typedefs, such as PFNGLACCUMPROC.
35 % for f in sorted(gl_registry.commands):
36 typedef ${f.c_return_type} (APIENTRY *PFN${f.name.upper()}PROC)(${f.c_named_param_list});
40 ## Emit macro wrapper for each dispatch function. For example,
42 ## #define glAttachObjectARB piglit_dispatch_glAttachShader
44 % for alias_set in gl_registry.command_alias_map:
45 <% f0 = alias_set.primary_command %>\
46 % for command in alias_set:
48 % for requirement in sorted(command.requirements):
49 .................. (${requirement.provider.name})
51 ................................................. */
53 extern PFN${f0.name.upper()}PROC piglit_dispatch_${f0.name};
54 % for command in alias_set:
55 #define ${command.name} piglit_dispatch_${f0.name}
62 % for enum_group in gl_registry.enum_groups:
63 % if len(enum_group.enums) > 0:
64 /* Enum Group ${enum_group.name} */
65 % for enum in enum_group.enums:
66 #define ${enum.name} ${enum.c_num_literal}
72 % for extension in gl_registry.extensions:
73 #define ${extension.name} 1
77 % for feature in gl_registry.features:
78 #define ${feature.name} 1
81 #endif /* __PIGLIT_DISPATCH_GEN_H__ */