History log of /frameworks/native/vulkan/libvulkan/driver_gen.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
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
/frameworks/native/vulkan/libvulkan/driver_gen.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
/frameworks/native/vulkan/libvulkan/driver_gen.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
/frameworks/native/vulkan/libvulkan/driver_gen.cpp
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
/frameworks/native/vulkan/libvulkan/driver_gen.cpp
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
/frameworks/native/vulkan/libvulkan/driver_gen.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
/frameworks/native/vulkan/libvulkan/driver_gen.cpp
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
/frameworks/native/vulkan/libvulkan/driver_gen.cpp
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
/frameworks/native/vulkan/libvulkan/driver_gen.cpp
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
/frameworks/native/vulkan/libvulkan/driver_gen.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
/frameworks/native/vulkan/libvulkan/driver_gen.cpp
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
/frameworks/native/vulkan/libvulkan/driver_gen.cpp
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
/frameworks/native/vulkan/libvulkan/driver_gen.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
/frameworks/native/vulkan/libvulkan/driver_gen.cpp