Fix dispatchable object layout on Fuchsia
Partial revert of 650c0c033aceede8f1eb6088c9fe7fbceba1c34b. Reviewed-by: Aaron Ruby <aruby@blackberry.com> Acked-by: Yonggang Luo <luoyonggang@gmail.com> Acked-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
This commit is contained in:
@@ -28,11 +28,11 @@
|
||||
|
||||
extern "C" {
|
||||
|
||||
#if defined(__ANDROID__)
|
||||
#define SET_ANDROID_HWVULKAN_DISPATCH_MAGIC res->dispatch.magic = HWVULKAN_DISPATCH_MAGIC;
|
||||
#if defined(__ANDROID__) || defined(__Fuchsia__)
|
||||
#define SET_HWVULKAN_DISPATCH_MAGIC res->dispatch.magic = HWVULKAN_DISPATCH_MAGIC;
|
||||
#else
|
||||
#define SET_ANDROID_HWVULKAN_DISPATCH_MAGIC
|
||||
#endif // defined(__ANDROID__)
|
||||
#define SET_HWVULKAN_DISPATCH_MAGIC
|
||||
#endif
|
||||
|
||||
#define GOLDFISH_VK_NEW_DISPATCHABLE_FROM_HOST_IMPL(type) \
|
||||
type new_from_host_##type(type underlying) { \
|
||||
@@ -42,7 +42,7 @@ extern "C" {
|
||||
ALOGE("FATAL: Failed to alloc " #type " handle"); \
|
||||
abort(); \
|
||||
} \
|
||||
SET_ANDROID_HWVULKAN_DISPATCH_MAGIC \
|
||||
SET_HWVULKAN_DISPATCH_MAGIC \
|
||||
res->underlying = (uint64_t)underlying; \
|
||||
res->lastUsedEncoder = nullptr; \
|
||||
res->sequenceNumber = 0; \
|
||||
@@ -99,7 +99,7 @@ extern "C" {
|
||||
ALOGE("FATAL: Failed to alloc " #type " handle"); \
|
||||
abort(); \
|
||||
} \
|
||||
SET_ANDROID_HWVULKAN_DISPATCH_MAGIC \
|
||||
SET_HWVULKAN_DISPATCH_MAGIC \
|
||||
res->underlying = underlying; \
|
||||
res->lastUsedEncoder = nullptr; \
|
||||
res->sequenceNumber = 0; \
|
||||
|
||||
@@ -13,9 +13,9 @@
|
||||
// limitations under the License.
|
||||
#pragma once
|
||||
|
||||
#if defined(__ANDROID__)
|
||||
#if defined(__ANDROID__) || defined(__Fuchsia__)
|
||||
#include <hardware/hwvulkan.h>
|
||||
#endif // defined(__ANDROID__)
|
||||
#endif
|
||||
#include <vulkan/vulkan.h>
|
||||
|
||||
#include "VulkanHandles.h"
|
||||
@@ -47,15 +47,15 @@ struct goldfish_vk_object_list {
|
||||
struct goldfish_vk_object_list* next;
|
||||
};
|
||||
|
||||
#if defined(__ANDROID__)
|
||||
#define DECLARE_ANDROID_HWVULKAN_DISPATCH hwvulkan_dispatch_t dispatch;
|
||||
#if defined(__ANDROID__) || defined(__Fuchsia__)
|
||||
#define DECLARE_HWVULKAN_DISPATCH hwvulkan_dispatch_t dispatch;
|
||||
#else
|
||||
#define DECLARE_ANDROID_HWVULKAN_DISPATCH
|
||||
#endif // defined(__ANDROID__)
|
||||
#define DECLARE_HWVULKAN_DISPATCH
|
||||
#endif
|
||||
|
||||
#define GOLDFISH_VK_DEFINE_DISPATCHABLE_HANDLE_STRUCT(type) \
|
||||
struct goldfish_##type { \
|
||||
DECLARE_ANDROID_HWVULKAN_DISPATCH \
|
||||
DECLARE_HWVULKAN_DISPATCH \
|
||||
uint64_t underlying; \
|
||||
gfxstream::vk::VkEncoder* lastUsedEncoder; \
|
||||
uint32_t sequenceNumber; \
|
||||
@@ -132,7 +132,7 @@ struct goldfish_VkDescriptorSetLayout {
|
||||
};
|
||||
|
||||
struct goldfish_VkCommandBuffer {
|
||||
DECLARE_ANDROID_HWVULKAN_DISPATCH
|
||||
DECLARE_HWVULKAN_DISPATCH
|
||||
uint64_t underlying;
|
||||
gfxstream::vk::VkEncoder* lastUsedEncoder;
|
||||
uint32_t sequenceNumber;
|
||||
|
||||
Reference in New Issue
Block a user