diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2020-03-02 13:24:37 +0100 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2020-03-02 13:24:37 +0100 |
| commit | 0d1e1dc275d8f0dce56030e5b4ba9db8eebbea96 (patch) | |
| tree | f3848ffdb4460bc7a7413c07acc3ec45b40a3dc9 /vk.generator | |
| parent | 392b9e451e2828badbb4db364f5790f5629dba7f (diff) | |
autogen of preloaded commands list based on first argsAutomatedPreloadedCmdList
Diffstat (limited to 'vk.generator')
| -rw-r--r-- | vk.generator/Program.cs | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/vk.generator/Program.cs b/vk.generator/Program.cs index 43fa2a0..ecf7f85 100644 --- a/vk.generator/Program.cs +++ b/vk.generator/Program.cs @@ -178,16 +178,9 @@ namespace vk.generator { //function pointers to retrieve before any other vulkan api call. //those command should not move in other iface than common to be preload by normal dyn load - static string[] preloadedCommands = { - "vkCreateInstance", - "vkDestroyInstance", - "vkGetDeviceProcAddr", - "vkGetInstanceProcAddr", - "vkEnumerateInstanceExtensionProperties", - "vkEnumerateInstanceLayerProperties", - "vkEnumerateInstanceVersion"}; + static List<string> preloadedCommands = new List<string> {"vkGetDeviceProcAddr","vkGetInstanceProcAddr"}; - static string[] reservedNames = { "event", "object" }; + static string [] reservedNames = { "event", "object" }; static Dictionary<string, ParamDef> paramsDefs = new Dictionary<string, ParamDef> (); @@ -773,6 +766,12 @@ namespace vk.generator { tw.WriteLine (); } static void gen_commands (string englobingStaticClass) { + + string [] firstParamPreloadExclusion = { "VkInstance", "VkDevice", "VkPhysicalDevice", "VkQueue", "VkCommandBuffer" }; + preloadedCommands.AddRange ( + commands.Where (c => string.IsNullOrEmpty (c.alias) && c.parameters.Count > 0 && + !firstParamPreloadExclusion.Contains (c.parameters [0].typedef.Name)).Select (c => c.Name)); + using (StreamWriter sr = new StreamWriter ($"commands_{englobingStaticClass}_gen.cs", false, System.Text.Encoding.UTF8)) { using (IndentedTextWriter tw = new IndentedTextWriter (sr)) { writePreamble (tw, vknamespace + ".Generator"); |