From 6cb3bb031c184a0272e01d9e8a499dc356f1dafe Mon Sep 17 00:00:00 2001 From: Sascha Willems Date: Sat, 7 Oct 2023 12:47:15 +0200 Subject: [PATCH] Android platform guards for extension script generator --- tools/deviceExtensionsFileGenerator.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tools/deviceExtensionsFileGenerator.php b/tools/deviceExtensionsFileGenerator.php index 9ce2ecd..cbf550a 100644 --- a/tools/deviceExtensionsFileGenerator.php +++ b/tools/deviceExtensionsFileGenerator.php @@ -327,10 +327,13 @@ public function writeImplementation(string $file_name, string $output_dir, $exte if ($ext_group == 'QNX') { $cpp_features_block .= "#if defined(VK_USE_PLATFORM_SCREEN_QNX)\n"; } + if ($ext_group == 'ANDROID') { + $cpp_features_block .= "#if defined(VK_USE_PLATFORM_ANDROID)\n"; + } foreach ($ext_arr as $extension) { $cpp_features_block .= $this->generateFeatures2CodeBlock($extension); } - if ($ext_group == 'QNX') { + if (in_array($ext_group, ['QNX', 'ANDROID']) != false) { $cpp_features_block .= "#endif\n"; } $cpp_features_block .= "}\n"; @@ -341,9 +344,18 @@ public function writeImplementation(string $file_name, string $output_dir, $exte }); if (count($ext_arr) > 0) { $cpp_properties_block .= "void VulkanDeviceInfoExtensions::readPhysicalProperties_$ext_group() {\n"; + if ($ext_group == 'QNX') { + $cpp_properties_block .= "#if defined(VK_USE_PLATFORM_SCREEN_QNX)\n"; + } + if ($ext_group == 'ANDROID') { + $cpp_properties_block .= "#if defined(VK_USE_PLATFORM_ANDROID)\n"; + } foreach ($ext_arr as $extension) { $cpp_properties_block .= $this->generateProperties2CodeBlock($extension); } + if (in_array($ext_group, ['QNX', 'ANDROID']) != false) { + $cpp_properties_block .= "#endif\n"; + } $cpp_properties_block .= "}\n"; } }