vulkan: Implement VkSurfaceKHR and use vulkanext.h
Between header version 0.183.0 and 0.184.0, a copy of vulkan.h which
includes extensions was added to the registry, called vulkanext.h. The
vulkan.h included here is actually the registry's vulkanext.h.
(In a later upstream change, the no-extensions version was removed
from the registry, and vulkanext.h was renamed vulkan.h, matching what
we're doing here.)
The version of the extensions picked up in the header file is later
than the ones used in the previous SDK, so this change also updates
our implementation to the extension versions included in the header.
The main change is replacing the VkSurfaceDescriptionKHR structure
with a VkSurfaceKHR object.
Change-Id: I18fa5a269db0fcdbdbde3e9304167bc15e456f85
(cherry picked from commit 957a59a48a8d2e81ca3bb52aacd8d08b1b43dc74)
diff --git a/vulkan/libvulkan/entry.cpp.tmpl b/vulkan/libvulkan/entry.cpp.tmpl
index 72185e7..d0e665f 100644
--- a/vulkan/libvulkan/entry.cpp.tmpl
+++ b/vulkan/libvulkan/entry.cpp.tmpl
@@ -69,7 +69,7 @@
} // namespace
¶
{{range $f := AllCommands $}}
- {{if not (GetAnnotation $f "pfn")}}
+ {{if and (not (GetAnnotation $f "pfn")) (Macro "IsExportedEntry" $f)}}
__attribute__((visibility("default")))
{{if eq (Macro "IsSpecialEntry" $f.Name) "true"}}
{{Macro "EmitSpecialEntry" $f}}
@@ -84,6 +84,25 @@
{{/*
-------------------------------------------------------------------------------
+ Decides whether an entrypoint should be exported from the Android Vulkan
+ library. Entrypoints in the core API and in mandatory extensions are
+ exported.
+-------------------------------------------------------------------------------
+*/}}
+{{define "IsExportedEntry"}}
+ {{AssertType $ "Function"}}
+ {{$ext := GetAnnotation $ "extension"}}
+ {{if $ext}}
+ {{$extval := index $ext.Arguments 0}}
+ {{if eq $extval "VK_EXT_KHR_surface"}}true
+ {{else if eq $extval "VK_EXT_KHR_swapchain"}}true
+ {{else if eq $extval "VK_EXT_KHR_android_surface"}}true{{end}}
+ {{else}}true{{end}}
+{{end}}
+
+
+{{/*
+-------------------------------------------------------------------------------
Decides whether an entrypoint needs special-case handling. Emits the string
"true" if so, nothing otherwise.
-------------------------------------------------------------------------------
@@ -95,6 +114,7 @@
{{end}}
{{end}}
+
{{/*
-------------------------------------------------------------------------------
Emits the entrypoint definition for the specified command, which always