OSDN Git Service

vulkan: Implement new vkGet*ProcAddrBehavior
authorJesse Hall <jessehall@google.com>
Sat, 12 Dec 2015 00:28:44 +0000 (16:28 -0800)
committerJesse Hall <jessehall@google.com>
Mon, 25 Jan 2016 21:49:31 +0000 (13:49 -0800)
commit1f91d390ac013ea2514a67e12ddb083119d636d7
tree757883a90b269c319f76fa6bf28818ef4995a3ff
parent21597661b5cabc73f8d14bd0091eea7bddafdcbe
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)
19 files changed:
vulkan/api/templates/vulkan_common.tmpl
vulkan/libvulkan/Android.mk
vulkan/libvulkan/dispatch.tmpl [new file with mode: 0644]
vulkan/libvulkan/dispatch_gen.cpp [new file with mode: 0644]
vulkan/libvulkan/dispatch_gen.h [new file with mode: 0644]
vulkan/libvulkan/entry.cpp [deleted file]
vulkan/libvulkan/entry.cpp.tmpl [deleted file]
vulkan/libvulkan/get_proc_addr.cpp [deleted file]
vulkan/libvulkan/get_proc_addr.cpp.tmpl [deleted file]
vulkan/libvulkan/loader.cpp
vulkan/libvulkan/loader.h
vulkan/libvulkan/swapchain.cpp
vulkan/nulldrv/null_driver.cpp
vulkan/nulldrv/null_driver.h [deleted file]
vulkan/nulldrv/null_driver.tmpl [new file with mode: 0644]
vulkan/nulldrv/null_driver_gen.cpp
vulkan/nulldrv/null_driver_gen.cpp.tmpl [deleted file]
vulkan/nulldrv/null_driver_gen.h [new file with mode: 0644]
vulkan/tools/vkinfo.cpp