diff --git a/src/gfxstream/guest/vulkan_enc/Resources.cpp b/src/gfxstream/guest/vulkan_enc/Resources.cpp index 3c770930adb..1aba0ec1c0b 100644 --- a/src/gfxstream/guest/vulkan_enc/Resources.cpp +++ b/src/gfxstream/guest/vulkan_enc/Resources.cpp @@ -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; \ diff --git a/src/gfxstream/guest/vulkan_enc/Resources.h b/src/gfxstream/guest/vulkan_enc/Resources.h index af0aaa76ca0..bed9d26e28d 100644 --- a/src/gfxstream/guest/vulkan_enc/Resources.h +++ b/src/gfxstream/guest/vulkan_enc/Resources.h @@ -13,9 +13,9 @@ // limitations under the License. #pragma once -#if defined(__ANDROID__) +#if defined(__ANDROID__) || defined(__Fuchsia__) #include -#endif // defined(__ANDROID__) +#endif #include #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;