1 //* Copyright 2019 The Dawn Authors 2 //* 3 //* Licensed under the Apache License, Version 2.0 (the "License"); 4 //* you may not use this file except in compliance with the License. 5 //* You may obtain a copy of the License at 6 //* 7 //* http://www.apache.org/licenses/LICENSE-2.0 8 //* 9 //* Unless required by applicable law or agreed to in writing, software 10 //* distributed under the License is distributed on an "AS IS" BASIS, 11 //* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 //* See the License for the specific language governing permissions and 13 //* limitations under the License. 14 15 {% set Prefix = metadata.proc_table_prefix %} 16 #ifndef DAWN_{{Prefix.upper()}}_PROC_TABLE_H_ 17 #define DAWN_{{Prefix.upper()}}_PROC_TABLE_H_ 18 19 #include "dawn/{{metadata.api.lower()}}.h" 20 21 // Note: Often allocated as a static global. Do not add a complex constructor. 22 typedef struct {{Prefix}}ProcTable { 23 {% for function in by_category["function"] %} 24 {{as_cProc(None, function.name)}} {{as_varName(function.name)}}; 25 {% endfor %} 26 27 {% for type in by_category["object"] %} 28 {% for method in c_methods(type) %} 29 {{as_cProc(type.name, method.name)}} {{as_varName(type.name, method.name)}}; 30 {% endfor %} 31 32 {% endfor %} 33 } {{Prefix}}ProcTable; 34 35 #endif // DAWN_{{Prefix.upper()}}_PROC_TABLE_H_ 36