• Home
  • History
  • Annotate
  • only in /frameworks/native/vulkan/libvulkan/
History log of /frameworks/native/vulkan/libvulkan/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
42a9eecb23c0b72bbee1eb2ef6b0d6586159d1c3 03-Jun-2016 Jesse Hall <jessehall@google.com> libvulkan: reduce log level for swapchain usage errors

Bug: 26927424
Change-Id: Id9346356436663db83a2d6fa8fefc4ea24d7854b
wapchain.cpp
b2dcc3a1220ea5ef6acb5a63659da3c34b1a295a 03-Jun-2016 Jesse Hall <jessehall@google.com> Merge "libvulkan: Slightly better handling of swapchain re-creation" into nyc-dev
dc22507e6fd6659c886aa1218f7681fd43b74598 31-May-2016 Jesse Hall <jessehall@google.com> libvulkan: Slightly better handling of swapchain re-creation

Previously we would fail vkCreateSwapchainKHR if
VkSwapchainCreateInfo::oldSwapchain was used, because we were unable
to dequeue all buffers for the new swapchain from an already-used
native window.

Now we disconnect and re-connect to the native window in order to
fully reset state, and allow us to dequeue all buffers. Additionally,
we tag the old swapchain as out-of-date, so future image acquires and
presents will fail with VK_ERROR_OUT_OF_DATE_KHR on that swapchain.
This is less than ideal, but better than what we had, and the best we
have time to do for N.

Bug: 26927424
Change-Id: Ifaa5048376f72a63ecb1dca3d1ff85dbee2c24d0
river.cpp
river.h
wapchain.cpp
dbd33bcca26a38d24a1ae25d894175ea9ad1033a 02-Jun-2016 Chia-I Wu <olv@google.com> vulkan: remove EnumerateDeviceLayerProperties internally

We never use it. Since it is also deprecated, we will never need it.

Bug: 27910383
Change-Id: If4e556bb69890153be2987b165482e43ab06a890
pi_gen.cpp
pi_gen.h
ode-generator.tmpl
river_gen.cpp
river_gen.h
61b25fdffc360ab70e1f33be0bb43c911150277b 27-May-2016 Chia-I Wu <olv@google.com> vulkan: fix crash when only non-global layers are enabled

We fail to set up get_instance_proc_addr_ and get_device_proc_addr_ when
there are layers but only non-global ones.

Bug: 28990561
Change-Id: I82704f946deb5a76640f9dfb792e6fd118c78aa7
pi.cpp
319382517afe913285df5bbf76a8a484e6adfbd0 23-May-2016 Chia-I Wu <olv@google.com> vulkan: advertise VK_EXT_debug_report

We use VK_EXT_debug_report to report most messages and we should always
advertise the extension. This is complicated however because the HAL may
also advertise the extension.

Do the minimal and cache whether the HAL supports VK_EXT_debug_report in
class Hal. More refactorings will be required if we want to be more
flexible.

Bug: 28753291
Change-Id: I0298b2c3024e2ed059411128dbbe264c0b289a4b
river.cpp
31b2e4f01d31aae107340cbc4221b8d49fb42767 23-May-2016 Chia-I Wu <olv@google.com> vulkan: add a wrapper for hwvulkan_device_t

Add class Hal as a wrapper for hwvulkan_device_t.

Bug: 28753291
Change-Id: I9612ee5515c7f2266cfc1ef0c8583fa98c82dd86
river.cpp
e6759c3d886491f01dd2295f71d22609b3b9b259 24-May-2016 Chia-I Wu <olv@google.com> Merge "vulkan: do not use exported functions internally" into nyc-dev
3e654dc68a954b150c141c4a2e96418883bd7c9b 20-May-2016 Chia-I Wu <olv@google.com> vulkan: do not use exported functions internally

Our vkGet*ProcAddr uses the exported functions. They will break when any
of the exported functions are overridden (e.g., through LD_PRELOAD).

Unexport and move all exported functions to vulkan::api namespace.
Re-export them by having vkFoo as a wrapper to vulkan::api::Foo.

Another option is to re-export vulkan::api::Foo by having vkFoo as an
alias using __attribute__((alias)). That results in smaller binaries.
But we will not be able to catch mismatches between vulkan.h and
vulkan.api.

To avoid future breakage, define VK_NO_PROTOTYPES for all files except
api_gen.cpp.

Bug: 28886971
Change-Id: I08fde7ebb247f8c7e040ccf812b40b02094d3c7f
ndroid.mk
pi_gen.cpp
ode-generator.tmpl
2676338dd692b7d1e1c276d82e6b0492db53ab2e 20-May-2016 Jesse Hall <jessehall@google.com> vulkan: Update vulkan.h to 1.0.13

vulkan.h and vk_platform.h imported from
github.com:KhronosGroup/Vulkan-Docs @ 2656f459333b3a1dc63619a9ebd83490eea22e93

Updated vulkan.api to reflect the changes in vulkan.h. There were no
changes to any of the code we generate. I didn't update the
vulkan_h.tmpl, since we're not currently using it and it was already
out of date.

Bug: 28878216
Change-Id: I71676683148fae7ad8799bd39386a931319aa395
ebug_report.cpp
wapchain.cpp
8c6c10e20d40066468bf4350b64703e11d5bff10 19-May-2016 Jesse Hall <jessehall@google.com> libvulkan: Don't try to load compressed/unaligned libraries from APK

Bug: 28825642
Change-Id: I46ea3a54010cccf9e23696a4aff52a42a31d92b1
ayers_extensions.cpp
ed93ea39891341b4396ad9eb59cd98aa74e5d6c3 18-May-2016 Chia-I Wu <olv@google.com> vulkan: fix double dlopen for layer libraries

Bug: 28826014
Change-Id: I10693426f987e63bb490ac8d1f4445ce2d195d8d
ayers_extensions.cpp
ede02ac245b5f2aa1139d6cb0e2dc7c0f8f290d2 13-May-2016 Chia-I Wu <olv@google.com> vulkan: check flags for early debug report callbacks

We have a different path to invoke early (that is, vkCreateInstance) debug
report callbacks. Check for "flags" in this path as well.

Bug: 28753666
Change-Id: I49b5f2920b38ffdf69036f352166ae3b0aca62c5
ebug_report.cpp
40c07a1d002561fc8db987ec30d890b041fb6336 12-May-2016 Jesse Hall <jessehall@google.com> libvulkan: Load layer libraries into the app namespace

Bug: 28213888
Change-Id: I79901693c30f0e69730643b424e504a8d3628624
ayers_extensions.cpp
ulkan_loader_data.cpp
1a7eb59c2a7907ea4c4925c6d13d66e53fb60339 01-May-2016 Jesse Hall <jessehall@google.com> libvulkan: Discover layer libraries in entire search path

Previously we only searched the unpacked native library path for layer
libraries. Now we search all directories in the dynamic linker's
search path, including unpacked libraries in the APK itself.

Bug: 28213888
Change-Id: I37772fd90f705592ae1725c7c8603b0174e6b133
ndroid.mk
ayers_extensions.cpp
e201c3f782f0d3e2ec508fb8093e506145614c06 03-May-2016 Chia-I Wu <olv@google.com> vulkan: improve vulkan::driver logcat messages

Make it clear the errors are generated from internal vkGet*ProcAddr calls.
Log a message whenever stubhal is used.

Bug: 28120066
Change-Id: Iabf88757c3cb20b7ddcbe3c1d201f3d23dd3ed0b
river.cpp
a4a0555a168efd2e93f6d8b63de7cdc7aeb61a11 05-May-2016 Chia-I Wu <olv@google.com> vulkan: use Logger in vulkan::api

Use debug report logger for actionable application errors (but not other
errors).

Bug: 28120066
Change-Id: Ia9a3b568e415555bf42c8a76d1df6279835a710c
pi.cpp
5beb2ac5e0b676e55be9f0b768ba3fd3697f3216 04-May-2016 Chia-I Wu <olv@google.com> vulkan: use Logger in the generated code

Except for INIT_PROC, where ALOGE is still used for layer/HAL bugs.

Bug: 28120066
Change-Id: Icd9ce99b6bfb77816b11c05f6c8b197a6782b7cd
pi_gen.cpp
ode-generator.tmpl
river_gen.cpp
bc011fc4d78442d1f0167b04aea3484c62e0a92b 02-May-2016 Chia-I Wu <olv@google.com> vulkan: add DebugReportLogger

Add DebugReportLogger that can be used during vkCreateInstance and other
commands. Add vulkan::driver::Logger to create a temporary
DebugReportLogger from a dispatchable object. With them, we can log to
debug report by, for example,

Logger(instance).Warn(obj, "failed with %s", err);

Bug: 28120066
Change-Id: If059d38d3cfcfe591031ca135695d08cad42e0a4
ebug_report.cpp
ebug_report.h
river.h
950d6e1102077d6a3905eb77268800002e792fb0 03-May-2016 Chia-I Wu <olv@google.com> vulkan: make debug report callbacks available in DeviceData

This allows device commands to send messages to debug report.

Bug: 28120066
Change-Id: I43d217fc23799b06fd3fda73e1876d8773c723fc
river.cpp
river.h
2e6736699471dbe7ec185667240089dcbccdd9bd 02-May-2016 Chia-I Wu <olv@google.com> vulkan: avoid duplicated app messages

When vkDebugReportMessageEXT is called, every component (layer,
vulkan::driver, or hal) supporting the extension knows how to handle it.
But only one of them should handle it.

Bug: 28120066
Change-Id: I4e746b80e0920c2c63f0aceceba1601536c6236d
ebug_report.cpp
b3055f34650cd066a349e1e8cba294b05513ef2e 02-May-2016 Chia-I Wu <olv@google.com> vulkan: constify DebugReportCallbackList::Message

Sending a message should not modify the state of DebugReportCallbackList,
conceptually.

Bug: 28120066
Change-Id: I7b30b4a41492b4e670408f34a6bffe8b56295afd
ebug_report.cpp
ebug_report.h
a0d40aaf12435fe82bc9c1612dbe97ea2a60da31 04-May-2016 Chia-I Wu <olv@google.com> vulkan: refactor DebugReportCallbackList

Simplify DebugReportCallbackList to be a thread-safe list with three
methods:

- AddCallback adds a node to the list
- RemoveCallback removes a node from the list
- Message invokes each of the nodes on the list

Add some static methods for Node* and VkDebugReportCallbackEXT
conversions.

Bug: 28120066
Change-Id: I109c6eff368cacb37508e2549dbd0b5dfa23bcb3
ebug_report.cpp
ebug_report.h
c3a28913b6a95d2faee0db537c48557e04267511 14-Apr-2016 Chia-I Wu <olv@google.com> vulkan: deprecate device layers

Allow instance layers to intercept all commands and enumerate device
extensions. Ignore application device layers. Enumerate all enabled
instance layers in vkEnumerateDeviceLayerProperties.

Bug: 27911856
Change-Id: I6e89439ab10835dd1a43732c2333a92201e52550
pi.cpp
river.h
6184b20d8e2301ecc21f815e1f9c2676c43878d1 27-Apr-2016 Chia-I Wu <olv@google.com> vulkan: detect errors in VkEnumerate*ExtensionProperties

Return VK_ERROR_LAYER_NOT_PRESENT when the layer is not available.

Change-Id: I9d9aafe6e40c2ca49e58bc7c70114d0f11de2f81
pi.cpp
dab25658fb17ec76569b8e91dfed801855027f08 28-Apr-2016 Chia-I Wu <olv@google.com> vulkan: do not distinguish instance or device LayerRef

Merge Get*LayerRef into GetLayerRef and remove LayerRef::is_instance_.
With the removal, LayerRef::SupportsExtension becomes ambiguous. Replace
it with FindLayer*Extension. Remove unused LayerRef::GetName and
LayerRef::GetSpecName while at it.

There should be no user-visible change.

Bug: 27911856
Change-Id: I38340654b52338e9ed46d1c4462a6b254b0cab64
pi.cpp
ayers_extensions.cpp
ayers_extensions.h
d6e6f51426c566cd67ed765e5c4b206a063aaa30 28-Apr-2016 Chia-I Wu <olv@google.com> vulkan: make Get*LayerRef take a Layer

The only user-visible change should be improved error messages.

Bug: 27911856
Change-Id: Ie50a9d37f07b590026176642f2c67270225f9280
pi.cpp
ayers_extensions.cpp
ayers_extensions.h
04c6551eb812a7efe38fa74e6ac67c17aab3df2d 27-Apr-2016 Chia-I Wu <olv@google.com> vulkan: refactor layer extension enumeration

Replace Get*LayerExtensions by a set of new functions that do not
distinguish instance and device layers.

There should be no user-visible change.

Bug: 27911856
Change-Id: Icd98abf51a936769f8f2f218794043b5e2611c5c
pi.cpp
ayers_extensions.cpp
ayers_extensions.h
25700b452535ce7ae838bfe832392b46ed555ed2 28-Apr-2016 Chia-I Wu <olv@google.com> vulkan: refactor layer enumeration

Replace Enumerate*Layers by a set of new functions that do not distinguish
instance and device layers. The new functions are also careful not to
pollute the rest of the loader with std containers.

There should be no user-visible change.

Bug: 27911856
Change-Id: I4790fadc1aa2ea934a4628bce55dd45892f15e0b
pi.cpp
ayers_extensions.cpp
ayers_extensions.h
6cfb89c0bfe11c2ee513fe4df339ad753d4ad4ff 27-Apr-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge changes I97efd6c9,I6460f8f0,Ic67e4290,I16214514,Ieaa4e463, ... into nyc-dev

* changes:
vulkan: remove g_device_layers
vulkan: ignore device-only layers
vulkan: ignore layer libraries without instance layers
vulkan: add FindLayer helper
vulkan: constify LayerRef members
vulkan: make g_library_mutex per-LayerLibrary
vulkan: make LayerLibrary a class
vulkan: refactor GetLayerGetProcAddr
vulkan: refactor AddLayerLibrary
vulkan: refactor LayerRef::~LayerRef
vulkan: refactor GetLayerRef
vulkan: add a constructor for LayerLibrary
bea09db9c2165f06771f3a3da423f4f85ac6347e 22-Apr-2016 Chia-I Wu <olv@google.com> vulkan: remove g_device_layers

All device layers are now instance layers. We do not need to maintain two
vectors.

Change-Id: I97efd6c92395f00ac41aae6862e5607dfa678156
ayers_extensions.cpp
ayers_extensions.h
279ccc0048d5bc7105af02538e33946814c68dc7 18-Apr-2016 Chia-I Wu <olv@google.com> vulkan: ignore device-only layers

Ignore device layers that have no matching instance layers.

Change-Id: I6460f8f0c3c1288c23843e0875fa6a90f7f6cb8d
ayers_extensions.cpp
5f093bf18120a5cbf18d0f3e255b2178f524e438 18-Apr-2016 Chia-I Wu <olv@google.com> vulkan: ignore layer libraries without instance layers

Make vkEnumerateInstanceLayerProperties and
vkEnumerateInstanceExtensionProperties mandatory for layer libraries. If
vkEnumerateInstanceLayerProperties enumerates no instance layer, ignore
the layer library.

Change-Id: Ic67e4290f0cd5f9098bd02d9d01cc0194398424a
ayers_extensions.cpp
50db9035b034385a27fb557e4da3c48b51a0e3eb 22-Apr-2016 Chia-I Wu <olv@google.com> vulkan: add FindLayer helper

It finds a Layer using the layer name.

Change-Id: I16214514fcdef09f9016dc2c71fcd5c1f3d0fa6b
ayers_extensions.cpp
83506d84d00bbb35ecebb44261b2139bc40ef3e2 19-Apr-2016 Chia-I Wu <olv@google.com> vulkan: constify LayerRef members

Consitfy GetSpecVersion and layer_.

Change-Id: Ieaa4e463ca4666fc9f81b9904fe0783c55e98d03
ayers_extensions.cpp
ayers_extensions.h
a6229749aeef225803c6a5411be9e8a40637454d 26-Apr-2016 Chia-I Wu <olv@google.com> vulkan: make g_library_mutex per-LayerLibrary

All that need to be protected are LayerLibrary::Open and
LayerLibrary::Close.

Change-Id: I81b2e7cc36d8c260ddcba69074c71a5244f5b443
ayers_extensions.cpp
3d1c82a750046f055951242bf27909ad7d9cdf52 23-Apr-2016 Jesse Hall <jessehall@google.com> libvulkan: Reset window before creating swapchain

When using one window for two consecutive swapchains, some of the
settings from the first swapchain were affecting how many buffers we
thought we needed for the second, eventually leading us to attempt to
dequeue more buffers than we actually could.

Bug: 28075694
Change-Id: I7d2cabc2365986dfcfe8a03d16bb71ca1616f144
tubhal.cpp
wapchain.cpp
6693f5cd2238fe08b382bf762e33b701312c7038 17-Apr-2016 Chia-I Wu <olv@google.com> vulkan: make LayerLibrary a class

Make all data members private and suffix them with an underscore.
Constify path_ while at it. There is no functional change.

Change-Id: I98db9bfb1cfa9a15a501a5d3c6037fe08cff5717
ayers_extensions.cpp
ba113275287a2293136d8737bf364651ea0b576d 18-Apr-2016 Chia-I Wu <olv@google.com> vulkan: refactor GetLayerGetProcAddr

Add and call LayerLibrary::GetGPA from GetLayerGetProcAddr. There is no
functional change.

Change-Id: Ie0ec8c16633239bd8d8e634fac7525401d73343a
ayers_extensions.cpp
50174ee4ff2f6537c4aa4e8aa475f0dc8d910870 18-Apr-2016 Chia-I Wu <olv@google.com> vulkan: refactor AddLayerLibrary

Add and call LayerLibrary::EnumerateLayers from AddLayerLibrary. There is
no functional change.

Change-Id: I6bb2a6fd6f78299c179c0c7af7c60b388e109734
ayers_extensions.cpp
d91c74f917b603d8d1dec7d27da03e580919e0a6 17-Apr-2016 Chia-I Wu <olv@google.com> vulkan: refactor LayerRef::~LayerRef

Add and call LayerLibrary::Close from LayerRef::~LayerRef. There is no
functional change.

Change-Id: I514a1631204f104293a2b75f0a6d34d8625e68b1
ayers_extensions.cpp
fd0389fb67298e530142566e7a5f6fb16741caba 17-Apr-2016 Chia-I Wu <olv@google.com> vulkan: refactor GetLayerRef

Add and call LayerLibrary::Open from GetLayerRef. There is no functional
change.

Change-Id: I00cff2bbc7984bb3d861eb88aea423c36b0d806f
ayers_extensions.cpp
743495943b1a0b6d81ac70df524f67041f116ba6 17-Apr-2016 Chia-I Wu <olv@google.com> vulkan: add a constructor for LayerLibrary

There is no functional change.

Change-Id: I77b6c7c6a697cb25cee42cda3b5683885186545a
ayers_extensions.cpp
109f8985ceaf746fd04b6fe81be238b3865062b7 22-Apr-2016 Chia-I Wu <olv@google.com> vulkan: silence a warning when layers are enabled

Layers always do

vkGetInstanceProcAddr(VK_NULL_HANDLE, "vkCreateDevice")

and we should not log an error.

Change-Id: Ifeba21da73d982775edc4e6a91ce0f0f5eab191d
river.cpp
e8e689f1190a936ebd6bf6cbe28ab8625e94c6c7 18-Apr-2016 Chia-I Wu <olv@google.com> vulkan: replace std::shared_ptr by android::sp

With the change, we do not handle exceptions anymore. Remove
-fexceptions.

Bug: 26732452
Change-Id: I2782f9b522cb25f158515fcf90312013e672225b
ndroid.mk
wapchain.cpp
36cc00a1739f7d926cc20671ae9900a5460dd6ae 13-Apr-2016 Chia-I Wu <olv@google.com> vulkan: fix vkGet*ProcAddr for un-enabled extensions

vulkan::api::InitDispatchTable no longer queries for non-enabled WSI
functions. We could now return NULL instead of ProcHook::disabled_proc.
This also matches what the spec says.

Bug: 28173232
Change-Id: I05c45303025d25e49f75c18a912fc4cc2b13979f
ode-generator.tmpl
river.cpp
river_gen.cpp
river_gen.h
8925efd0a87d96885834a00f3bdef220edf6d8ea 13-Apr-2016 Chia-I Wu <olv@google.com> vulkan: do not query non-enabled WSI functions

Initialize dispatch table entries for non-enabled WSI functions to stubs.
We do not want to initialize them to NULL because they may still be
invoked through the exported WSI entrypoints.

Bug: 25850852
Change-Id: I25b715700990ad7432740f031764d70396024d32
pi.cpp
pi_gen.cpp
pi_gen.h
ode-generator.tmpl
cbe07ef239121dc99a31a19b9593d76d76abb08b 13-Apr-2016 Chia-I Wu <olv@google.com> vulkan: pass hal_extensions to InitDriverTable

We only need hal_extensions to initialize the driver tables. There is no
need to save it in driver::{Instance,Device}Data.

Change-Id: I56ebc0ee9c5bc5e543e7a84412b03b842bd8ced5
ode-generator.tmpl
river.cpp
river.h
river_gen.cpp
river_gen.h
94a2c0ecd4537c52e6b4a3ef9d119dce44627ca8 13-Apr-2016 Chia-I Wu <olv@google.com> vulkan: pass VK_LAYER_FUNCTION_DATA_CALLBACK to layers

VK_LAYER_FUNCTION_DATA_CALLBACK effectively allows us to pass
driver::SetDataInternal to layers. It will be called on handles of
potentially unknown types. Add two internal types

VK_DEFINE_HANDLE(InstanceDispatchable)
VK_DEFINE_HANDLE(DeviceDispatchable)

in driver namespace for type safety.

Bug: 28015368
Change-Id: I7389829a7d8c374197cd7046973777b49e436961
pi.cpp
river.h
c56603e0b35e31c5f1cd134d6b916a16ff710504 12-Apr-2016 Chia-I Wu <olv@google.com> vulkan: fix vkGetDeviceProcAddr for intercepted commands

This allows vulkan::api::DestroyDevice to properly unreference layers.

Bug: 28077754
Change-Id: I194925d29dee3489b63f4a44669c791d378afa39
pi_gen.cpp
ode-generator.tmpl
1600e269dbf9f2cd818886c55b3e0933dfec7a86 12-Apr-2016 Chia-I Wu <olv@google.com> vulkan: fix support for unknown extensions

Never set the bit ProcHook::EXTENSION_UNKNOWN, otherwise std::out_of_range
will be thrown.

Change-Id: I0a1343079647162bf17494acaaa69f1fa26b72f8
river.cpp
b7c4e3b7c97c952ba26f061d74d2038e6c94e689 11-Apr-2016 Jesse Hall <jessehall@google.com> libvulkan: Use a stub HAL when no real Vulkan HAL is present

This stub HAL enumerates zero VkPhysicalDevices. This allows a
VkInstane to be created and queried for physical devices successfully
even on devices without a Vulkan driver. Handling this with a stub HAL
avoids the need for NULL HAL and NULL driver function pointer checks
in many places throughout the loader, which would be more error-prone.

Fixes bug: 28100673
Change-Id: I76bea975929a85eda354730d6c815567b412b160
ndroid.mk
river.cpp
tubhal.cpp
tubhal.h
3e6c2d6889d9c1bc7eb4dbd9774d861c18a21a80 11-Apr-2016 Chia-I Wu <olv@google.com> vulkan: use CamelCase() for CreateInfoWrapper

Change-Id: I33360e15dd0bfb038235d7600587d39d50cea0a8
river.cpp
eef27fa3a0c7d153603b7fd69849fee73a07af5b 11-Apr-2016 Chia-I Wu <olv@google.com> vulkan: use CamelCase() for LayerChain

Change-Id: I2f102fa97e3c976fa411b4e6bdc83dacfa243af7
pi.cpp
c3fa20cee7156f9393ff319e0f884705483d3bf8 11-Apr-2016 Chia-I Wu <olv@google.com> vulkan: use CamelCase() for OverrideExtensionNames

Change-Id: If44c40f87b1e3e2eb69d12543a7f3b3036291c88
pi.cpp
026b8facd53e2db16bb73f6dccb064f00d8e9b00 11-Apr-2016 Chia-I Wu <olv@google.com> vulkan: use CamelCase() for OverrideLayerNames

Change-Id: Ic7bc29efc1ae5b734ebfc692c441b9537134ccb2
pi.cpp
4ad5c1414b3cfcbe5b3c3b9f21b42f23d99bafba 11-Apr-2016 Chia-I Wu <olv@google.com> Merge changes I21f07545,I73c39cbe,I47b1639c,I4a6268d7,I06be9898, ... into nyc-dev

* changes:
vulkan: remove unused loader.{cpp.h}
vulkan: use driver::GetData everywhere
vulkan: move all _Bottom functions
vulkan: add swapchain.h
vulkan: add layers_extensions.h
vulkan: rework CreateInstance_Bottom and related ones
vulkan: rework EnumerateDeviceExtensionProperties_Bottom
vulkan: rework {Create,Destroy}Device_Bottom
vulkan: move AllocateCommandBuffers_Bottom
vulkan: move GetDeviceQueue_Bottom
vulkan: rework DriverDispatchTable
vulkan: rework driver::Get*ProcAddr
vulkan: add VK_ANDROID_native_buffer to vulkan.api
vulkan: move driver::GetDefaultAllocator
vulkan: move driver::OpenHAL
vulkan: move driver::Debuggable
3b6b5adbddf7415bff3c3d0bc11efd5df9cc132f 26-Mar-2016 Chia-I Wu <olv@google.com> vulkan: remove unused loader.{cpp.h}

Change-Id: I21f07545cf286f7e5796d9a6c9642cfdd3001f17
ndroid.mk
oader.cpp
oader.h
4a6a91647c57abb5c06cde57c57afe944f8cefa4 26-Mar-2016 Chia-I Wu <olv@google.com> vulkan: use driver::GetData everywhere

Move away from the one-liners defined in loader.cpp.

Change-Id: I73c39cbe21aa3b2079f67590bb40f0cd55563f84
ode-generator.tmpl
ebug_report.cpp
river.cpp
river.h
river_gen.cpp
wapchain.cpp
622622377a1ac71a81a88e335f170c4a08835f06 26-Mar-2016 Chia-I Wu <olv@google.com> vulkan: move all _Bottom functions

Move them to vulkan::driver namespace and drop the _Bottom suffix.

Change-Id: I47b1639c4074adb9c0658816f5f1e126df7f685b
ode-generator.tmpl
ebug_report.cpp
ebug_report.h
river_gen.cpp
oader.cpp
oader.h
wapchain.cpp
wapchain.h
de82e27e2010b48e72103e98ba3fe6eba5152b54 26-Mar-2016 Chia-I Wu <olv@google.com> vulkan: add swapchain.h

Move everything belongs to swapchain.cpp out of loader.h to swapchain.h.

Change-Id: I4a6268d703b60e5661b09917eed129d2d227a63c
oader.h
wapchain.h
c96880f2cd1d34ffb9e3d10d80f0a3ddcc5579a8 25-Mar-2016 Chia-I Wu <olv@google.com> vulkan: add layers_extensions.h

Move everything for layers_extensions.cpp out of loader.h to
layers_extensions.h, and into vulkan::api namespace.

Remove now unused InstanceExtensionFromName and DeviceExtensionFromName.

Change-Id: I06be98986f40de35e9dffb5499bc1423e9eb3d48
pi.cpp
ayers_extensions.cpp
ayers_extensions.h
oader.h
ff4a6c772aaf3ff0b71348647330031a059b1f51 24-Mar-2016 Chia-I Wu <olv@google.com> vulkan: rework CreateInstance_Bottom and related ones

The reworked driver::CreateInstance will

- call HAL's EnumerateInstanceExtensionProperties and filter out
extensions unknown to HAL, if there is any extension enabled.

We do not expect or enumerate any HAL layer yet as that requires some
works to layers_extensions.cpp.

The reworked driver::EnumerateInstanceExtensionProperties instead will
return all extensions enumerated by HAL, after prepending VK_KHR_surface
and VK_KHR_android_surface to them. This allows extensions unknown to the
loader to be enumerated.

Change-Id: I73b496582a773e06c7b79f0c5c166700737f2953
ode-generator.tmpl
river.cpp
river.h
river_gen.cpp
oader.cpp
oader.h
01cf305325f3789c573d7eff435e409f04677c66 24-Mar-2016 Chia-I Wu <olv@google.com> vulkan: rework EnumerateDeviceExtensionProperties_Bottom

The reworked driver::EnumerateDeviceExtensionProperties will simply return
all extensions enumerated by HAL, with VK_ANDROID_native_buffer replaced
by VK_KHR_swapchain. This allows extensions unknown to the loader to be
enumerated.

Change-Id: Iceed8ee3f16a968d005ae3ba42f1bd1839c2ab9f
ode-generator.tmpl
river.cpp
river.h
river_gen.cpp
oader.cpp
oader.h
4901db70b12801cf1966937a58eb7566bfdeb4ce 24-Mar-2016 Chia-I Wu <olv@google.com> vulkan: rework {Create,Destroy}Device_Bottom

The reworked driver::CreateDevice will

- use the providied pAllocator,
- call HAL's EnumerateDeviceExtensionProperties and filter out extensions
unknown to HAL, if there is any extension enabled.

We do not expect or enumerate any HAL layer yet as that requires some
works to layers_extensions.cpp.

Change-Id: I3ba4019d18dfed994d7037d95825bf54096f2a5d
ode-generator.tmpl
river.cpp
river.h
river_gen.cpp
river_gen.h
oader.cpp
oader.h
a70a4214d85dec0d27e918c977dabd488a5c20e5 11-Apr-2016 Chia-I Wu <olv@google.com> Merge "vulkan: check for unsupported extensions" into nyc-dev
c684560d96df39570c66b2b3e0035859bb4b25a5 07-Apr-2016 Chia-I Wu <olv@google.com> vulkan: avoid double-free in InitSharedPtr

When std::shared_ptr fails to allocate its internal data, it deletes the
managed object automatically. We should not call obj->common.decRef on
std::bad_alloc.

Bug: 28039233
Change-Id: I1fe00c16e83e426602eac96d8b86afb4fd4830e6
wapchain.cpp
6a58a8a7813450038cb15575e3333b83f268c972 24-Mar-2016 Chia-I Wu <olv@google.com> vulkan: move AllocateCommandBuffers_Bottom

Move it from loader.cpp to driver.cpp and rename it to
driver::AllocateCommandBuffers. No functional change.

Change-Id: I0abdca7dea128df0b313b90cfb5d5825566fc790
ode-generator.tmpl
river.cpp
river.h
river_gen.cpp
oader.cpp
oader.h
ba0be41afe39dcbed0a712a32d1ab6c341797007 24-Mar-2016 Chia-I Wu <olv@google.com> vulkan: move GetDeviceQueue_Bottom

Move it from loader.cpp to driver.cpp and rename it to
driver::GetDeviceQueue. No functional change.

Change-Id: Ide8ebe044e62b8ef6fc64ac03dcc1d920f5bf9a6
ode-generator.tmpl
river.cpp
river.h
river_gen.cpp
oader.cpp
oader.h
cc5e2765a9d56b03b69d0c3f25b94721f82d034e 24-Mar-2016 Chia-I Wu <olv@google.com> vulkan: rework DriverDispatchTable

Generate {Instance,Device}DriverTable from code-generator.tmpl to replace
dispatch.tmpl entirely. The new code avoids initializing
VK_ANDROID_native_buffer entries when the extension is not enabled. The
separation of instance and device driver tables also allows us to
initialize the device driver table with vkGetDeviceProcAddr, which is
expected to return more efficient function pointers on properly
implemented HALs.

CreateInstance_Bottom always has a potential resource leak when the
HAL-created instance does not contain HWVULKAN_DISPATCH_MAGIC.
CreateDevice_Bottom now has the same issue. Both of them will be fixed in
following commits.

Change-Id: If7800ef23098121f1fff643a2c5224c2c9be0711
ndroid.mk
ode-generator.tmpl
ispatch.tmpl
ispatch_gen.cpp
ispatch_gen.h
river.cpp
river.h
river_gen.cpp
river_gen.h
oader.cpp
oader.h
wapchain.cpp
eb7db124e46da9a9210cf868353f5ea79502ffec 24-Mar-2016 Chia-I Wu <olv@google.com> vulkan: rework driver::Get*ProcAddr

Introduce driver::ProcHook which is a struct to describe an intercepted
function. Given a function name, GetProcHook returns a ProcHook if the
function is intercepted. NULL otherwise.

A ProcHook has three function pointers. ProcHook::proc points to the real
intercepting function. ProcHook::disabled_proc points to a no-op function
that logs an error. ProcHook::checked_proc points to a trampoline that
calls either ProcHook::proc or ProcHook::disabled_proc.

For core functions, driver::Get*ProcAddr simply return ProcHook::proc.
For extension functions, driver::Get*ProcAddr return ProcHook::proc when
the extension is known to be enabled. They return ProcHook::disabled_proc
when the extension is known to be disabled. Finally, they return
ProcHook::checked_proc when they do not know if the extension is enabled
or not.

All ProcHooks as well as their disabled_proc/checked_proc are generated in
driver_gen.cpp. This allows us to get rid of all hand-written "_Disabled"
functions, all no-op "_Bottom" functions, and special cases for
VK_ANDROID_native_buffer. The reworked driver::Get*ProcAddr also detects
more applications' errors and logs them.

Change-Id: I8e6f476f450688b5547fd75243c66cb603c516b5
ndroid.mk
ode-generator.tmpl
ispatch.tmpl
ispatch_gen.cpp
river.cpp
river.h
river_gen.cpp
river_gen.h
oader.cpp
oader.h
dbb7e9c8f950ad344eee22cc50acc67253f9f4b1 24-Mar-2016 Chia-I Wu <olv@google.com> vulkan: move driver::GetDefaultAllocator

Move it from loader.cpp to driver.cpp. No functional change.

Change-Id: I8c9bb5315c29ff69bfd971ac8e1264fb8329a811
river.cpp
oader.cpp
136b8eb38e98d96009799eee59d4ea0088544b54 24-Mar-2016 Chia-I Wu <olv@google.com> vulkan: move driver::OpenHAL

Move it from loader.cpp to driver.cpp. HAL loading is now done in
driver.cpp while HAL extension queries are still done in loader.cpp.

Change-Id: I15d7ead98497adacb1bd798522f057ff6bf16909
river.cpp
oader.cpp
oader.h
9d51816145b008b7b4b091a8c90faf30ba0394e4 24-Mar-2016 Chia-I Wu <olv@google.com> vulkan: move driver::Debuggable

Move it from loader.cpp to driver.cpp. No functional change.

Change-Id: I455e798d6001f9719d378ae0295f2b4b181b0c09
ndroid.mk
river.cpp
oader.cpp
1f8f46bbccce0f1aabe7f12a6a26d772cd17b5b7 06-Apr-2016 Chia-I Wu <olv@google.com> vulkan: check for unsupported extensions

Return VK_ERROR_EXTENSION_NOT_PRESENT when an app attempts to enable an
unsupported extension. This fixes a regression introduced by my top
rewrite (commit 0c20324: vulkan: rewrite top of loader).

Since we do not cache HAL extensions, each vkCreateInstance or
vkCreateDevice call is preceded by two extension enumeration calls
internally.

Change-Id: I5342c1a5c9a5452dd2bc52933a5ee558db174048
pi.cpp
0c2032490b80178ec823bf22a7f5d08398851cc3 15-Mar-2016 Chia-I Wu <olv@google.com> vulkan: rewrite top of loader

The top is responsible for layer discovery and chaining, and the bottom is
like a regular layer that is always enabled and is inserted just before
the driver. Make the separation clear by rewriting the top and stripping
the layer managment code from loader.cpp.

Change-Id: I64e525e27bd4c297bccd94a1eb9b88e28088e85d
ndroid.mk
pi.cpp
pi.h
pi_gen.cpp
pi_gen.h
ode-generator.tmpl
ispatch.tmpl
ispatch_gen.cpp
ispatch_gen.h
river.h
oader.cpp
oader.h
a76e8ff83811a0f4b98278a3d518d191991d2582 22-Mar-2016 Courtney Goeltzenleuchter <courtneygo@google.com> Install non-working WSI functions if not enabled

b/27537020
These changes make it so that WSI calls dead end if the
application hasn't explicitly enabled them.

Change-Id: I44f95244ec7fd17855daf1c46e9cb6ab4932840f
oader.cpp
oader.h
84cd4c29b9da12c4cd72a72946524b83d44f8a03 16-Mar-2016 Courtney Goeltzenleuchter <courtneygo@google.com> loader: cache top-of-chain PhysicalDevice

Bug: 27615575
If a layer wraps the VkPhysicalDevice object the
loader would be unable to figure out what VkInstance
it was associated with since it no longer matches
the VkPhysicalDevice queried from the driver.
Now cache the VkPhysicalDevice's from the top of
the chain as well to resolve this.

Change-Id: I7d04884dc3aa8623ce2f67e4f6575f74b82e2834
oader.cpp
e177d0619608d3700c9c978c362dbc804a327c46 11-Mar-2016 Courtney Goeltzenleuchter <courtneygo@google.com> Merge "loader: Include instance where required for GIPA" into nyc-dev
4fe2d928aff6bd721cfb576ca1a39f678dba3bcd 10-Mar-2016 Courtney Goeltzenleuchter <courtneygo@google.com> loader: Include instance where required for GIPA

Bug: 27579008
GetInstanceProcAddr is only speced to allow VK_NULL_HANDLE
for the instance for a few calls.

Change-Id: If350e23edc336bff3b499631ba9a68b2921c6969
oader.cpp
5703683fb645a7e31ac25aaf7136013a6a9b9fbc 04-Mar-2016 Michael Lentine <mlentine@google.com> Pass system layers through chain.

Previously if any layers were activated via properties the layers did not see
those as arguments. After this the layers have a complete list of what layers
are enabled. This is then used in the layers to guarantee ordering.

Bug: 27126420

Change-Id: I3a6a923e2564abc3f7c43b110d892539e4d4bfdb
ayers_extensions.cpp
oader.cpp
oader.h
fee714302b86f0d48b417dff7b928f5b825f8e27 06-Mar-2016 Jesse Hall <jessehall@google.com> libvulkan: Fix double-free, refactor instance destruction

Fixes dEQP-VK.api.object_management.alloc_callback_fail.instance.
Since we were calling DestroyInstance_Bottom from both
CreateInstance_Bottom and CreateInstance_Top failure paths, we were
calling the driver's DestroyInstance twice.

To avoid such bugs, this change clears the driver instance handle to
VK_NULL_HANDLE after calling the driver DestroyInstance.

But the real fix in this change is to make creation and destruction
symmetric. Now DestroyInstance_Bottom only cleans up the things that
were initialized/allocated in CreateInstance_Bottom, and is only
called from CreateInstance_Bottom failure paths and from a dispatched
vkDestroyInstance. Similarly, DestroyInstance_Top and failure paths in
CreateInstance_Top call DestroyInstance (formerly TeardownInstance) to
clean up things initialized/allocated in CreateInstance_Top. The
direct calls from *_Top functions to DestroyInstance_Bottom are gone
-- *_Top functions should only reach *_Bottom functions via dispatch,
so the call goes through enabled layers.

Bug: 27493757
Change-Id: I4e9f8508297813415499dc17803fff49ce9abdcf
(cherry picked from commit 15cd1e269fd2dacef8b95006928b122b9dabbeea)
oader.cpp
e6080bf2e54aa0d548b0eb571ad2eef2c52e5fb6 29-Feb-2016 Jesse Hall <jessehall@google.com> libvulkan: Check for negative in signed -> unsigned conversion

Requested during security audit in bug 27118888.

Change-Id: Id82382258d2b6f8523b8af29f494dfc67100d190
wapchain.cpp
c4eee83b6eb4b4ebc67ddda2c7119988ce654101 29-Feb-2016 Jesse Hall <jessehall@google.com> libvulkan: Enable integer sanitization

This causes the compiler to add runtime checks for undefined (e.g.
shift by larger than bitwidth) or suspicious (e.g. unsigned integer
overflow) operations. The process will abort if they occur.

In particular, we do many allocations of the form pfnAllocation(n *
sizeof(T)); if 'n' is large these will overflow and we'll allocate
less memory than expected, possibly leading to exploitable buffer
overruns.

Requested during security audit in bug 27118888.

Change-Id: Id81c94595579df034b948a40270f164e38635070
ndroid.mk
e2948d83f352b9a093252a06757f76a88f5355d3 25-Feb-2016 Jesse Hall <jessehall@google.com> vulkan: Update to vulkan.h 1.0.3

Change-Id: Ic607533768989aa65e41b9b0e459d7af170ab180
ebug_report.h
ispatch.tmpl
ispatch_gen.h
oader.cpp
178b69664a5f56470c143b5930162f285adc83fa 25-Feb-2016 Jesse Hall <jessehall@google.com> libvulkan: Set window transform based on swapchain preTransform

Bug: 26927663
Change-Id: I385a363dccbeae2329d25712d30dc629fdce2074
wapchain.cpp
55bc09788673f8f35bfb2450028827d5ea76c1d3 24-Feb-2016 Jesse Hall <jessehall@google.com> libvulkan: Report current and supported transforms accurately

Bug: 26927663
Change-Id: I99129b49e2be6f6dd501813185edc67f10b976bf
wapchain.cpp
1208622fe6c70c23ab1a06ef1a49cfece08bc1da 12-Feb-2016 Courtney Goeltzenleuchter <courtneygo@google.com> loader: Add extension before CreateInstance chain

A developer can cause the loader to enable VK_EXT_debug_report
extension by setting a specific property. However, that check
was happening after the instance chain was called and thus
no layers saw the extension enabled.
Also fix use of AddExtensionToCreateInfo to always allocate
and insert VK_EXT_debug_report. Otherwise cannot distinguish
between the failure case and the extension is already present
case.

Change-Id: Id64bb14cb2086e94190625b4364329d634afda70
oader.cpp
26d394b868bc89405d4135523214bf2358adf840 07-Feb-2016 Courtney Goeltzenleuchter <courtneygo@google.com> loader: Fix enumerate device extension properties

Same as device layer property issue.
Loader needs to provide aggregate data rather
than send to instance chain.

Change-Id: Ib0e963e8d1780e4870110c556051da921f94353b
ispatch.tmpl
ispatch_gen.cpp
oader.cpp
oader.h
1cc0d37b0f32305e254af01ccba5e93e0761f432 06-Feb-2016 Courtney Goeltzenleuchter <courtneygo@google.com> loader: Fix enumerate device layer properties

Loader was calling down the chain when is needs to
respond with aggregate data. This patch fixes
https://buganizer.corp.google.com/u/0/issues/26982782

Change-Id: I236183d5d781a6efc3d84db4a51376b8cc29664f
ispatch.tmpl
ispatch_gen.cpp
ispatch_gen.h
oader.cpp
oader.h
e6e6968345e12f633bed0add4fa4600e7ccb7542 29-Jan-2016 Courtney Goeltzenleuchter <courtneygo@google.com> loader: Can't dlclose until all done with the layers

The loader was freeing the layers (dlclose) at the
bottom of the DestroyInstance chain. Would get a
segfault when returning from DestroyInstance_Bottom
as layers would try to run that are no longer in memory.

Change-Id: I25cc611fed9d8b3a90fd2652e53cd450daefa08c
(cherry picked from commit 3160835e44fcb0c5367d2f50b132e41c789998d5)
oader.cpp
a90ce61c1a4c0eae79b117f2137e9fe7ed41aa6d 09-Feb-2016 Courtney Goeltzenleuchter <courtneygo@google.com> loader: Implement new layer initialization

We now call down the instance and device chains
as part of the creation process. The loader puts
together "LinkInfo" structures that each layer
uses to reference the next layer down in the stack.
These info structures are attached to the CreateInfo
pNext structure. Also have an info structure that
the loader terminator functions (CreateInstance_Bottom
and CreateDevice_Bottom) that includes loader state
they need.
As part of this the CreateDevice function now lives
on the device chain and it has been split into
Top and Bottom functions. Top builds the LinkInfo
structures and Bottom makes the actual call to the ICD
to create the device object.

Change-Id: I5f5a6d579c34942511cce288ba8fa51f9f89f67f
(cherry picked from commit 9091095245975597a0b2031c3b4847f780c1721e)
ispatch.tmpl
ispatch_gen.cpp
oader.cpp
oader.h
eff631189b135a9579a7f8510f9b1ccadd6fb4f9 09-Feb-2016 Courtney Goeltzenleuchter <courtneygo@google.com> loader: Add GetName and GetDescription for logs

Handy to have more layer detail for logging.

Change-Id: I6933a8fcb90b9cfb70fc85a358244863aac9d702
(cherry picked from commit cf275f37b4a903b5dcc95b5100db667c906aa33f)
ayers_extensions.cpp
oader.h
6fecdd563f3bf94dadedc78512a1b28c08c67e07 03-Feb-2016 Courtney Goeltzenleuchter <courtneygo@google.com> loader: Only use driver's DebugReport if it has one

Change-Id: Ic020b9d5a95c9ddd20dd4c94fd6e7de050b83f2b
(cherry picked from commit b776ba1cff149bb724a1958cc3f470ba5c113b63)
ebug_report.cpp
oader.cpp
3d92c53d99866ddd28c9ff20f610074c82f70d43 10-Feb-2016 Jesse Hall <jessehall@google.com> Merge "libvulkan: Support R5G6B5_UNORM_PACK16 as a swapchain format" into nyc-dev
148a1b45ff2c205f6aa9c46c7f039d29d877a35c 10-Feb-2016 Jesse Hall <jessehall@google.com> Merge "libvulkan: Un-revert and fix VK_PRESENT_MODE_MAILBOX_KHR" into nyc-dev
517274a29e50522a11e65107bb2c0d5b123aa7d5 10-Feb-2016 Jesse Hall <jessehall@google.com> libvulkan: Support R5G6B5_UNORM_PACK16 as a swapchain format

Change-Id: I489cf12965372d5281d200102a4632e6e8d75ede
ndroid.mk
wapchain.cpp
fe2662d9e32d994346e7705c54043d8eb90a3734 09-Feb-2016 Jesse Hall <jessehall@google.com> libvulkan: Initialize VkSurfacePropertiesKHR::supportedCompositeAlpha

Also rearrange the code to set the fields of this struct in the same
order they appear in the struct, to make it easier to tell when
something is missing.

Bug: 26991609
Change-Id: I681ed42c96ac75bb1589d30ab75f760f660eacdd
wapchain.cpp
0ae0dceca1fb83e095d8de6b811aa193def238a0 10-Feb-2016 Jesse Hall <jessehall@google.com> libvulkan: Un-revert and fix VK_PRESENT_MODE_MAILBOX_KHR

This reverts commit 9ec497c, which was a revert of f333922, and fixes
the problem that caused the initial revert.

MODE_MAILBOX corresponds to BufferQueue "async" mode; in that mode we
need one extra un-dequeued buffer at all times. We weren't accounting
for that, and weren't allocating enough bufers.

Bug: 26918467
Change-Id: Ice67e6d16828e50413ae453ecf3c67b8fb288f1a
wapchain.cpp
0a402094986739a2ce1942363370f8e097305933 01-Feb-2016 Jesse Hall <jessehall@google.com> vulkan: Document codegen instructions and code style

Change-Id: I7565506a866b72f4ce31ac6bdd3d97e357497ab0
(cherry picked from commit e0d27bb1f3671401c2f6d84a60111f5c695c97d3)
ispatch.tmpl
ispatch_gen.cpp
ispatch_gen.h
aa6c8727ac49610eb1b94e06ecd1c319edabc792 29-Jan-2016 Courtney Goeltzenleuchter <courtneygo@google.com> loader: Test for valid ICD before init dispatch

Test that the Instance object returned by the ICD
is valid before initializing the loader's instance
dispatch table. Not a huge deal since that test
should never fail in production, but flows better.

Change-Id: I7063fb797038e05ea2d0cf9b0794f668b3510cde
oader.cpp
9ec497c4a14cc33ed1fa88b3f920d3467ab49cc9 29-Jan-2016 Courtney Goeltzenleuchter <courtneygo@google.com> Revert "libvulkan: Implement VK_PRESENT_MODE_MAILBOX_KHR"

This reverts commit f333922399393609f5bf022a3467b7541bd1ad0f.
Hologram demo dies with this change.
wapchain.cpp
9f763498058756b2c202d917075533142f86cdf0 22-Jan-2016 Jesse Hall <jessehall@google.com> libvulkan: Fix dEQP-VK.api.object_management.alloc_callback_fail.device

In vkCreateDevice, we were using the app-provided allocator if available,
otherwise the instance allocator. (The code also fell back to the
default allocator if the instance didn't have an allocator, but it
always does, so the fallback was dead code.) That's all as it should
be.

However, we don't store the app-provided allocator, and everywhere
else just uses the instance allocator. In particular, vkDestroyDevice
ignores the app-provided allocator, and just uses the instance
allocator to free the Device structure. That causes the test to fail,
since we use the app-provided device allocator to allocate, but the
instance allocator to free.

Getting this right will require some possibly large restructuring and
careful review of the code. In the short term, this change just
ignores the app-provided allocator in vkCreateDevice and uses the
instance allocator instead, so that at least we use the same allocator
for alloc and free. Bug 26732122 filed to do this properly.

Change-Id: I4ed4c12dfa255bb58a33dca1a89946255276c791
(cherry picked from commit 58579313664f5d72706f8e3df50b4e7217f7326b)
oader.cpp
26cecff368f2edba67d136ce00d27bb55634c0f1 22-Jan-2016 Jesse Hall <jessehall@google.com> libvulkan: Fix dEQP-VK.api.object_management.alloc_callback_fail.instance

The loader was crashing when a std::vector::resize() operation called
the test-provided allocator, which returned failure, and then the
vector blindly started writing into the returned pointer.

Obvious in hindsight, but stdlib containers+strings + user-provided
allocation funcs implies that the loader must be built with exceptions
enabled, and must be exception-safe at least where it uses
containers/strings. We were doing neither.

This change has the minimally invasive fix, which is to (a) throw an
exception from the stdlib Allocator when the app-provided allocation
function fails, and (b) wrap every stdlib operation that might
allocate in a try..catch and turn it into a
VK_ERROR_OUT_OF_HOST_MEMORY error.

This is pretty unsatisfying and I'm not happy with the resulting
mismash of error-handling styles, with having exceptions at all in
code that was not written to be exception-safe, or with the
fine-grained try..catch. We need to decide whether to keep using parts
of stdlib that can allocate, and rewrite a lot of code to be
exception-friendly, or we need to replace the stdlib code with manual
containers and strings. Bug 26732452 filed.

Change-Id: I6f096f25a43a0e3c5f56796c2af19f114d2edac6
(cherry picked from commit ccca46db073dfadc81a68ac1533d8859ed3e109a)
ndroid.mk
oader.cpp
wapchain.cpp
4b62e4fd280d4f7a24f906a83ff16f5cd74bf171 21-Jan-2016 Jesse Hall <jessehall@google.com> libvulkan: Fix dEQP-VK.api.device_init.create_instance_unsupported_extensions

The existing check was only executed if the driver reported at least
one instance extension, because it was part of filtering the extension
list down to just the ones supported by the driver. Now do it
separately, and before we do anything else.

Also changed the null driver to not report any extensions; reporting
an extension masked the bug for me when I ran this test before.

Change-Id: I2b62229c6acbc9406c036f1f1b766a21c03922d4
(cherry picked from commit 1f7e9e0e771ac4045c5f669290dc01b01dd01342)
oader.cpp
54e6f086a6b373a0f496343451a76dde8aa86238 20-Jan-2016 Michael Lentine <mlentine@google.com> Fix ref count.

Modify the move constructor to zero out the other pointer so that it doesn't
get decremented when the ref goes out of scope.

Change-Id: Ieb81c64b760dc69e262a76335039c9c7f9050780
(cherry picked from commit 22440b22bbce1fe7b5411e6641156661e25a2865)
ayers_extensions.cpp
d0b7cb566288a4f6646e356a17188b7922ba5740 19-Jan-2016 Michael Lentine <mlentine@google.com> Activate layers when the strings match.

Change-Id: I7bf6ba2bfe215b2dad671b3996f421313d72d3a2
(cherry picked from commit 90c828766ae8d560ed254fd434ad872cd6b21eb0)
ayers_extensions.cpp
f333922399393609f5bf022a3467b7541bd1ad0f 18-Jan-2016 Jesse Hall <jessehall@google.com> libvulkan: Implement VK_PRESENT_MODE_MAILBOX_KHR

Change-Id: Ibbb11849c7a59236e27af32148ab5c5fb22d9b19
(cherry picked from commit 388e6ab8bc0067f88147e68dd20d5c2b6b1e3213)
wapchain.cpp
993849ce2f3ebc7f39ed360f10b6874a0b897157 18-Jan-2016 Jesse Hall <jessehall@google.com> libvulkan: Really only write vkCreateInstance out parameter on success

Change-Id: I7efc7dba420565781f15610bbfa7dfd1be1cf84d
(cherry picked from commit 92707024c23b737cad16366ee7380a00e88a797e)
oader.cpp
ae3b70dea59236780aa909338de1ba5201603439 18-Jan-2016 Jesse Hall <jessehall@google.com> libvulkan: Return error if an unsupported instance extension is requested

Change-Id: I93d4a2a0b991682160c0ffe401f2b2b19f6e2be3
(cherry picked from commit 8a69c0845de6884377da2221ae3272b8dac03d55)
oader.cpp
c55fa944f9882621cd1005fcae5e3076c68b0d1d 18-Jan-2016 Jesse Hall <jessehall@google.com> libvulkan: Only write vkCreateInstance out parameter on succes

Change-Id: If9f2924caa1c9da4d12eb2d4730e03ea4af0d113
(cherry picked from commit 7adb6e70a83be579e7059ca9fd3b1a2f25d58390)
oader.cpp
b147127b06c1ce6443839e8102d1ed2631a57b07 18-Jan-2016 Jesse Hall <jessehall@google.com> vulkan: Driver device extension enumeration and filtering

- Return VK_ERROR_EXTENSION_NOT_PRESENT if a requested device
extension is not supported by the loader, driver, or any enabled
device layer.
- Filter out device extensions not supported by the driver when
creating the driver device.
- Enumerate device extensions supported by the driver or loader.

Change-Id: I538e37bc74cc7f0eb27b1211b9324fb3b8a06e14
(cherry picked from commit 35873021f4f79ded0f584e433076c2675c6aed69)
ayers_extensions.cpp
oader.cpp
oader.h
57f7f8c140c4b665f05c17866ebf201e9f4f46a4 18-Jan-2016 Jesse Hall <jessehall@google.com> vulkan: Enumerate device layer extensions

Change-Id: I453d815ffd910fd56103f1c624cca63ac2014df8
(cherry picked from commit 82a2b6626286610f417df3d48b8e9a56e3726f38)
oader.cpp
aa410941d29cba4a3a56e90cb3f0be3f03c76cea 17-Jan-2016 Jesse Hall <jessehall@google.com> libvulkan: Enumerate device layers

Change-Id: I7623eab3d8bb958470437998ba603ac1171d764c
(cherry picked from commit eab7505b0741dc5c062df889a7ca5db1a9e619e8)
ayers_extensions.cpp
oader.cpp
oader.h
715b86ac7d0853131b375ff786c87d8d87a762a1 17-Jan-2016 Jesse Hall <jessehall@google.com> vulkan: Support VK_EXT_debug_report in loader and nulldrv

* Add extension to vulkan.api.
* Fix a few errors in upstream vk_ext_debug_report.h; bugs filed.
* Loader enumerates extension iff the driver supports it.
- TODO: Also enumerate if any layers that support it are implicitly
enabled.
- Note extension may still be enabled if any layer supports it.
* Add loader bottom procs for the extension functions. These will call
through to the driver version if the driver supports the extension.
* Add no-op support to nulldrv, mostly for testing the loader.

Change-Id: I092d2da56ee4c64498f8edae75e0d995478bb6f2
(cherry picked from commit a5ef7c27bc85e3628814532a32ffb9a5c33c4b73)
ndroid.mk
ebug_report.cpp
ebug_report.h
ispatch.tmpl
ispatch_gen.cpp
ispatch_gen.h
ayers_extensions.cpp
oader.cpp
oader.h
wapchain.cpp
6bd5dfa9b94d1f1b2d9b6bae52979502c44c2847 17-Jan-2016 Jesse Hall <jessehall@google.com> libvulkan: Only load driver functions for enabled extensions

Change-Id: I4105291bd42583a10420681b729f03ecd7a91724
(cherry picked from commit 1c77ae2acda376b791932beffcb931c378e8ee36)
ispatch.tmpl
ispatch_gen.cpp
ayers_extensions.cpp
oader.cpp
oader.h
563380d389732337a84e7455caa01ec955ebee30 16-Jan-2016 Jesse Hall <jessehall@google.com> vulkan: Update to version 1.0.1

Change-Id: Ib5d538bbcdf61f96bcfc0270b0e461927dd0b15b
(cherry picked from commit bfdbddcaf74d05966cde0f260a3d7da5a5b2d591)
ispatch.tmpl
ispatch_gen.h
504db7fc09f9a6716dbc1b9849760283d94c9d60 15-Jan-2016 Jesse Hall <jessehall@google.com> libvulkan: Disable accidentally-enabled verbose logging

Change-Id: Iab25e06607b173d9ea04fca79b0e8e8386dd0f0d
(cherry picked from commit 4b31dcd677ee868d99ef07890af425e10fd5bf0c)
ayers_extensions.cpp
oader.cpp
d913282acf5c689cf5297a93604c6c10007bf6e9 15-Jan-2016 Jesse Hall <jessehall@google.com> libvulkan: Load vkGetSwapchainGrallocUsageFlagsANDROID from driver

Change-Id: I1def2505024e4c6f13534820079662be9e8658ce
(cherry picked from commit ac9e053e639a9279d36b4bfbaa24fcc3b29b36c9)
ispatch.tmpl
ispatch_gen.cpp
30ac78b43ce408eb6d666c8667d184b8e44ed9e6 12-Jan-2016 Jesse Hall <jessehall@google.com> vulkan: Fix 64-bit compilation errors

Change-Id: I5f76ae6bb517d39c3461e95421444121a093b7da
(cherry picked from commit 9f434d3bbe473d93c7801f2f618ae02aa2318950)
ayers_extensions.cpp
275d76c8158c90ec5317b82cb10b094bca2b43cf 09-Jan-2016 Jesse Hall <jessehall@google.com> vulkan: Pass vkQueuePresentKHR wait semaphores to vkQueueSignalReleaseImageANDROID

Change-Id: I4073ced5e0e155d424699f636654ec226cd9d91c
(cherry picked from commit 69ce2beade5386111ef85382cc659a439a5a3b44)
wapchain.cpp
a7ac76df54c30e771ecfd05cdd2b52209af71470 09-Jan-2016 Jesse Hall <jessehall@google.com> libvulkan: Filter layer and extension lists passed to drivers

This change removes the layer and extension lists requested by the app
before passing the instance/device create info to the driver. For
device creation, it adds the VK_ANDROID_native_buffer extension. There
are several new TODOs describing the work left to do here: mostly,
when we properly enumerate instance and device extensions supported by
the driver, we need to use those same lists to filter the extensions
requested by the app.

Change-Id: I27c528d7bbbcb281d1bf6afec2318394831154a0
(cherry picked from commit 258cdce2c0e28b13c887c3d0ad5734a007393368)
ayers_extensions.cpp
oader.cpp
3dd678a6a30e2d94bfd570ec43ffd379e9c5d409 09-Jan-2016 Jesse Hall <jessehall@google.com> vulkan: Update from version 0.221.0 to 1.0!

Change-Id: I9453454cc47046ad9f64a72a812a4e5da694c223
(cherry picked from commit 3fc8ed14c5d6890348400bf3e6dab2870b3fbbc5)
ispatch_gen.cpp
oader.cpp
wapchain.cpp
543a7ffb9845637b4dc0d40898bf5b1057dbc3ea 09-Jan-2016 Jesse Hall <jessehall@google.com> vulkan: Update from version 0.213.0 to 0.221.0

Change-Id: I872fcb4a020c9b9326cec0a8217a68d822d0a6e9
(cherry picked from commit 20e04407f51b6525eded4fbc3404e36a61e1b464)
oader.cpp
f9fa9a50d5e87dacce36ef2a56b392fc053cf8ce 09-Jan-2016 Jesse Hall <jessehall@google.com> vulkan: Update from version 0.210.1 to 0.213.0

Change-Id: I441a2ddf872298a5415b40299fc1143c879c5e86
(cherry picked from commit 842515ca8d8705627e3ce7c196405cac60707629)
ispatch_gen.cpp
oader.h
wapchain.cpp
80523e2e39c29b06ab40573468dde43a9867f487 07-Jan-2016 Jesse Hall <jessehall@google.com> vulkan: Implement layer and extension enumeration

Change-Id: I485ebbe3e57da396d361f772793e1e89850c334c
(cherry picked from commit 4bee2c3f2fdff04f1eb437f24a7bcf841364d5b3)
ndroid.mk
ayers_extensions.cpp
oader.cpp
oader.h
1f91d390ac013ea2514a67e12ddb083119d636d7 12-Dec-2015 Jesse Hall <jessehall@google.com> vulkan: Implement new vkGet*ProcAddrBehavior

The primary goal of this change is to switch to the revised GPA
behavior:
- GIPA(NULL, ..) only works for non-dispatched (global) commands
- GIPA(instance, ..) returns functions for commands that dispatch on any
object type, and the function works for any object of the appropriate
type if it is a child of the instance.
- GDPA(NULL, ..) returns NULL.
- GDPA(device, ..) returns a device-specific function for the command.

This change refactors/tidies many of the things it modified. Some
notable changes:
- All the loader generated code is now in dispatch.tmpl ->
dispatch_gen.{h,cpp}, instead of two separate templates.
- Reorganization allowed generating the dispatch table structures,
eliminating one source of frequent bugs.
- Removes some error-prone macro duplication.
- Handling of extensions and special loader functions is now much
more uniform and hopefully clearer.
- Loader top- and bottom-level functions are now consistently named with
_Top and _Bottom suffixes, and are grouped by level in loader.cpp.
- The VkInstance and VkDevice implementations are no longer derived from
::VkInstance_T and ::VkDevice_T. Was more trouble than it was worth.
- Renamed 'vtbl' to 'dispatch' in most places.
- Renamed nulldrv template and generated files to match the loader
naming pattern: null_driver.tmpl -> null_driver_gen.{h,cpp}
- Now all the entry point prototypes are generated, instead of having
to be updated by hand (another source of several bugs).

Change-Id: Ic263f802d0d523b18a0f00420b3a722aa04ce299
(cherry picked from commit 3cffb8e837222f413a1fe53522e2cc33366b8eeb)
ndroid.mk
ispatch.tmpl
ispatch_gen.cpp
ispatch_gen.h
ntry.cpp
ntry.cpp.tmpl
et_proc_addr.cpp
et_proc_addr.cpp.tmpl
oader.cpp
oader.h
wapchain.cpp
21597661b5cabc73f8d14bd0091eea7bddafdcbe 18-Dec-2015 Jesse Hall <jessehall@google.com> libvulkan: Update global layer loading rules

* Look for layers in /data/local/debug/vulkan instead of
/data/local/tmp/vulkan.
* Only enumerate global layers in debuggable processes.
* Only allow force-enabling layers and callbacks in debuggable
processes.

Change-Id: I1f41a03ecbb0cc159e7dbb0b424005559996c196
(cherry picked from commit e784c114bbdc32361096cce8f59eb9513390e2d6)
oader.cpp
c838b08ddbf8fea8bb1e541bf0453d1858d064ba 05-Dec-2015 Jesse Hall <jessehall@google.com> libvulkan: Add missing instance entry point dispatch init

Change-Id: Ib7db123ce91b0f488230988d66e6b627f0ac8645
(cherry picked from commit c00a23cb61f64a7c82cfab2b2c19ab15b5805348)
oader.cpp
oader.h
061938022b3f5f37f7aaebf7ccc8ac20bf4dbf97 04-Dec-2015 Jesse Hall <jessehall@google.com> libvulkan: Implement new VkFence parameter in vkAcquireNextImageKHR

This parameter was added recently but wasn't hooked up. This adds a
new parameter to the vkAcquireImageANDROID extension function, and
plumbs the fence through from vkAcquireNextImageKHR to it.

This change also fixes some function signatures for API functions that
are implemented in the loader bottom rather than the driver. These
functions are only ever called through function pointers returned by
vkGet*ProcAddr, and therefore pass through a cast to
PFN_vkVoidFunction. So the compiler had no way to know they were
supposed to match a particular prototype, and couldn't issue an error
when they didn't. This change adds explicit static casts to the
expected function pointer type before reinterpret casting to the
generic function pointer type to enable compile errors.

Change-Id: I8a7e065502f783d5f2381b43c880644868234f8f
(cherry picked from commit f62f5de0c60212796b6d910cbd194c7002226264)
oader.cpp
oader.h
wapchain.cpp
2ca1bd55bc4f2320e16ea3553117252017921008 03-Dec-2015 Jesse Hall <jessehall@google.com> libvulkan: Fix missed vkAllocateCommandBuffers renames

Change-Id: Ic3fee0d565009327f524084b14da498c8412155f
(cherry picked from commit 3b8513e831673417af2ad79baa6c73710742fa0f)
ntry.cpp
ntry.cpp.tmpl
oader.cpp
oader.h
bd88884111a3ef38322741c15de9bd215f7a7eb9 01-Dec-2015 Jesse Hall <jessehall@google.com> vulkan: Update from version 0.210.0 to 0.210.1

Change-Id: I9adf217587a8b666bcf04818004dce4e97b87fd1
(cherry picked from commit 871aab516eafee2ede88b095dad6670b06ab6f8a)
ndroid.mk
9ba8bc8d8769cd4d7b56b44222323b7f06783b11 01-Dec-2015 Jesse Hall <jessehall@google.com> vulkan: Update from version 0.209.0 to 0.210.0

Change-Id: Ic5791cf1193de1e5d2ce355d9dcc4450b0def85a
(cherry picked from commit 5fa30181e473f9055884404545e7345c75440e64)
et_proc_addr.cpp.tmpl
f4ab2b18391ab5045b44af9ea1d5698af7c2a0cd 01-Dec-2015 Jesse Hall <jessehall@google.com> vulkan: Update from version 0.206.0 to 0.209.0

Change-Id: Ieaf1c4c01f3376cde407bef193a9aa33e77ca123
(cherry picked from commit 91b3c3599ea5095388c4bdeb14f09529f3fbb9cc)
ntry.cpp
oader.h
wapchain.cpp
dba27f71fad236f08deae3d0b987e83700b32f94 30-Nov-2015 Jesse Hall <jessehall@google.com> vulkan: Update from version 0.205.0 to 0.206.0

Change-Id: I36370f6ec41abf235975a0c769c03c8f25851d14
(cherry picked from commit c7d7dcfffafda197458d6c4afebb486bd64e0d53)
ndroid.mk
wapchain.cpp
0e74f00af03b7e705774d0dcf69c2ba8ce7a15a8 30-Nov-2015 Jesse Hall <jessehall@google.com> vulkan: Update from version 0.204.0 to 0.205.0

Change-Id: Ic0b91f338bcddc50b4617da266347ae8b9cc29fa
(cherry picked from commit 052ac57d4c70d934d76fb5cd94278c326e623963)
ntry.cpp
oader.h
wapchain.cpp
e1b12783fff0b8e2defcc94c54fac8d737e6b996 30-Nov-2015 Jesse Hall <jessehall@google.com> vulkan: Update from version 0.203.0 to 0.204.0

Change-Id: I2de0935df66b0110b566ed2025c39e0c17b98f17
(cherry picked from commit 79c20c98e47ce5a7d0608cda59b19d153455cbae)
ntry.cpp
ntry.cpp.tmpl
oader.cpp
oader.h
wapchain.cpp
a9e5703e380d9d7f096d177adb792621a1e8d4ba 30-Nov-2015 Jesse Hall <jessehall@google.com> vulkan: Update from version 0.202.0 to 0.203.0

Change-Id: I21a390bd57082194f6131b118ecd6c94874d2f7f
(cherry picked from commit 5f1b8406c88d20f23e77426d4d786caca659540b)
ntry.cpp
oader.cpp
wapchain.cpp
091ed9e69400edcc549c9b11635d1a305d6b5a83 30-Nov-2015 Jesse Hall <jessehall@google.com> vulkan: Update from version 0.200.0 to 0.202.0

Change-Id: If8eb49cd7e5516931f9900b691d6d32af2aa98b0
(cherry picked from commit 5b9c3a1af7088351d49431a496ef9f7fd078e9f6)
ntry.cpp
oader.cpp
wapchain.cpp
3e0dc8f0d9f4de86ac61c4d3c33c3958f35e0a25 30-Nov-2015 Jesse Hall <jessehall@google.com> vulkan: Update from version 0.198.0 to 0.200.0

Change-Id: I071a9143332dd8b8c2ef899105073ed8791fc5db
(cherry picked from commit 9568691bea351152b340c0cbb3d31e5246ac469b)
ntry.cpp
ntry.cpp.tmpl
et_proc_addr.cpp
et_proc_addr.cpp.tmpl
oader.h
65ab552c18df3e94c5d275294a20dd4d20dda119 30-Nov-2015 Jesse Hall <jessehall@google.com> vulkan: Update from version 0.197.0 to 0.198.0

Change-Id: I182b21c68374e8eae962b2ae391bb283f07d5517
(cherry picked from commit ef5b7de781a9d803be4fba7ba243e6e96dd61851)
ntry.cpp
3fbc856120217247c72fb5ed88500000f3881c45 30-Nov-2015 Jesse Hall <jessehall@google.com> vulkan: Update from version 0.194.0 to 0.196.0

Change-Id: Ib62cc358b1f2575daeaa2a893eb4afca458ec5c3
(cherry picked from commit 48e9a8af39134fc2e995867668e113e56931167b)
ntry.cpp
ntry.cpp.tmpl
et_proc_addr.cpp
oader.cpp
oader.h
wapchain.cpp
b00daadc165d4c3fad13b7cc4aeaa1e85e6df9a0 30-Nov-2015 Jesse Hall <jessehall@google.com> vulkan: Update from version 0.192.0 to 0.193.0

Change-Id: I4387b28368c38c5165c1da99d8dc4e632ad2b42a
(cherry picked from commit d0534c33c98e8f0c844b37df7c764c9dbd6bbaa3)
ntry.cpp
et_proc_addr.cpp
oader.cpp
oader.h
wapchain.cpp
dc6d36cb7f1d35059ae8153168e379fc925cb468 30-Nov-2015 Jesse Hall <jessehall@google.com> vulkan: Update from version 0.190.0 to 0.192.0

Change-Id: I5d38543a4ae1c522cacb45a3c011ceab62d2e1d5
(cherry picked from commit c10af6dde1e91deb70ef055838f1b51240fc66f2)
ntry.cpp
a64292517b1876c4bbe5d3e62c577812f40bd922 30-Nov-2015 Jesse Hall <jessehall@google.com> vulkan: Update from version 0.189.0 to 0.190.0

Change-Id: I0ac3f2797b65ef49cca90e76a47f1e6ca3a341a3
(cherry picked from commit 888efcf06fdbfa02587ffbfaa8fe6ca8e1b6e58a)
ntry.cpp
et_proc_addr.cpp
et_proc_addr.cpp.tmpl
oader.h
wapchain.cpp
23ff73fe377acb99b5ea1824d5a11320bdaee745 29-Nov-2015 Jesse Hall <jessehall@google.com> vulkan: Update from version 0.188.0 to 0.189.0

Change-Id: Ib8171ce1d3f804f9a866e1c216db0911043056c6
(cherry picked from commit 48c1928e091dd7eb6ca4fc6564e0be072028c38a)
ntry.cpp
03b6fe1b099764c6010c173c1416ea102cdfe5a4 24-Nov-2015 Jesse Hall <jessehall@google.com> vulkan: Update from version 0.186.0 to 0.188.0

Change-Id: Ida08d51f4e892202b594072d1e765ba5c55444db
(cherry picked from commit 2ca0449bdeecd0257c7473f663896b00d0082def)
ntry.cpp
oader.cpp
oader.h
wapchain.cpp
a3a7a1d37bdfad56245b75edac49f8aceded321d 24-Nov-2015 Jesse Hall <jessehall@google.com> vulkan: Update from version 0.185.0 to 0.186.0

Change-Id: I6acb7742a1d4628930bc0807adfd222bc8349c43
(cherry picked from commit 9148de67a84540aa7d70ae72fbf587e26cbd0891)
ntry.cpp
wapchain.cpp
6f39a6d1c6202b5d1bb0aa0dc9b2e130e5b73666 24-Nov-2015 Jesse Hall <jessehall@google.com> vulkan: Update from version 0.184.0 to 0.185.0

Change-Id: I1d6012db32441fe3a99480bfed0e41dfce068980
(cherry picked from commit 8b07f118b46ae01f709e7bfd92e29c6f6df5d7c0)
ntry.cpp
et_proc_addr.cpp
oader.h
a9bb62b44be381292b893055cd01cdc89ba55c97 22-Nov-2015 Jesse Hall <jessehall@google.com> vulkan: Update from version 0.183.0 to 0.184.0

Change-Id: I11802010d9171877e3fc8cc6e0931f8c746660c4
(cherry picked from commit 821c3aebdbac594a9b977e8183a863bed7419132)
ntry.cpp
et_proc_addr.cpp
oader.h
1356b0d3179254a7a27e88abb2d2500385469f14 24-Nov-2015 Jesse Hall <jessehall@google.com> 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)
ntry.cpp
ntry.cpp.tmpl
et_proc_addr.cpp
et_proc_addr.cpp.tmpl
oader.cpp
oader.h
wapchain.cpp
fbf97b0e5e25349b951dce1016b263ec3acbf376 20-Nov-2015 Jesse Hall <jessehall@google.com> vulkan: Update from version 0.181.0 to 0.183.0

Change-Id: I721bfc6891974e2bab7dce7e92e7884de360412a
(cherry picked from commit 85009ebe92a71d3c707efad6387118b186cca0c9)
ntry.cpp
et_proc_addr.cpp
oader.cpp
oader.h
a15a4bf4bafd6114ae8f28c2df2fc622cb3baace 20-Nov-2015 Jesse Hall <jessehall@google.com> vulkan: Update from version 0.180.0 to 0.181.0

Change-Id: I4a7e216d9966f2dcf873bcb952472463dfb59f95
(cherry picked from commit 2c3539bab4b81b6e55d690c5e113d3421cc15021)
ntry.cpp
wapchain.cpp
a366a5186ea941c5653cbdb8df18dc19318912b6 20-Nov-2015 Jesse Hall <jessehall@google.com> vulkan: Update from version 0.179.0 to 0.180.0

Change-Id: I2cbf4a8b065e8150734d76d614ab0850bc8324dc
(cherry picked from commit 2b2221bd4c5cbc2580bf7b4e487bffe36fd25c4a)
ntry.cpp
606a54e194a5884c628130ba2eda1b3bfbc157d7 20-Nov-2015 Jesse Hall <jessehall@google.com> vulkan: Update from version 0.177.0 to 0.179.0

Change-Id: I4d596efec04a712d7b38323e012282fe9f98192b
(cherry picked from commit daf915168b0aea3a47401a838448d737e955c154)
ntry.cpp
oader.cpp
oader.h
wapchain.cpp
ae38f7355fd03b777313e13586585a74e0dee05b 20-Nov-2015 Jesse Hall <jessehall@google.com> vulkan: Update from version 0.172.2 to 0.174.0

Change-Id: If89614476735e5fb83cbeb4cf473e32e6f0cc386
(cherry picked from commit 18896311f868ab1b2b8a9a6ca34de4c0de6cf0d7)
ntry.cpp
et_proc_addr.cpp
oader.h
9a86ad29160baaeb0efca60d4f554b25d8ff4787 21-Nov-2015 Jesse Hall <jessehall@google.com> libvulkan: Remove dead special cases in GetDeviceProcAddr

Change-Id: I58c5cad288f3d96acc9903a2323ec9fcf21798fd
(cherry picked from commit 18f7ae3776050529c3c244e639eb5095808963d9)
oader.cpp
2818f93c5bc8b186d3455a1ea2fce900e7403465 20-Nov-2015 Jesse Hall <jessehall@google.com> vulkan: Update templates for generated extensions

When the swapchain extensions were added to the API file, only
the libvulkan/get_proc_addr.cpp template was updated. This change
updates the remaining templates, so that when used they generate the
appropriate output with the new API file:

- libvulkan/entry.cpp: Remove hardcoded extension entry points, now
that they're autogenerated.
- nulldrv/null_driver_gen.cpp: Exclude all extension entry points;
this only works because the API currently only includes entry points
implemented by the loader. Eventually we'll want to replace this
with an extension blacklist.

Change-Id: Id6ea11fb739390d8262fa5ce77c213fbbdeb0148
(cherry picked from commit 1d40de6ecdd74c47ebd40fadd5926cc2984cc91c)
ntry.cpp.tmpl
1d1e65fabaf087d4a42157e376de792e8a60e4b5 19-Nov-2015 Michael Lentine <mlentine@google.com> Don't remove elements while iterating through active_layers.

Change-Id: I595e51aea635dad13b6e919dee2229defc4da55a
(cherry picked from commit b735b6d52dad4d72e16968aa66a8282df2c733ea)
oader.cpp
233ac731b66da49e2f6611ed8c4ffcdcf893066b 19-Nov-2015 Michael Lentine <mlentine@google.com> Don't assume layers exist when prop is set

Previously we assumed that layers were valid when set via adb
shellprop but instead we should make sure they exist first. If they
don't ignore it and continue.

Change-Id: I161b7afa58e747080a9eeb112f933976a381b4c0
(cherry picked from commit c9625127034ab237da69d7da766e20d666545b13)
oader.cpp
88594d744093a8429030cf4f4a9ec22f25dfd500 12-Nov-2015 Michael Lentine <mlentine@google.com> Add WSI functions to the loader.

Modify vulkan.api to include the WSI functions.
Add new wsi functions to generation in get_proc_addr.cpp.tmpl
Add bottom entry points because the WSI functions are not exposed in the
driver.

Change-Id: I63c3a099a489496205b0a9eb82c005a5a48642a1
(cherry picked from commit 23b68ac9fcd2df06ffcc25cf8c4f794dd447bbd1)
et_proc_addr.cpp
et_proc_addr.cpp.tmpl
oader.cpp
ab9aeef063119445b59166f781c464c64e3909db 04-Nov-2015 Jesse Hall <jessehall@google.com> vulkan: allow drivers to see image acquire/release

Change-Id: I8143aeebd1f65142486cc55662c685d081ba41eb
(cherry picked from commit 58b4df743ecad9f1a0fc7cb7c0f5340dd8365308)
et_proc_addr.cpp
et_proc_addr.cpp.tmpl
oader.h
wapchain.cpp
70f9335d77282e34fa1cdb8d1baed89892ccd2e1 04-Nov-2015 Jesse Hall <jessehall@google.com> vulkan: Allow drivers to add private gralloc usage flags

Change-Id: Iea33990b3a85a761e27d54bb323d866267c88901
(cherry picked from commit c040fbedde52d632a7ceeef3a9266d35b22ce53f)
et_proc_addr.cpp
et_proc_addr.cpp.tmpl
oader.h
wapchain.cpp
f64ca1209c4b67baf36d6f489d3c73067113d419 04-Nov-2015 Jesse Hall <jessehall@google.com> libvulkan: enable scaling for all Vulkan swapchains

Change-Id: I0abe28a06dd24c317ed87270996d308411cb6fa1
(cherry picked from commit 6780552a6f17ee809ecf9b3538bbf9b666d5a160)
wapchain.cpp
d1d5e5eb4c8314c05ac31d3be0baafbcb8175913 03-Nov-2015 Michael Lentine <mlentine@google.com> Remove Noop and move message removal.

Previously there were two Noop functions when only one is needed.
Additionally, the debug message was getting removed after the
layer was removed which is incorrect.

Change-Id: Ibee29b5395a8756c5a3e5c70df8e4723abb63e2b
(cherry picked from commit 262b1bddd775510584b50921e007d9eb6d8029c4)
oader.cpp
0ecdd3ed24fa0a55bad81f31a3d3480e8745d6ef 29-Oct-2015 Jesse Hall <jessehall@google.com> libvulkan: Don't log error if layer dir doesn't exist

It's normal for the global layer dir to not exist, and would be a
serious system bug if the APK native library dir didn't exist. Either
way, a VERBOSE message will be seen by the appropriate people, without
spamming the log during normal operation.

Change-Id: I7419b46304bb98b4dbb6d02effff0a4062c6de79
(cherry picked from commit e0059ade3836ec778f16a7c8998d056a21d2a7ab)
oader.cpp
74f28ddb5e9812c2f13bed4e9856ccba8d8e0d3b 30-Oct-2015 Jesse Hall <jessehall@google.com> libvulkan: Fix check for redundant vkDeviceQueue calls

dEQP test sets typically create a device once, but call
vkGetDeviceQueue in each test case. Due to this bug we were failing
all but the first call.

Change-Id: If5a07ae23d630e64d06b7028b7e62f389533da43
(cherry picked from commit 8be3d02cb116d82aac0e2c8f50168d816bfec4a0)
oader.cpp
9a16f975921e48bf1f6ccbfb5b5e225f84182b22 28-Oct-2015 Jesse Hall <jessehall@google.com> libvulkan: Fail instance/device creation if requested layer not present

Change-Id: I27177597e1aa8f22fa97ee60c5ff8dea6a7dde95
(cherry picked from commit 4113c6571109e03cc99dfb6a073e742c30478abd)
oader.cpp
6614a5776d4ed9d3ed952b08669a09a671bd358a 23-Oct-2015 Jesse Hall <jessehall@google.com> vulkan: Fix GetSpecific*ProcAddr for extension functions

Change-Id: Ib19e08b9e057affe348e0da5e6840e139d4ec292
(cherry picked from commit b7f5ef5d5fee72fc16fb3e883b0d1725f2c7feed)
et_proc_addr.cpp
et_proc_addr.cpp.tmpl
eb97086a28f78a32e2615f6a399617c31651c3b1 15-Oct-2015 Michael Lentine <mlentine@google.com> Update DEBUG_REPORT extension and callback for v170.2

Change-Id: Ica7bb0fb738804c48f165409882086d0300bc294
(cherry picked from commit 647626135721fc28d36364031f04a1541719fb5e)
oader.cpp
5ae3abb3ca6728de04935b0c81bcdbdfc37b0d47 08-Oct-2015 Jesse Hall <jessehall@google.com> vulkan: Update from header 0.138.2 to 0.170.2

Change-Id: I011e1f27d025730d448ee5cfefc6701300b455c2
(cherry picked from commit 6761b6067555557599e8c30096614642a5223646)
ntry.cpp
et_proc_addr.cpp
oader.cpp
oader.h
wapchain.cpp
9da191b8be6cabf24640cc4fc360bafaaccc615b 13-Oct-2015 Michael Lentine <mlentine@google.com> Add support for longer than 12 character layers.

Change-Id: Ic2bf1c21a962e0921a68ec58946817518468c8b0
(cherry picked from commit 17d4cf3b87c688ec35320d3061e26862a891233b)
oader.cpp
9dbe67ff98cb63c9150d76e16cced51c5d241139 16-Sep-2015 Michael Lentine <mlentine@google.com> Allow for different layers to be active per device

Change-Id: I947ec25bc44072bec825a78fa6ddda3121e1f818
(cherry picked from commit dd12a76d6a89e0fcab4a4adcaec190d8b50909c5)
oader.cpp
1c69b9e33e34c6aef571b8383bdb7e2b3a5e0849 14-Sep-2015 Michael Lentine <mlentine@google.com> Add support for loading layers from the apk.

Added the vulkan_layer_path interface which is used to set the path from
ThreadedRenderer. The vulkan loader then uses this path to search for layer
libraries that come preinstalled with the app.

Change-Id: Iee7d56c1950296ba5ece3a119741406d705479a8
(cherry picked from commit 1f920c1e52bbd59405761e5403def5dbc22e331b)
ndroid.mk
oader.cpp
ulkan_loader_data.cpp
cd6cabf0e28e2246d94207dc7ef449049cd4d9f6 15-Sep-2015 Michael Lentine <mlentine@google.com> Add default callbacks in the loader.

Change-Id: I23d7945efb0fd372e614f895278fc86a853fe429
(cherry picked from commit 9b9938127d1c68cda9b709524aea44ffb0de77b9)
oader.cpp
b467c0d6de04f2dbac598cf1bba999ce9da69bbf 14-Sep-2015 Michael Lentine <mlentine@google.com> Add support for arbitrary number of layers

Add a static string in vulkan_layer_path that is set by the loader.
This path is then searched inside the loader for layers to load.

Change-Id: Ibd6fa87579d6fd39bba0814935be2bd38a416848
(cherry picked from commit 1dd0ae574084204bbbb614e551125ee84dc5cf3d)
oader.cpp
950bb4fb86a67997791f4565680421fb07cdbf2b 14-Sep-2015 Michael Lentine <mlentine@google.com> Add support for autoloading callback extension.

This works by checking for the property vulkan.enableLayerCallback. If the
property doesn't exist, is false, or the app has explicitly loaded the callback
extension the change does nothing. If the property is enabled and the app
has not loaded the extension this change forces the loader to enable it.

Change-Id: I52f7afb4136358a360aaf62188d98b34b563778a
(cherry picked from commit adeac8e46bd0034321ea348132d3f9db967b72e9)
oader.cpp
1f0f539dbf9df78932e2d5d27ea24e9f347643f3 11-Sep-2015 Michael Lentine <mlentine@google.com> Add support for multiple layers in the same so

Change-Id: Iec30d8b969665473e24f5ac24a62aa930339f7d5
(cherry picked from commit 6dee80d5c552d16c2e5fc44290c057b43515fa52)
oader.cpp
03c64b0b525a2f259456a220c51bbc8438ae2c03 27-Aug-2015 Michael Lentine <mlentine@google.com> Add layer loading to android vulkan loader.

Change-Id: I500d248f03a14db82ce725e600aef82c115b9b35
(cherry picked from commit ad17ac2e5bec7a65e3170043eb958e5a97107bd4)
ndroid.mk
et_proc_addr.cpp
et_proc_addr.cpp.tmpl
oader.cpp
oader.h
622701679d3a4636846ad63834685f7008980fef 15-Sep-2015 Michael Lentine <mlentine@google.com> Fix GetSpecific*ProcAddr.

Change GetSpeicific*ProcAddr to cast to return the value inside of the table
instead of the table itself.

Change-Id: Ib693274cd5c0869d79f0869a6d99a78c31a63b08
(cherry picked from commit 0c8fe76496e1fe6fe63e4e6179f53a98561a7748)
et_proc_addr.cpp
et_proc_addr.cpp.tmpl
d7b994a0cfb9054aafc1dadc85085a7d0ef8789a 07-Sep-2015 Jesse Hall <jessehall@google.com> vulkan: Implement vk_ext_khr_*swapchain extensions

Change-Id: I46312c9ba1332e0a5b8ac4c1b5608f0465c3962c
(cherry picked from commit e5ca41cb11212bbfbd608eddb92d794e12e1528e)
ndroid.mk
oader.cpp
oader.h
wapchain.cpp
b1352bce9cd82ceaef287b8b3cd7a5c39703a14c 05-Sep-2015 Jesse Hall <jessehall@google.com> vulkan: Add skeleton swapchain support

Loader and driver entry points exist and the call chains are hooked up
properly, but functions are just empty stubs for now.

Change-Id: I6ff95e47d1d09ebed41eda8accb71686c8249546
(cherry picked from commit 038c8a740bbda4650bec776023a26a7fcbf93864)
ndroid.mk
ntry.cpp
ntry.cpp.tmpl
et_proc_addr.cpp
et_proc_addr.cpp.tmpl
oader.cpp
oader.h
wapchain.cpp
d02edcbb40d476b6d3b5ae279a6ccef786be8848 08-Sep-2015 Jesse Hall <jessehall@google.com> vulkan: add copyright notices

Change-Id: I62ec6d02a052c9e9cee9753057d55c165dfc9713
(cherry picked from commit b7f416a9cc3d136ffe4a60b5f6fb2dc8b92a623b)
ndroid.mk
ntry.cpp.tmpl
et_proc_addr.cpp.tmpl
oader.cpp
oader.h
c7a6eb56a2c967685f70d30c643f899b0425c0ea 31-Aug-2015 Jesse Hall <jessehall@google.com> vulkan: Set up VkCmdBuffer dispatching

Change-Id: Ifb3cea05dab8828c2c00b8ed60c5ad991cdcbea7
(cherry picked from commit 10bf73e13b6904afa606fdcdc05bcc510c605180)
ntry.cpp
ntry.cpp.tmpl
oader.cpp
oader.h
04f4f4746481571148eaf3aaf768ee5c6dccec9d 17-Aug-2015 Jesse Hall <jessehall@google.com> vulkan: initial loader and null driver

Change-Id: Id5ebb5f01e61e9b114990f49c64c88fbbb7b730e
(cherry picked from commit 4df205cdfc61e66de774ba50be9ef59a08cf88bb)
ndroid.mk
ntry.cpp
ntry.cpp.tmpl
et_proc_addr.cpp
et_proc_addr.cpp.tmpl
oader.cpp
oader.h