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

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

Merge "vulkan: rewrite top of loader" into nyc-dev am: 1285a682

am: 927a222c

* commit '927a222c':
  vulkan: rewrite top of loader

Change-Id: Id45d109559072937604d0225121f41ff34136f06
parents e2616255 927a222c
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ We generate several parts of the loader and tools from a Vulkan API description
- You should now have `$GOPATH/bin/apic`. You might want to add `$GOPATH/bin` to your `$PATH`.

### Generating code
To generate `libvulkan/dispatch_gen.*`,
To generate `libvulkan/*_gen.*`,
- `$ cd libvulkan`
- `$ apic template ../api/vulkan.api dispatch.tmpl`
- `$ apic template ../api/vulkan.api code-generator.tmpl`
Similar for `nulldrv/null_driver_gen.*`.
+3 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ LOCAL_CLANG := true
LOCAL_SANITIZE := integer

LOCAL_CFLAGS := -DLOG_TAG=\"vulkan\" \
	-DVK_USE_PLATFORM_ANDROID_KHR \
	-std=c99 -fvisibility=hidden -fstrict-aliasing \
	-Weverything -Werror \
	-Wno-padded \
@@ -38,6 +39,8 @@ LOCAL_C_INCLUDES := \
	system/core/libsync/include

LOCAL_SRC_FILES := \
	api.cpp \
	api_gen.cpp \
	debug_report.cpp \
	dispatch_gen.cpp \
	layers_extensions.cpp \
+1024 −0

File added.

Preview size limit exceeded, changes collapsed.

vulkan/libvulkan/api.h

0 → 100644
+61 −0
Original line number Diff line number Diff line
/*
 * Copyright 2016 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef LIBVULKAN_API_H
#define LIBVULKAN_API_H 1

#include <vulkan/vulkan.h>
#include "api_gen.h"
#include "driver.h"

namespace vulkan {
namespace api {

// clang-format off
VKAPI_ATTR VkResult CreateInstance(const VkInstanceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkInstance* pInstance);
VKAPI_ATTR void DestroyInstance(VkInstance instance, const VkAllocationCallbacks* pAllocator);
VKAPI_ATTR VkResult CreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDevice* pDevice);
VKAPI_ATTR void DestroyDevice(VkDevice device, const VkAllocationCallbacks* pAllocator);
VKAPI_ATTR VkResult EnumerateInstanceLayerProperties(uint32_t* pPropertyCount, VkLayerProperties* pProperties);
VKAPI_ATTR VkResult EnumerateInstanceExtensionProperties(const char* pLayerName, uint32_t* pPropertyCount, VkExtensionProperties* pProperties);
VKAPI_ATTR VkResult EnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkLayerProperties* pProperties);
VKAPI_ATTR VkResult EnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice, const char* pLayerName, uint32_t* pPropertyCount, VkExtensionProperties* pProperties);
// clang-format on

inline InstanceData& GetData(VkInstance instance) {
    return driver::GetData(instance).opaque_api_data;
}

inline InstanceData& GetData(VkPhysicalDevice physical_dev) {
    return driver::GetData(physical_dev).opaque_api_data;
}

inline DeviceData& GetData(VkDevice dev) {
    return driver::GetData(dev).opaque_api_data;
}

inline DeviceData& GetData(VkQueue queue) {
    return driver::GetData(queue).opaque_api_data;
}

inline DeviceData& GetData(VkCommandBuffer cmd) {
    return driver::GetData(cmd).opaque_api_data;
}

}  // namespace api
}  // namespace vulkan

#endif  // LIBVULKAN_API_H
+1170 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading