History log of /frameworks/native/vulkan/libvulkan/driver_gen.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
db67cc7bcfbb5cb1692ca491f8698d91c072ce70 14-Mar-2018 Yiwei Zhang <zzyiwei@google.com> libvulkan: correctly expose VK_KHR_shared_presentable_image

The current libvulkan still make VK_KHR_shared_presentable_image depends
on VK_KHR_get_physical_device_properties2 even with proper VK1.1. This
change makes a change in code-generator.tmpl which results in adding
vkGetPhysicalDeviceProperties2 into the driver table.

Test: dEQP-VK.wsi.android.shared_presentable_image*
Bug: b/74605332
Change-Id: I5925dbc438decdc841ed4131c4f3df2a9dd1805a
(cherry picked from commit 922b1e377d4247ab40f2c7c0467b3cda60b4fd7c)
/frameworks/native/vulkan/libvulkan/driver_gen.cpp
a8d367a34b4f48b50d97e3de57a8463f7eff1572 19-Jan-2018 Jesse Hall <jessehall@google.com> libvulkan: Add VK_ANDROID_external_memory_android_hardware_buffer

Test: build
Change-Id: Ice6ec464e91aaf42d56afaf9b11fb514076f64e9
/frameworks/native/vulkan/libvulkan/driver_gen.cpp
cd8ad33289b74243e21a776a5a9170c845d990c4 13-Oct-2017 Ian Elliott <ianelliott@google.com> Additional changes to Vulkan 1.1 API updates

This commit includes the following:

- Make new/Vulkan 1.1 core commands be optional in codegen. Before this
change, the loader crashed when starting with a 1.0 app, and using a 1.0 ICD.
That's because the loader couldn't find "required" 1.1 entrypoints. This
change makes those entrypoints "optional" with a new annotation in the api
file.

- Changes from internal reviews, including a fix for the algorithm of
EnumeratePhysicalDeviceGroups.

Test: Run with a 1.0 app with a 1.0 driver and make sure the loader works
Change-Id: I55914b680a1601cb9f3f2cc0257091a0a34ae7f2
/frameworks/native/vulkan/libvulkan/driver_gen.cpp
f25f5bb3eb1ee3e7a3c33b5e44143ad296245f3f 05-Oct-2017 Daniel Koch <dkoch@nvidia.com> Vulkan api update to 1.1

Import Vulkan 1.1 header from
khronos master@5b2d66c0e6906388385ed7adfd015d80ec0d846a
with the following modifications:
- VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETER_FEATURES 10006300 -> 1000063000
- remove VK_KHR_get_display_properties2 (which is not ratified)
- device_group interactions from KHR_surface to KHR_swapchain (per MR 2409)

Summary of changes since 1.0.61:
* VK_KHR_surface -> v26 (subsumed interactions with VK_KHR_device_group)
* VK_KHR_swapchain -> v69 (subsumed interactions with VK_KHR_device_group)
* VK_EXT_debug_report -> v9 (no api changes)
* VK_KHX_multiview -> VK_KHR_multiview
* VK_KHX_device_group -> VK_KHR_device_group
* VK_KHX_device_group_creation -> VK_KHR_device_group_creation
* VK_KHR_push_descriptor -> v2
* Added VK_KHR_maintenance3
* Added 1.1 core enums, structs, and functions (kept KHR suffixed ones too)

Implemented the following in libvulkan:
* EnumerateInstanceVersion
* GetDeviceGroupPresentCapabilitiesKHR (minimal support for 1 device)
* GetDeviceGroupSurfacePresentModesKHR (minimal support for local present modes only)
* GetPhysicalDevicePresentRectanglesKHR (assumes whole window)
* AcquireNextImage2KHR (minimal thunk to AcquireNextImageKHR)
* GetDeviceQueue2
* added support for VK_SWAPCHAIN_CREATE_PROTECTED_BIT_KHR
* support for 1.1 core device_groups functionality (no VK_KHR_device_group_creation)
- EnumeratePhysicalDeviceGroups
* added trampolines for 1.1 core entry points
* disabled apiVersion >= 1.1 check

Implemented in nulldrv (but largely untested beyond build/link)
* EnumerateInstanceVersion
* enough empty thunks for VK 1.1 core functions that it links

Test: Build Android
Change-Id: I247cd670543867bdf80877156d941cf3bfcf6303
/frameworks/native/vulkan/libvulkan/driver_gen.cpp
2452cf7e653c425191791a4fb546106d6a277654 16-Mar-2017 Chris Forbes <chrisforbes@google.com> vulkan: Implement KHR_get_surface_capabilities2

Implemented by forwarding to the KHR_surface equivalents. This requires
a bit of rejigging in the case of GetPhysicalDeviceSurfaceFormats2KHR
to deal with the stride difference.

Change-Id: I0f1cc83cfc885955a39fc02d4a15609e83d36798
Test: dEQP-VK.wsi.android.surface.*2
/frameworks/native/vulkan/libvulkan/driver_gen.cpp
e2d3ee180a2521c8db03a9702cb2669735f239ac 16-Mar-2017 Chris Forbes <chrisforbes@google.com> vulkan: Update header for KHR_get_surface_capabilities2

.. and new struct added to latest version of
KHR_shared_presentable_image.

Test: build
Change-Id: I653d0d8ad384c256e9a5c4cb79554360a5b2606e
/frameworks/native/vulkan/libvulkan/driver_gen.cpp
e278daf850a664a1f15c760c64a74d3649b6f812 03-Feb-2017 Courtney Goeltzenleuchter <courtneygo@google.com> Use Surface::GetWideColorSupport in VK_EXT_swapchain_colorspace

Use the newly added Surface::GetWideColorSupport to
add wide color SurfaceFormats when appropriate.

Test: compile Vulkan CTS test TBD
Change-Id: I85dbe9617b8eba8b89c3ad788d5ffc9f0d66f935
/frameworks/native/vulkan/libvulkan/driver_gen.cpp
6aa30db7a9bbe06b59fddd554d797c6e466ca891 20-Feb-2017 Chris Forbes <chrisforbes@google.com> vulkan: Split known/intercepted extension lists

We need to do some work in the loader based on whether gpdp2 is present
and enabled, and we'd like to /not/ filter gpdp2 out of extension lists.

However, we don't need or want to generate full forwarding stubs.

All extensions in driver.KnownExtensions will have enums and matching
infrastructure generated, but only extensions in
driver.InterceptedExtensions will have g_hook_procs populated for their
entrypoints.

V3: Define driver.KnownExtensions in terms of
driver.InterceptedExtensions as always a superset.

Change-Id: If0fdabad99fa4637d7c6fc1e9a7e5e3908b53aca
Test: build
/frameworks/native/vulkan/libvulkan/driver_gen.cpp
889cd9aa94a6b0a8b90116ad7b9c6d70ceeaa5e9 26-Feb-2017 Jesse Hall <jessehall@google.com> resolve merge conflicts of 641f2cf42 to master

Test: [sailfish] make ; mmm frameworks/native/vulkan
Change-Id: I8555fdfbe6375e6266d07b66b5a8085d37e1ffde
d634c483bcbd564acd81dcf5d15fc5fa8ab410f4 05-Jan-2017 Courtney Goeltzenleuchter <courtneygo@google.com> Add HDR Metadata extension

Basic framework to support HDR Metadata extension. Will
add system plumbing in separate CL.

Test: CTS dEQP-VK.wsi.android.hdr_metadata.scale_none.fifo.*
Change-Id: I5de639ef87a988e02d194a2bd91d16ffe6102c6e
/frameworks/native/vulkan/libvulkan/driver_gen.cpp
85bb0c5a57be2b456079c14448127fa9bb8cff66 10-Feb-2017 Jesse Hall <jessehall@google.com> vulkan: Temporarily hack around loader/driver mismatch

A driver was built with an older declaration of
vkGetSwapchainGrallocUsage2KHR, and doesn't match what libvulkan
expects. This is a temporary workaround until the driver can be
rebuilt against the current header. When a new driver is available,
this change should be reverted.

Test: vulkanGears on affected device
Change-Id: I5a8bb16f0f9563e32314cff2a2a7a45760cfc356
/frameworks/native/vulkan/libvulkan/driver_gen.cpp
d827791bd6c5847e1ef3344a8c2f158ce3f821b8 10-Feb-2017 Chris Forbes <chrisforbes@google.com> vulkan: Tolerate missing GetSwapchainGrallocUsageANDROID function

Some drivers implementing ANDROID_native_buffer V6 have /removed/ the
old function. We shouldn't really mind if they do that -- we're never
going to call it anyway if they do expose the new
GetSwapchainGrallocUsage2ANDROID function.

V2: Fail at CreateDevice-time if neither function is exposed.

Change-Id: Id1e3dd5e2e71a9291dd610e908f9906acaaf0ad0
Related bugs: b/34177594
Test: build
/frameworks/native/vulkan/libvulkan/driver_gen.cpp
1d5f68c10560a82fd3278e17e934ee3bff328374 30-Jan-2017 Chris Forbes <chrisforbes@google.com> vulkan: KHR_swapchain_front_buffered -> KHR_shared_presentable_image

Tracking Khronos naming churn
V2: More churn, no longer shared_image_swapchain.

Test: build
Change-Id: I88b11b47f2fd2f96e1f27f900a65b599aec470af
/frameworks/native/vulkan/libvulkan/driver_gen.cpp
0f2ac2e52d06ed171f7b888870c1c3c42b167d1a 18-Jan-2017 Chris Forbes <chrisforbes@google.com> vulkan: Add function stub & plumbing for KHR_swapchain_front_buffered

Test: build
Change-Id: I6ea2e33e708067f11069bda19c4b5ea167158913
/frameworks/native/vulkan/libvulkan/driver_gen.cpp
48853713e328ee23884d2127ca763352e0681944 12-Jan-2017 Chris Forbes <chrisforbes@google.com> vulkan: Fix vulkan.api for Ian's changes & regen

Various problems: uint32_t vs u32, a dropped }, function body with
semantics that crash the generator, etc ...

V2: don't export Ian's extensions from libvulkan.

Change-Id: I1dceb4d4fc21ad5d38255c4979d9ef372ea2a28b
Test: build
/frameworks/native/vulkan/libvulkan/driver_gen.cpp
e0ea99cc4ba89452b9b6b1baa33bddcb11f3351a 12-Jan-2017 Mark Salyzyn <salyzyn@google.com> resolve merge conflicts of a2c2d11f9 to master

Test: compile
Bug: 26552300
Bug: 31289077
Change-Id: I84d0ffa430df3beca0dcc6ed205ce220d7be1f87
7823e124e00576e20e47ec717cbe8bc89f0f2bf2 29-Sep-2016 Mark Salyzyn <salyzyn@google.com> Replace cutils/log.h and rationalize log/log.h and android/log.h

- cutils/log.h treat as deprecated and lead by example
- android/log.h to be used instead of log/log.h if possible
- add system includes that are assumed as side effects
- define LOG_TAG first

Test: compile
Bug: 31289077
Bug: 30465923
Change-Id: I8d99b24c333578c9b5aa9f2a01324bd0bba268dd
/frameworks/native/vulkan/libvulkan/driver_gen.cpp
4c8bb2a95d7849c79dea889f1be59281f4e374bf 29-Dec-2016 Ian Elliott <ianelliott@google.com> Stubbed implementation of VK_GOOGLE_display_timing extension.

This provides the header changes and most of the "boilerplate" changes to add
the VK_GOOGLE_display_timing extension to Vulkan. Future changes will modify
and integrate with the Surface, FrameEvents, and SurfaceFlinger code.

Test: Manually tested that existing apps won't tickle the new-extension paths.

Change-Id: Iec46b1cab4b2561702ebac9a4ae7587584793192
/frameworks/native/vulkan/libvulkan/driver_gen.cpp
289cb79d444c385185e4f357d3b2fe67a958e932 30-Dec-2016 Chris Forbes <chrisforbes@google.com> vulkan: Update vulkan headers to 1.0.38

Catches up with the current upstream header. Preserves the local changes
for incremental present.

V2: Fix indentation issues
V3: Add missing struct and defines for EXT_validation_flags

Change-Id: I6e4f44e0eba8de00b010a6918ec2ba92614cc6bc
Test: Ensured cube demo still works
/frameworks/native/vulkan/libvulkan/driver_gen.cpp
c03d283e8b3f830d76dd94822b2a13872c05c730 28-Dec-2016 Mark Salyzyn <salyzyn@google.com> resolve merge conflicts of 525a5f2 to master

Test: build
Change-Id: Id1c6d3d9dd158fb086b0d8ab74f7838ef0a51af1
5948b3eae87af490b7cec36d043b5a9bca6de8c0 23-Dec-2016 Chris Forbes <chrisforbes@google.com> vulkan: Add support for non-fatal missing functions in vulkan loader

When a function is added by a later revision of an extension, and the
loader expects to deal with drivers written against revisions before and
after that point, we need to not fail hard on missing that function.

Change-Id: Iac6383f6a424afe6e7f83acc86b674669a118c51
Test: Run Vulkan-LoaderAndValidationLayers Cube demo
/frameworks/native/vulkan/libvulkan/driver_gen.cpp
a5e161b1207ef447a51e99856097d69d4a6111e1 29-Sep-2016 Mark Salyzyn <salyzyn@google.com> Replace cutils/log.h and rationalize log/log.h and android/log.h

- cutils/log.h treat as deprecated and lead by example
- android/log.h to be used instead of log/log.h if required
- add system includes that are assumed as side effects of log.h
- modules that use SLOG should use SLOG for all logging (installd)
- define LOG_TAG first
- remove logging infrastructure if not used

Test: build
Bug: 31289077
Change-Id: Iea147a0104c7ab7f12451304131d6500f42141e7
/frameworks/native/vulkan/libvulkan/driver_gen.cpp
8e4438b9cd82e911ed8de6aca15f11816187df3f 07-Dec-2016 Chris Forbes <chrisforbes@google.com> frontbuffer enhancements to ANDROID_vulkan_native_buffer

Since VK_KHR_swapchain is implemented entirely in libvulkan, we need an
image-level mechanism to inform the driver that a swapchain image will
be used for front-buffered rendering. This is implemented by chaining
another structure off of the VkImageCreateInfo passed to the driver when
creating swapchain images.

V2: Don't foul up api file. Rerun code generators.
V3: Rename VkNativeBuffer2ANDROID structure to
VkSwapchainImageCreateInfoANDROID
V4: Provide nulldrv stub for new function
V5: rebase.

Change-Id: I4447400cb1782440638e4c8816b081dd8923ddb9
Test: compile
/frameworks/native/vulkan/libvulkan/driver_gen.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
/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