Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7a933253 authored by Chia-I Wu's avatar Chia-I Wu Committed by android-build-merger
Browse files

Merge changes I21f07545,I73c39cbe,I47b1639c,I4a6268d7,I06be9898, ... into nyc-dev am: 4ad5c141

am: 172164ed

* commit '172164ed':
  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

Change-Id: Ifef1722e6082bd14a8701bf2e99c8cb374964e98
parents b21a327b 172164ed
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ type u64 size_t

// VK_USE_PLATFORM_ANDROID_KHR
@internal class ANativeWindow {}
@internal type void* buffer_handle_t

// VK_USE_PLATFORM_WIN32_KHR
@internal type void* HINSTANCE
+45 −0
Original line number Diff line number Diff line
@@ -75,6 +75,9 @@ define NULL_HANDLE 0
@extension("VK_KHR_win32_surface") define VK_KHR_WIN32_SURFACE_SPEC_VERSION     5
@extension("VK_KHR_win32_surface") define VK_KHR_WIN32_SURFACE_NAME             "VK_KHR_win32_surface"

@extension("VK_ANDROID_native_buffer") define VK_ANDROID_NATIVE_BUFFER_SPEC_VERSION     5
@extension("VK_ANDROID_native_buffer") define VK_ANDROID_NATIVE_BUFFER_NAME             "VK_ANDROID_native_buffer"

@extension("VK_EXT_debug_report") define VK_EXT_DEBUG_REPORT_SPEC_VERSION       1
@extension("VK_EXT_debug_report") define VK_EXT_DEBUG_REPORT_NAME               "VK_EXT_debug_report"

@@ -646,6 +649,9 @@ enum VkStructureType {
    //@extension("VK_KHR_win32_surface")
    VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR             = 1000009000,

    //@extension("VK_ANDROID_native_buffer")
    VK_STRUCTURE_TYPE_NATIVE_BUFFER_ANDROID                     = 1000010000,

    //@extension("VK_EXT_debug_report")
    VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT              = 1000011000,
}
@@ -2591,6 +2597,16 @@ class VkWin32SurfaceCreateInfoKHR {
    platform.HWND                               hwnd
}

@extension("VK_ANDROID_native_buffer")
class VkNativeBufferANDROID {
    VkStructureType                             sType
    const void*                                 pNext
    platform.buffer_handle_t                    handle
    int                                         stride
    int                                         format
    int                                         usage
}

@extension("VK_EXT_debug_report")
class VkDebugReportCallbackCreateInfoEXT {
    VkStructureType                             sType
@@ -5134,6 +5150,35 @@ cmd VkResult vkGetPhysicalDeviceWin32PresentationSupportKHR(
    return ?
}

@extension("VK_ANDROID_native_buffer")
cmd VkResult vkGetSwapchainGrallocUsageANDROID(
        VkDevice                                device,
        VkFormat                                format,
        VkImageUsageFlags                       imageUsage,
        int*                                    grallocUsage) {
    return ?
}

@extension("VK_ANDROID_native_buffer")
cmd VkResult vkAcquireImageANDROID(
        VkDevice                                device,
        VkImage                                 image,
        int                                     nativeFenceFd,
        VkSemaphore                             semaphore,
        VkFence                                 fence) {
    return ?
}

@extension("VK_ANDROID_native_buffer")
cmd VkResult vkQueueSignalReleaseImageANDROID(
        VkQueue                                 queue,
        u32                                     waitSemaphoreCount,
        const VkSemaphore*                      pWaitSemaphores,
        VkImage                                 image,
        int*                                    pNativeFenceFd) {
    return ?
}

@extension("VK_EXT_debug_report")
@external type void* PFN_vkDebugReportCallbackEXT
@extension("VK_EXT_debug_report")
+2 −2
Original line number Diff line number Diff line
@@ -42,9 +42,9 @@ LOCAL_SRC_FILES := \
	api.cpp \
	api_gen.cpp \
	debug_report.cpp \
	dispatch_gen.cpp \
	driver.cpp \
	driver_gen.cpp \
	layers_extensions.cpp \
	loader.cpp \
	swapchain.cpp \
	vulkan_loader_data.cpp
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
+1 −1
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@
#include <vulkan/vk_layer_interface.h>
#include "api.h"
#include "driver.h"
#include "loader.h"
#include "layers_extensions.h"

namespace vulkan {
namespace api {
+541 −12
Original line number Diff line number Diff line
@@ -21,6 +21,8 @@
{{Macro "DefineGlobals" $}}
{{$ | Macro "api_gen.h"   | Format (Global "clang-format") | Write "api_gen.h"  }}
{{$ | Macro "api_gen.cpp" | Format (Global "clang-format") | Write "api_gen.cpp"}}
{{$ | Macro "driver_gen.h" | Format (Global "clang-format") | Write "driver_gen.h"}}
{{$ | Macro "driver_gen.cpp" | Format (Global "clang-format") | Write "driver_gen.cpp"}}

{{/*
-------------------------------------------------------------------------------
@@ -44,7 +46,7 @@ struct InstanceDispatchTable {
  // clang-format off
  {{range $f := AllCommands $}}
    {{if (Macro "api.IsInstanceDispatchTableEntry" $f)}}
      {{Macro "C++.DeclareDispatchTableEntry" $f}};
      {{Macro "C++.DeclareTableEntry" $f}};
    {{end}}
  {{end}}
  // clang-format on
@@ -54,7 +56,7 @@ struct DeviceDispatchTable {
  // clang-format off
  {{range $f := AllCommands $}}
    {{if (Macro "api.IsDeviceDispatchTableEntry" $f)}}
      {{Macro "C++.DeclareDispatchTableEntry" $f}};
      {{Macro "C++.DeclareTableEntry" $f}};
    {{end}}
  {{end}}
  // clang-format on
@@ -89,7 +91,9 @@ bool InitDispatchTable(VkDevice dev, PFN_vkGetDeviceProcAddr get_proc);
namespace vulkan {«
namespace api {«

{{Macro "C++.DefineInitProcMacros" "dispatch"}}
{{Macro "C++.DefineInitProcMacro" "dispatch"}}

{{Macro "api.C++.DefineInitProcExtMacro"}}

bool InitDispatchTable(VkInstance instance, PFN_vkGetInstanceProcAddr get_proc) {
    auto& data = GetData(instance);
@@ -146,12 +150,174 @@ bool InitDispatchTable(VkDevice dev, PFN_vkGetDeviceProcAddr get_proc) {
¶{{end}}


{{/*
-------------------------------------------------------------------------------
  driver_gen.h
-------------------------------------------------------------------------------
*/}}
{{define "driver_gen.h"}}
{{Macro "Copyright"}}

// WARNING: This file is generated. See ../README.md for instructions.

#ifndef LIBVULKAN_DRIVER_GEN_H
#define LIBVULKAN_DRIVER_GEN_H

#include <vulkan/vulkan.h>
#include <vulkan/vk_android_native_buffer.h>

namespace vulkan {«
namespace driver {«

{{Macro "driver.C++.DefineProcHookType"}}

struct InstanceDriverTable {
  // clang-format off
  {{range $f := AllCommands $}}
    {{if (Macro "driver.IsInstanceDriverTableEntry" $f)}}
      {{Macro "C++.DeclareTableEntry" $f}};
    {{end}}
  {{end}}
  // clang-format on
};

struct DeviceDriverTable {
  // clang-format off
  {{range $f := AllCommands $}}
    {{if (Macro "driver.IsDeviceDriverTableEntry" $f)}}
      {{Macro "C++.DeclareTableEntry" $f}};
    {{end}}
  {{end}}
  // clang-format on
};

const ProcHook* GetProcHook(const char* name);
ProcHook::Extension GetProcHookExtension(const char* name);

bool InitDriverTable(VkInstance instance, PFN_vkGetInstanceProcAddr get_proc);
bool InitDriverTable(VkDevice dev, PFN_vkGetDeviceProcAddr get_proc);

»} // namespace driver
»} // namespace vulkan

#endif // LIBVULKAN_DRIVER_TABLE_H
¶{{end}}


{{/*
-------------------------------------------------------------------------------
  driver_gen.cpp
-------------------------------------------------------------------------------
*/}}
{{define "driver_gen.cpp"}}
{{Macro "Copyright"}}

// WARNING: This file is generated. See ../README.md for instructions.

#include <string.h>
#include <algorithm>
#include <log/log.h>

#include "driver.h"

namespace vulkan {«
namespace driver {«

namespace {«

// clang-format off

{{range $f := AllCommands $}}
  {{Macro "driver.C++.DefineProcHookStubs" $f}}
{{end}}
// clang-format on

const ProcHook g_proc_hooks[] = {
  // clang-format off
  {{range $f := SortBy (AllCommands $) "FunctionName"}}
    {{if (Macro "driver.IsIntercepted" $f)}}
      {{     if (Macro "IsGloballyDispatched" $f)}}
        {{Macro "driver.C++.DefineGlobalProcHook" $f}}
      {{else if (Macro "IsInstanceDispatched" $f)}}
        {{Macro "driver.C++.DefineInstanceProcHook" $f}}
      {{else if (Macro "IsDeviceDispatched" $f)}}
        {{Macro "driver.C++.DefineDeviceProcHook" $f}}
      {{end}}
    {{end}}
  {{end}}
  // clang-format on
};

»} // anonymous

const ProcHook* GetProcHook(const char* name) {
    const auto& begin = g_proc_hooks;
    const auto& end = g_proc_hooks +
      sizeof(g_proc_hooks) / sizeof(g_proc_hooks[0]);
    const auto hook = std::lower_bound(begin, end, name,
        [](const ProcHook& e, const char* n) { return strcmp(e.name, n) < 0; });
    return (hook <  end && strcmp(hook->name, name) == 0) ? hook : nullptr;
}

ProcHook::Extension GetProcHookExtension(const char* name) {
  {{$exts := Strings (Macro "driver.InterceptedExtensions") | SplitOn "\n"}}
  // clang-format off
  {{range $e := $exts}}
    if (strcmp(name, "{{$e}}") == 0) return ProcHook::{{TrimPrefix "VK_" $e}};
  {{end}}
  // clang-format on
  return ProcHook::EXTENSION_UNKNOWN;
}

{{Macro "C++.DefineInitProcMacro" "driver"}}

{{Macro "driver.C++.DefineInitProcExtMacro"}}

bool InitDriverTable(VkInstance instance, PFN_vkGetInstanceProcAddr get_proc)
{
    auto& data = GetData(instance);
    bool success = true;

    // clang-format off
    {{range $f := AllCommands $}}
      {{if (Macro "driver.IsInstanceDriverTableEntry" $f)}}
        {{Macro "C++.InitProc" $f}}
      {{end}}
    {{end}}
    // clang-format on

    return success;
}

bool InitDriverTable(VkDevice dev, PFN_vkGetDeviceProcAddr get_proc)
{
    auto& data = GetData(dev);
    bool success = true;

    // clang-format off
    {{range $f := AllCommands $}}
      {{if (Macro "driver.IsDeviceDriverTableEntry" $f)}}
        {{Macro "C++.InitProc" $f}}
      {{end}}
    {{end}}
    // clang-format on

    return success;
}

»} // namespace driver
»} // namespace vulkan

// clang-format on
¶{{end}}


{{/*
------------------------------------------------------------------------------
  Emits a declaration of a dispatch table entry.
  Emits a declaration of a dispatch/driver table entry.
------------------------------------------------------------------------------
*/}}
{{define "C++.DeclareDispatchTableEntry"}}
{{define "C++.DeclareTableEntry"}}
  {{AssertType $ "Function"}}

  {{Macro "FunctionPtrName" $}} {{Macro "BaseName" $}}
@@ -160,10 +326,10 @@ bool InitDispatchTable(VkDevice dev, PFN_vkGetDeviceProcAddr get_proc) {

{{/*
-------------------------------------------------------------------------------
  Emits macros to help initialize dispatch tables.
  Emits INIT_PROC macro.
-------------------------------------------------------------------------------
*/}}
{{define "C++.DefineInitProcMacros"}}
{{define "C++.DefineInitProcMacro"}}
  #define UNLIKELY(expr) __builtin_expect((expr), 0)

  #define INIT_PROC(obj, proc) do {                             \
@@ -174,11 +340,6 @@ bool InitDispatchTable(VkDevice dev, PFN_vkGetDeviceProcAddr get_proc) {
          success = false;                                      \
      }                                                         \
  } while(0)

  // TODO do we want to point to a stub or nullptr when ext is not enabled?
  #define INIT_PROC_EXT(ext, obj, proc) do {                    \
      INIT_PROC(obj, proc);                                     \
  } while(0)
{{end}}


@@ -261,6 +422,19 @@ bool InitDispatchTable(VkDevice dev, PFN_vkGetDeviceProcAddr get_proc) {
{{end}}


{{/*
-------------------------------------------------------------------------------
  Emits INIT_PROC_EXT macro for vulkan::api.
-------------------------------------------------------------------------------
*/}}
{{define "api.C++.DefineInitProcExtMacro"}}
  // TODO do we want to point to a stub or nullptr when ext is not enabled?
  #define INIT_PROC_EXT(ext, obj, proc) do {                    \
      INIT_PROC(obj, proc);                                     \
  } while(0)
{{end}}


{{/*
------------------------------------------------------------------------------
  Emits code for vkGetInstanceProcAddr for function interception.
@@ -385,6 +559,348 @@ bool InitDispatchTable(VkDevice dev, PFN_vkGetDeviceProcAddr get_proc) {
{{end}}


{{/*
------------------------------------------------------------------------------
  Emits a list of extensions intercepted by vulkan::driver.
------------------------------------------------------------------------------
*/}}
{{define "driver.InterceptedExtensions"}}
VK_ANDROID_native_buffer
VK_EXT_debug_report
VK_KHR_android_surface
VK_KHR_surface
VK_KHR_swapchain
{{end}}


{{/*
------------------------------------------------------------------------------
  Emits true if an extension is intercepted by vulkan::driver.
------------------------------------------------------------------------------
*/}}
{{define "driver.IsExtensionIntercepted"}}
  {{$ext_name := index $.Arguments 0}}
  {{$filters := Strings (Macro "driver.InterceptedExtensions") | SplitOn "\n"}}

  {{range $f := $filters}}
    {{if eq $ext_name $f}}true{{end}}
  {{end}}
{{end}}


{{/*
------------------------------------------------------------------------------
  Emits true if a function is intercepted by vulkan::driver.
------------------------------------------------------------------------------
*/}}
{{define "driver.IsIntercepted"}}
  {{AssertType $ "Function"}}

  {{if (Macro "IsFunctionSupported" $)}}
    {{/* Create functions of dispatchable objects */}}
    {{     if eq $.Name "vkCreateInstance"}}true
    {{else if eq $.Name "vkCreateDevice"}}true
    {{else if eq $.Name "vkEnumeratePhysicalDevices"}}true
    {{else if eq $.Name "vkGetDeviceQueue"}}true
    {{else if eq $.Name "vkAllocateCommandBuffers"}}true

    {{/* Destroy functions of dispatchable objects */}}
    {{else if eq $.Name "vkDestroyInstance"}}true
    {{else if eq $.Name "vkDestroyDevice"}}true

    {{/* Enumeration of extensions */}}
    {{else if eq $.Name "vkEnumerateInstanceExtensionProperties"}}true
    {{else if eq $.Name "vkEnumerateDeviceExtensionProperties"}}true

    {{else if eq $.Name "vkGetInstanceProcAddr"}}true
    {{else if eq $.Name "vkGetDeviceProcAddr"}}true

    {{end}}

    {{$ext := GetAnnotation $ "extension"}}
    {{if $ext}}
      {{Macro "driver.IsExtensionIntercepted" $ext}}
    {{end}}

  {{end}}
{{end}}


{{/*
------------------------------------------------------------------------------
  Emits true if a function needs ProcHook stubs.
------------------------------------------------------------------------------
*/}}
{{define "driver.NeedProcHookStubs"}}
  {{AssertType $ "Function"}}

  {{if (Macro "driver.IsIntercepted" $)}}
    {{$ext := GetAnnotation $ "extension"}}
    {{if $ext}}
      {{if not (Macro "IsExtensionInternal" $ext)}}true{{end}}
    {{end}}
  {{end}}
{{end}}


{{/*
-------------------------------------------------------------------------------
  Emits definition of struct ProcHook.
-------------------------------------------------------------------------------
*/}}
{{define "driver.C++.DefineProcHookType"}}
  struct ProcHook {
      enum Type {
        GLOBAL,
        INSTANCE,
        DEVICE,
      };

      enum Extension {
        {{$exts := Strings (Macro "driver.InterceptedExtensions") | SplitOn "\n"}}
        {{range $e := $exts}}
          {{TrimPrefix "VK_" $e}},
        {{end}}

        EXTENSION_CORE, // valid bit
        EXTENSION_COUNT,
        EXTENSION_UNKNOWN,
      };

      const char* name;
      Type type;
      Extension extension;

      PFN_vkVoidFunction proc;
      PFN_vkVoidFunction disabled_proc; // nullptr for global hooks
      PFN_vkVoidFunction checked_proc;  // nullptr for global/instance hooks
  };
{{end}}


{{/*
-------------------------------------------------------------------------------
  Emits INIT_PROC_EXT macro for vulkan::driver.
-------------------------------------------------------------------------------
*/}}
{{define "driver.C++.DefineInitProcExtMacro"}}
  #define INIT_PROC_EXT(ext, obj, proc) do {                    \
      if (data.hal_extensions[ProcHook::ext])           \
        INIT_PROC(obj, proc);                                   \
  } while(0)
{{end}}


{{/*
-------------------------------------------------------------------------------
  Emits definitions of stub functions for ProcHook.
-------------------------------------------------------------------------------
*/}}
{{define "driver.C++.DefineProcHookStubs"}}
  {{AssertType $ "Function"}}

  {{if (Macro "driver.NeedProcHookStubs" $)}}
    {{$ext := GetAnnotation $ "extension"}}
    {{$ext_name := index $ext.Arguments 0}}

    {{$base := (Macro "BaseName" $)}}
    {{$unnamed_params := (ForEach $.CallParameters "ParameterType" | JoinWith ", ")}}

    VKAPI_ATTR {{Node "Type" $.Return}} disabled{{$base}}({{$unnamed_params}}) {
      ALOGE("{{$ext_name}} not enabled. {{$.Name}} not executed.");
      {{if not (IsVoid $.Return.Type)}}return VK_SUCCESS;{{end}}
    }
    {{if (Macro "IsDeviceDispatched" $)}}

      VKAPI_ATTR {{Node "Type" $.Return}} checked{{$base}}({{Macro "Parameters" $}}) {
        {{if not (IsVoid $.Return.Type)}}return §{{end}}

        {{$p0 := index $.CallParameters 0}}
        {{$ext_hook := Strings ("ProcHook::") (Macro "BaseName" $ext)}}
        (GetData({{$p0.Name}}).hook_extensions[{{$ext_hook}}]) ? §
          {{$base}}({{Macro "Arguments" $}}) : §
          disabled{{$base}}({{Macro "Arguments" $}});
      }
    {{end}}

  {{end}}
{{end}}


{{/*
-------------------------------------------------------------------------------
  Emits definition of a global ProcHook.
-------------------------------------------------------------------------------
*/}}
{{define "driver.C++.DefineGlobalProcHook"}}
  {{AssertType $ "Function"}}

  {{$base := (Macro "BaseName" $)}}

  {{$ext := GetAnnotation $ "extension"}}
  {{if $ext}}
    {{Error "invalid global extension"}}
  {{end}}

  {
    "{{$.Name}}",
    ProcHook::GLOBAL,
    ProcHook::EXTENSION_CORE,
    reinterpret_cast<PFN_vkVoidFunction>({{$base}}),
    nullptr,
    nullptr,
  },
{{end}}


{{/*
-------------------------------------------------------------------------------
  Emits definition of an instance ProcHook.
-------------------------------------------------------------------------------
*/}}
{{define "driver.C++.DefineInstanceProcHook"}}
  {{AssertType $ "Function"}}

  {{$base := (Macro "BaseName" $)}}

  {
    "{{$.Name}}",
    ProcHook::INSTANCE,

    {{$ext := GetAnnotation $ "extension"}}
    {{if $ext}}
      ProcHook::{{Macro "BaseName" $ext}},

      {{if (Macro "IsExtensionInternal" $ext)}}
        nullptr,
        nullptr,
        nullptr,
      {{else}}
        reinterpret_cast<PFN_vkVoidFunction>({{$base}}),
        reinterpret_cast<PFN_vkVoidFunction>(disabled{{$base}}),
        nullptr,
      {{end}}
    {{else}}
      ProcHook::EXTENSION_CORE,
      reinterpret_cast<PFN_vkVoidFunction>({{$base}}),
      nullptr,
      nullptr,
    {{end}}
  },
{{end}}


{{/*
-------------------------------------------------------------------------------
  Emits definition of a device ProcHook.
-------------------------------------------------------------------------------
*/}}
{{define "driver.C++.DefineDeviceProcHook"}}
  {{AssertType $ "Function"}}

  {{$base := (Macro "BaseName" $)}}

  {
    "{{$.Name}}",
    ProcHook::DEVICE,

    {{$ext := GetAnnotation $ "extension"}}
    {{if $ext}}
      ProcHook::{{Macro "BaseName" $ext}},

      {{if (Macro "IsExtensionInternal" $ext)}}
        nullptr,
        nullptr,
        nullptr,
      {{else}}
        reinterpret_cast<PFN_vkVoidFunction>({{$base}}),
        reinterpret_cast<PFN_vkVoidFunction>(disabled{{$base}}),
        reinterpret_cast<PFN_vkVoidFunction>(checked{{$base}}),
      {{end}}
    {{else}}
      ProcHook::EXTENSION_CORE,
      reinterpret_cast<PFN_vkVoidFunction>({{$base}}),
      nullptr,
      nullptr,
    {{end}}
  },
{{end}}


{{/*
-------------------------------------------------------------------------------
  Emits true if a function is needed by vulkan::driver.
-------------------------------------------------------------------------------
*/}}
{{define "driver.IsDriverTableEntry"}}
  {{AssertType $ "Function"}}

  {{if (Macro "IsFunctionSupported" $)}}
    {{/* Create functions of dispatchable objects */}}
    {{     if eq $.Name "vkCreateDevice"}}true
    {{else if eq $.Name "vkGetDeviceQueue"}}true
    {{else if eq $.Name "vkAllocateCommandBuffers"}}true

    {{/* Destroy functions of dispatchable objects */}}
    {{else if eq $.Name "vkDestroyInstance"}}true
    {{else if eq $.Name "vkDestroyDevice"}}true

    {{else if eq $.Name "vkEnumerateDeviceLayerProperties"}}true

    {{/* Enumeration of extensions */}}
    {{else if eq $.Name "vkEnumerateDeviceExtensionProperties"}}true

    {{/* We cache physical devices in loader.cpp */}}
    {{else if eq $.Name "vkEnumeratePhysicalDevices"}}true

    {{else if eq $.Name "vkGetInstanceProcAddr"}}true
    {{else if eq $.Name "vkGetDeviceProcAddr"}}true

    {{/* VK_KHR_swapchain->VK_ANDROID_native_buffer translation */}}
    {{else if eq $.Name "vkCreateImage"}}true
    {{else if eq $.Name "vkDestroyImage"}}true

    {{end}}

    {{$ext := GetAnnotation $ "extension"}}
    {{if $ext}}
      {{$ext_name := index $ext.Arguments 0}}
      {{     if eq $ext_name "VK_ANDROID_native_buffer"}}true
      {{else if eq $ext_name "VK_EXT_debug_report"}}true
      {{end}}
    {{end}}
  {{end}}
{{end}}


{{/*
------------------------------------------------------------------------------
  Emits true if an instance-dispatched function is needed by vulkan::driver.
------------------------------------------------------------------------------
*/}}
{{define "driver.IsInstanceDriverTableEntry"}}
  {{AssertType $ "Function"}}

  {{if and (Macro "driver.IsDriverTableEntry" $) (Macro "IsInstanceDispatched" $)}}
    true
  {{end}}
{{end}}


{{/*
------------------------------------------------------------------------------
  Emits true if a device-dispatched function is needed by vulkan::driver.
------------------------------------------------------------------------------
*/}}
{{define "driver.IsDeviceDriverTableEntry"}}
  {{AssertType $ "Function"}}

  {{if and (Macro "driver.IsDriverTableEntry" $) (Macro "IsDeviceDispatched" $)}}
    true
  {{end}}
{{end}}


{{/*
-------------------------------------------------------------------------------
  Emits a function/extension name without the "vk"/"VK_" prefix.
@@ -517,3 +1033,16 @@ bool InitDispatchTable(VkDevice dev, PFN_vkGetDeviceProcAddr get_proc) {
  {{else if eq $ext "VK_KHR_android_surface"}}true
  {{end}}
{{end}}


{{/*
------------------------------------------------------------------------------
  Reports whether an extension is internal to the loader and drivers,
  so the loader should not enumerate it.
------------------------------------------------------------------------------
*/}}
{{define "IsExtensionInternal"}}
  {{$ext := index $.Arguments 0}}
  {{     if eq $ext "VK_ANDROID_native_buffer"}}true
  {{end}}
{{end}}
Loading