Skip to content

Commit

Permalink
Android platform guards for extension script generator
Browse files Browse the repository at this point in the history
  • Loading branch information
SaschaWillems committed Oct 7, 2023
1 parent 688182e commit 6cb3bb0
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion tools/deviceExtensionsFileGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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";
}
}
Expand Down

0 comments on commit 6cb3bb0

Please sign in to comment.