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

Commit a7aca157 authored by Jesse Hall's avatar Jesse Hall Committed by Android (Google) Code Review
Browse files

Merge changes I58c5cad2,Id6ea11fb,I595e51ae,I161b7afa,I25b547e8, ...

* changes:
  libvulkan: Remove dead special cases in GetDeviceProcAddr
  vulkan: Update templates for generated extensions
  Don't remove elements while iterating through active_layers.
  Don't assume layers exist when prop is set
  vulkan: Add DevelopersGuide.pdf
  Add WSI functions to the loader.
  vulkan: allow drivers to see image acquire/release
  vulkan: Allow drivers to add private gralloc usage flags
  libvulkan: enable scaling for all Vulkan swapchains
  Remove Noop and move message removal.
  vknulldrv: Fix several entry point prototypes
  libvulkan: Don't log error if layer dir doesn't exist
  libvulkan: Fix check for redundant vkDeviceQueue calls
  libvulkan: Fail instance/device creation if requested layer not present
  vulkan: Fix GetSpecific*ProcAddr for extension functions
  vulkan: add recursive f/n/vulkan/Android.mk
  vulkan: Use the same dispatch magic value as LunarG
  Update DEBUG_REPORT extension and callback for v170.2
  vulkan: Add build-install_libvulkan virtual branch
  vulkan: Remove sdk-0.9 virtual branch, has been merged
  vulkan: Update to SDK-0.9 version of vk_ext_khr_device_swapchain.h
  vulkan: Update from header 0.138.2 to 0.170.2
  Add support for longer than 12 character layers.
  Allow for different layers to be active per device
  vulkan: Add sdk-0.9 virtual branch
parents 872d469b 9a86ad29
Loading
Loading
Loading
Loading

vulkan/Android.mk

0 → 100644
+1 −0
Original line number Diff line number Diff line
include $(call all-named-subdir-makefiles, libvulkan nulldrv tools)
+0 −6
Original line number Diff line number Diff line
@@ -22,9 +22,3 @@
// Platform types, as defined or included in vk_platform.h

type u64 size_t

type u64 VkDeviceSize
type u32 VkBool32

type u32 VkSampleMask
type u32 VkFlags
+23 −10
Original line number Diff line number Diff line
@@ -68,13 +68,18 @@ This file, vk.xml, is the Vulkan API Registry.»
        // the object handle as a bool in expressions like:
        //     if (obj) vkDestroy(obj);
        #define VK_NONDISP_HANDLE_OPERATOR_BOOL() explicit operator bool() const { return handle != 0; }
        #define VK_NONDISP_HANDLE_CONSTRUCTOR_FROM_UINT64(obj) \
            explicit obj(uint64_t x) : handle(x) { } \
            obj(decltype(nullptr)) : handle(0) { }
    «#else»
        #define VK_NONDISP_HANDLE_OPERATOR_BOOL()
        #define VK_NONDISP_HANDLE_CONSTRUCTOR_FROM_UINT64(obj) \
            obj(uint64_t x) : handle(x) { }
    «#endif
    #define <name>VK_DEFINE_NONDISP_HANDLE</name>(obj) \»
        struct obj { \
            obj() { } \
            obj(uint64_t x) { handle = x; } \
            VK_NONDISP_HANDLE_CONSTRUCTOR_FROM_UINT64(obj) \
            obj&amp; operator =(uint64_t x) { handle = x; return *this; } \
            bool operator==(const obj&amp; other) const { return handle == other.handle; } \
            bool operator!=(const obj&amp; other) const { return handle != other.handle; } \
@@ -86,6 +91,14 @@ This file, vk.xml, is the Vulkan API Registry.»
    »#define VK_DEFINE_NONDISP_HANDLE(obj) typedef struct obj##_T { uint64_t handle; } obj;«
#endif
        »»</type>

        <type category="define">
#if defined(__cplusplus) &amp;&amp; ((defined(_MSC_VER) &amp;&amp; _MSC_VER &gt;= 1800) || __cplusplus &gt;= 201103L)
    »#define <name>VK_NULL_HANDLE</name> nullptr
«#else
    »#define VK_NULL_HANDLE 0
«#endif
        »»</type>

        <type requires="vk_platform" name="VkDeviceSize"/>
        <type requires="vk_platform" name="VkSampleMask"/>
@@ -170,12 +183,13 @@ This file, vk.xml, is the Vulkan API Registry.»
        <enum value="{{$d.Expression}}"        name="{{$d.Name}}"/>{{Macro "XML.Docs" $d.Docs}}
        {{end}}
      {{end}}
        <enum value="MAX_FLOAT"  name="VK_LOD_CLAMP_NONE"/>
        <enum value="UINT32_MAX" name="VK_LAST_MIP_LEVEL"/>
        <enum value="UINT32_MAX" name="VK_LAST_ARRAY_SLICE"/>
        <enum value="UINT64_MAX" name="VK_WHOLE_SIZE"/>
        <enum value="UINT32_MAX" name="VK_ATTACHMENT_UNUSED"/>
        <enum value="UINT32_MAX" name="VK_QUEUE_FAMILY_IGNORED"/>
        <enum value="1000.0f"  name="VK_LOD_CLAMP_NONE"/>
        <enum value="(-0U)" name="VK_REMAINING_MIP_LEVELS"/>
        <enum value="(~0U)" name="VK_REMAINING_ARRAY_LAYERS"/>
        <enum value="(_0ULL)" name="VK_WHOLE_SIZE"/>
        <enum value="(~0U)" name="VK_ATTACHMENT_UNUSED"/>
        <enum value="(~0U)" name="VK_QUEUE_FAMILY_IGNORED"/>
        <enum value="(~0U)" name="VK_SUBPASS_EXTERNAL"/>
    «</enums>

    <!-- Unlike OpenGL, most tokens in Vulkan are actual typed enumerants in»
@@ -217,13 +231,12 @@ This file, vk.xml, is the Vulkan API Registry.»
        «</require>
        <require comment="API constants">»
            <enum name="VK_LOD_CLAMP_NONE"/>
            <enum name="VK_LAST_MIP_LEVEL"/>
            <enum name="VK_LAST_ARRAY_SLICE"/>
            <enum name="VK_REMAINING_MIP_LEVELS"/>
            <enum name="VK_REMAINING_ARRAY_LAYERS"/>
            <enum name="VK_WHOLE_SIZE"/>
            <enum name="VK_ATTACHMENT_UNUSED"/>
            <enum name="VK_TRUE"/>
            <enum name="VK_FALSE"/>
            <enum name="VK_NULL_HANDLE"/>
        «</require>
        <require comment="All functions (TODO: split by type)">»
        {{range $f := AllCommands $}}
+1 −1
Original line number Diff line number Diff line
@@ -137,7 +137,7 @@
{{define "Parameter"}}
  {{AssertType $ "Parameter"}}

  {{Macro "ParameterType" $}} {{$.Name}}{{Macro "ArrayPostfix" $}}
  {{if GetAnnotation $ "readonly"}}const {{end}}{{Macro "ParameterType" $}} {{$.Name}}{{Macro "ArrayPostfix" $}}
{{end}}


+20 −7
Original line number Diff line number Diff line
@@ -53,10 +53,16 @@ extern "C" {
#define VK_API_VERSION \
    VK_MAKE_VERSION({{Global "VERSION_MAJOR"}}, {{Global "VERSION_MINOR"}}, {{Global "VERSION_PATCH"}})

#if defined(__cplusplus) && (_MSC_VER >= 1800 || __cplusplus >= 201103L)
    #define VK_NULL_HANDLE nullptr
#else
    #define VK_NULL_HANDLE 0
#endif

#define VK_DEFINE_HANDLE(obj) typedef struct obj##_T* obj;

#if defined(__cplusplus)
#if (_MSC_VER >= 1800 || __cplusplus >= 201103L)
#if ((defined(_MSC_VER) && _MSC_VER >= 1800 || __cplusplus >= 201103L)
// The bool operator only works if there are no implicit conversions from an obj to
// a bool-compatible type, which can then be used to unintentionally violate type safety.
// C++11 and above supports the "explicit" keyword on conversion operators to stop this
@@ -65,13 +71,18 @@ extern "C" {
//     if (obj) vkDestroy(obj);
#define VK_NONDISP_HANDLE_OPERATOR_BOOL() \
    explicit operator bool() const { return handle != 0; }
#define VK_NONDISP_HANDLE_CONSTRUCTOR_FROM_UINT64(obj) \
    explicit obj(uint64_t x) : handle(x) { } \
    obj(decltype(nullptr)) : handle(0) { }
#else
#define VK_NONDISP_HANDLE_OPERATOR_BOOL()
#define VK_NONDISP_HANDLE_CONSTRUCTOR_FROM_UINT64(obj) \
    obj(uint64_t x) : handle(x) { }
#endif
#define VK_DEFINE_NONDISP_HANDLE(obj)                                              \
    struct obj {                                                                   \
        obj() : handle(0) { }                                                      \
        obj(uint64_t x) : handle(x) { }                                            \
        VK_NONDISP_HANDLE_CONSTRUCTOR_FROM_UINT64(obj)                             \
        obj& operator=(uint64_t x) {                                               \
            handle = x;                                                            \
            return *this;                                                          \
@@ -87,11 +98,13 @@ extern "C" {
    typedef struct obj##_T { uint64_t handle; } obj;
#endif

#define VK_LOD_CLAMP_NONE       MAX_FLOAT
#define VK_LAST_MIP_LEVEL       UINT32_MAX
#define VK_LAST_ARRAY_SLICE     UINT32_MAX
#define VK_WHOLE_SIZE           UINT64_MAX
#define VK_ATTACHMENT_UNUSED    UINT32_MAX
#define VK_LOD_CLAMP_NONE         1000.0f
#define VK_REMAINING_MIP_LEVELS   (~0U)
#define VK_REMAINING_ARRAY_LAYERS (~0U)
#define VK_WHOLE_SIZE             (~0ULL)
#define VK_ATTACHMENT_UNUSED      (~0U)
define VK_QUEUE_FAMILY_IGNORED    (~0U)
define VK_SUBPASS_EXTERNAL        (~0U)
{{range $d := $.Definitions}}
  {{if HasPrefix $d.Name "VK_"}}#define {{$d.Name}}  {{$d.Expression}}{{end}}
{{end}}
Loading