Reland^2: Use "gfxstream" namespace
This reverts commit 04c96274efbb8c845f7a4a8609f85fd4c6982ef3.
Reland adds in aosp/2516595 which was only built on the "full"
target and removes namespace around window methods to satisfy
MacOS build.
Bug: b/271464937
Test: android build
Test: cmake build
Change-Id: Iaf9c35e89938613e998110641a5112872e079c57
diff --git a/system/vulkan_enc/AndroidHardwareBuffer.cpp b/system/vulkan_enc/AndroidHardwareBuffer.cpp
index 057b7e7..f31c04d 100644
--- a/system/vulkan_enc/AndroidHardwareBuffer.cpp
+++ b/system/vulkan_enc/AndroidHardwareBuffer.cpp
@@ -27,7 +27,8 @@
#include "vk_util.h"
#include <assert.h>
-namespace goldfish_vk {
+namespace gfxstream {
+namespace vk {
// From Intel ANV implementation.
/* Construct ahw usage mask from image usage bits, see
@@ -342,4 +343,5 @@
return VK_SUCCESS;
}
-} // namespace goldfish_vk
+} // namespace vk
+} // namespace gfxstream
diff --git a/system/vulkan_enc/AndroidHardwareBuffer.h b/system/vulkan_enc/AndroidHardwareBuffer.h
index 2a6e182..9c9cb94 100644
--- a/system/vulkan_enc/AndroidHardwareBuffer.h
+++ b/system/vulkan_enc/AndroidHardwareBuffer.h
@@ -24,7 +24,8 @@
class Gralloc;
-namespace goldfish_vk {
+namespace gfxstream {
+namespace vk {
uint64_t
getAndroidHardwareBufferUsageFromVkUsage(
@@ -58,4 +59,5 @@
VkDeviceSize allocationInfoAllocSize,
struct AHardwareBuffer **out);
-} // namespace goldfish_vk
+} // namespace vk
+} // namespace gfxstream
diff --git a/system/vulkan_enc/CommandBufferStagingStream.cpp b/system/vulkan_enc/CommandBufferStagingStream.cpp
index 8487bcd..ae23410 100644
--- a/system/vulkan_enc/CommandBufferStagingStream.cpp
+++ b/system/vulkan_enc/CommandBufferStagingStream.cpp
@@ -33,6 +33,9 @@
static const size_t kReadSize = 512 * 1024;
static const size_t kWriteOffset = kReadSize;
+namespace gfxstream {
+namespace vk {
+
CommandBufferStagingStream::CommandBufferStagingStream()
: IOStream(1048576), m_size(0), m_writePos(0) {
// use default allocators
@@ -248,4 +251,7 @@
IOStream::rewind();
}
-VkDeviceMemory CommandBufferStagingStream::getDeviceMemory() { return m_mem.deviceMemory; }
\ No newline at end of file
+VkDeviceMemory CommandBufferStagingStream::getDeviceMemory() { return m_mem.deviceMemory; }
+
+} // namespace vk
+} // namespace gfxstream
diff --git a/system/vulkan_enc/CommandBufferStagingStream.h b/system/vulkan_enc/CommandBufferStagingStream.h
index 2742e20..9aa9e96 100644
--- a/system/vulkan_enc/CommandBufferStagingStream.h
+++ b/system/vulkan_enc/CommandBufferStagingStream.h
@@ -22,6 +22,9 @@
#include "IOStream.h"
+namespace gfxstream {
+namespace vk {
+
class CommandBufferStagingStream : public IOStream {
public:
// host will write kSyncDataReadComplete to the sync bytes to indicate memory is no longer being
@@ -110,4 +113,7 @@
unsigned char* getDataPtr();
};
+} // namespace vk
+} // namespace gfxstream
+
#endif
diff --git a/system/vulkan_enc/DescriptorSetVirtualization.cpp b/system/vulkan_enc/DescriptorSetVirtualization.cpp
index 94c9df8..0cc6826 100644
--- a/system/vulkan_enc/DescriptorSetVirtualization.cpp
+++ b/system/vulkan_enc/DescriptorSetVirtualization.cpp
@@ -15,7 +15,8 @@
#include "DescriptorSetVirtualization.h"
#include "Resources.h"
-namespace goldfish_vk {
+namespace gfxstream {
+namespace vk {
void clearReifiedDescriptorSet(ReifiedDescriptorSet* set) {
set->pool = VK_NULL_HANDLE;
@@ -494,4 +495,5 @@
return toClear;
}
-} // namespace goldfish_vk
+} // namespace vk
+} // namespace gfxstream
diff --git a/system/vulkan_enc/DescriptorSetVirtualization.h b/system/vulkan_enc/DescriptorSetVirtualization.h
index ecb6c48..15e4226 100644
--- a/system/vulkan_enc/DescriptorSetVirtualization.h
+++ b/system/vulkan_enc/DescriptorSetVirtualization.h
@@ -21,7 +21,8 @@
#include <unordered_set>
#include <vector>
-namespace goldfish_vk {
+namespace gfxstream {
+namespace vk {
enum DescriptorWriteType {
Empty = 0,
@@ -148,4 +149,5 @@
std::vector<VkDescriptorSet> clearDescriptorPool(VkDescriptorPool pool, bool usePoolIds);
-} // namespace goldfish_vk
+} // namespace vk
+} // namespace gfxstream
diff --git a/system/vulkan_enc/HostVisibleMemoryVirtualization.cpp b/system/vulkan_enc/HostVisibleMemoryVirtualization.cpp
index 5707170..5f3b23a 100644
--- a/system/vulkan_enc/HostVisibleMemoryVirtualization.cpp
+++ b/system/vulkan_enc/HostVisibleMemoryVirtualization.cpp
@@ -26,7 +26,8 @@
using android::base::guest::SubAllocator;
-namespace goldfish_vk {
+namespace gfxstream {
+namespace vk {
bool isHostVisible(const VkPhysicalDeviceMemoryProperties* memoryProps, uint32_t index) {
return memoryProps->memoryTypes[index].propertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
@@ -68,4 +69,5 @@
return true;
}
-} // namespace goldfish_vk
+} // namespace vk
+} // namespace gfxstream
diff --git a/system/vulkan_enc/HostVisibleMemoryVirtualization.h b/system/vulkan_enc/HostVisibleMemoryVirtualization.h
index 272e51a..eaef30e 100644
--- a/system/vulkan_enc/HostVisibleMemoryVirtualization.h
+++ b/system/vulkan_enc/HostVisibleMemoryVirtualization.h
@@ -32,7 +32,8 @@
#include "VirtGpu.h"
-namespace goldfish_vk {
+namespace gfxstream {
+namespace vk {
bool isHostVisible(const VkPhysicalDeviceMemoryProperties* memoryProps, uint32_t index);
@@ -66,4 +67,5 @@
using CoherentMemoryPtr = std::shared_ptr<CoherentMemory>;
-} // namespace goldfish_vk
+} // namespace vk
+} // namespace gfxstream
diff --git a/system/vulkan_enc/ResourceTracker.cpp b/system/vulkan_enc/ResourceTracker.cpp
index 023cca1..d5e3645 100644
--- a/system/vulkan_enc/ResourceTracker.cpp
+++ b/system/vulkan_enc/ResourceTracker.cpp
@@ -144,7 +144,8 @@
using android::base::guest::Lock;
using android::base::guest::WorkPool;
-namespace goldfish_vk {
+namespace gfxstream {
+namespace vk {
#define MAKE_HANDLE_MAPPING_FOREACH(type_name, map_impl, map_to_u64_impl, map_from_u64_impl) \
void mapHandles_##type_name(type_name* handles, size_t count) override { \
@@ -8375,4 +8376,5 @@
LIST_TRIVIAL_TRANSFORMED_TYPES(DEFINE_TRANSFORMED_TYPE_IMPL)
-} // namespace goldfish_vk
+} // namespace vk
+} // namespace gfxstream
diff --git a/system/vulkan_enc/ResourceTracker.h b/system/vulkan_enc/ResourceTracker.h
index 2cb5b2a..8df5797 100644
--- a/system/vulkan_enc/ResourceTracker.h
+++ b/system/vulkan_enc/ResourceTracker.h
@@ -29,7 +29,8 @@
class HostConnection;
-namespace goldfish_vk {
+namespace gfxstream {
+namespace vk {
class VkEncoder;
@@ -679,4 +680,5 @@
std::unique_ptr<Impl> mImpl;
};
-} // namespace goldfish_vk
+} // namespace vk
+} // namespace gfxstream
diff --git a/system/vulkan_enc/Resources.cpp b/system/vulkan_enc/Resources.cpp
index 041b00b..229c675 100644
--- a/system/vulkan_enc/Resources.cpp
+++ b/system/vulkan_enc/Resources.cpp
@@ -182,7 +182,8 @@
} // extern "C"
-namespace goldfish_vk {
+namespace gfxstream {
+namespace vk {
void appendObject(struct goldfish_vk_object_list** begin, void* val) {
D("for %p", val);
@@ -261,4 +262,5 @@
}
}
-} // namespace goldfish_vk
+} // namespace vk
+} // namespace gfxstream
diff --git a/system/vulkan_enc/Resources.h b/system/vulkan_enc/Resources.h
index 17043ca..4b47300 100644
--- a/system/vulkan_enc/Resources.h
+++ b/system/vulkan_enc/Resources.h
@@ -22,12 +22,14 @@
#include <functional>
-namespace goldfish_vk {
+namespace gfxstream {
+namespace vk {
class VkEncoder;
struct DescriptorPoolAllocationInfo;
struct ReifiedDescriptorSet;
struct DescriptorSetLayoutInfo;
-} // namespace goldfish_vk
+} // namespace vk
+} // namespace gfxstream
class IOStream;
@@ -42,9 +44,9 @@
struct goldfish_##type { \
hwvulkan_dispatch_t dispatch; \
uint64_t underlying; \
- goldfish_vk::VkEncoder* lastUsedEncoder; \
+ gfxstream::vk::VkEncoder* lastUsedEncoder; \
uint32_t sequenceNumber; \
- goldfish_vk::VkEncoder* privateEncoder; \
+ gfxstream::vk::VkEncoder* privateEncoder; \
IOStream* privateStream; \
uint32_t flags; \
struct goldfish_vk_object_list* poolObjects; \
@@ -103,25 +105,25 @@
struct goldfish_VkDescriptorPool {
uint64_t underlying;
- goldfish_vk::DescriptorPoolAllocationInfo* allocInfo;
+ gfxstream::vk::DescriptorPoolAllocationInfo* allocInfo;
};
struct goldfish_VkDescriptorSet {
uint64_t underlying;
- goldfish_vk::ReifiedDescriptorSet* reified;
+ gfxstream::vk::ReifiedDescriptorSet* reified;
};
struct goldfish_VkDescriptorSetLayout {
uint64_t underlying;
- goldfish_vk::DescriptorSetLayoutInfo* layoutInfo;
+ gfxstream::vk::DescriptorSetLayoutInfo* layoutInfo;
};
struct goldfish_VkCommandBuffer {
hwvulkan_dispatch_t dispatch;
uint64_t underlying;
- goldfish_vk::VkEncoder* lastUsedEncoder;
+ gfxstream::vk::VkEncoder* lastUsedEncoder;
uint32_t sequenceNumber;
- goldfish_vk::VkEncoder* privateEncoder;
+ gfxstream::vk::VkEncoder* privateEncoder;
IOStream* privateStream;
uint32_t flags;
struct goldfish_vk_object_list* poolObjects;
@@ -134,11 +136,13 @@
} // extern "C"
-namespace goldfish_vk {
+namespace gfxstream {
+namespace vk {
void appendObject(struct goldfish_vk_object_list** begin, void* val);
void eraseObject(struct goldfish_vk_object_list** begin, void* val);
void eraseObjects(struct goldfish_vk_object_list** begin);
void forAllObjects(struct goldfish_vk_object_list* begin, std::function<void(void*)> func);
-} // namespace goldfish_vk
+} // namespace vk
+} // namespace gfxstream
diff --git a/system/vulkan_enc/Validation.cpp b/system/vulkan_enc/Validation.cpp
index e50fa27..3b75786 100644
--- a/system/vulkan_enc/Validation.cpp
+++ b/system/vulkan_enc/Validation.cpp
@@ -16,7 +16,8 @@
#include "Resources.h"
#include "ResourceTracker.h"
-namespace goldfish_vk {
+namespace gfxstream {
+namespace vk {
VkResult Validation::on_vkFlushMappedMemoryRanges(
void*,
@@ -54,4 +55,5 @@
return VK_SUCCESS;
}
-} // namespace goldfish_vk
+} // namespace vk
+} // namespace gfxstream
diff --git a/system/vulkan_enc/Validation.h b/system/vulkan_enc/Validation.h
index f006633..0dfd2d3 100644
--- a/system/vulkan_enc/Validation.h
+++ b/system/vulkan_enc/Validation.h
@@ -15,7 +15,8 @@
#include <vulkan/vulkan.h>
-namespace goldfish_vk {
+namespace gfxstream {
+namespace vk {
class Validation {
public:
@@ -33,4 +34,5 @@
const VkMappedMemoryRange* pMemoryRanges);
};
-} // namespace goldfish_vk
+} // namespace vk
+} // namespace gfxstream
diff --git a/system/vulkan_enc/VkEncoder.cpp b/system/vulkan_enc/VkEncoder.cpp
index 6f70fb0..8ee3aa9 100644
--- a/system/vulkan_enc/VkEncoder.cpp
+++ b/system/vulkan_enc/VkEncoder.cpp
@@ -56,9 +56,10 @@
#include "goldfish_vk_reserved_marshaling_guest.h"
#include "goldfish_vk_transform_guest.h"
-namespace goldfish_vk {
+namespace gfxstream {
+namespace vk {
-using namespace goldfish_vk;
+using namespace gfxstream::vk;
using android::base::BumpPool;
using android::base::guest::AutoLock;
@@ -64118,4 +64119,5 @@
#ifdef VK_KHR_ray_query
#endif
-} // namespace goldfish_vk
+} // namespace vk
+} // namespace gfxstream
diff --git a/system/vulkan_enc/VkEncoder.h b/system/vulkan_enc/VkEncoder.h
index e5a66db..4e0b762 100644
--- a/system/vulkan_enc/VkEncoder.h
+++ b/system/vulkan_enc/VkEncoder.h
@@ -38,7 +38,8 @@
#include "vulkan_gfxstream.h"
class IOStream;
-namespace goldfish_vk {
+namespace gfxstream {
+namespace vk {
using android::base::guest::HealthMonitor;
@@ -2149,4 +2150,5 @@
HealthMonitor<>* mHealthMonitor;
};
-} // namespace goldfish_vk
+} // namespace vk
+} // namespace gfxstream
diff --git a/system/vulkan_enc/VulkanHandleMapping.cpp b/system/vulkan_enc/VulkanHandleMapping.cpp
index 649244f..068e666 100644
--- a/system/vulkan_enc/VulkanHandleMapping.cpp
+++ b/system/vulkan_enc/VulkanHandleMapping.cpp
@@ -16,7 +16,8 @@
#include "VulkanHandleMapping.h"
-namespace goldfish_vk {
+namespace gfxstream {
+namespace vk {
#define DEFAULT_HANDLE_MAP_DEFINE(type) \
void DefaultHandleMapping::mapHandles_##type(type*, size_t) { return; } \
@@ -29,5 +30,6 @@
GOLDFISH_VK_LIST_HANDLE_TYPES(DEFAULT_HANDLE_MAP_DEFINE)
-} // namespace goldfish_vk
+} // namespace vk
+} // namespace gfxstream
diff --git a/system/vulkan_enc/VulkanHandleMapping.h b/system/vulkan_enc/VulkanHandleMapping.h
index 5c03d7f..7c7fdbc 100644
--- a/system/vulkan_enc/VulkanHandleMapping.h
+++ b/system/vulkan_enc/VulkanHandleMapping.h
@@ -18,7 +18,8 @@
#include "VulkanHandles.h"
-namespace goldfish_vk {
+namespace gfxstream {
+namespace vk {
class VulkanHandleMapping {
public:
@@ -45,4 +46,5 @@
GOLDFISH_VK_LIST_HANDLE_TYPES(DECLARE_HANDLE_MAP_OVERRIDE)
};
-} // namespace goldfish_vk
\ No newline at end of file
+} // namespace vk
+} // namespace gfxstream
\ No newline at end of file
diff --git a/system/vulkan_enc/VulkanHandles.h b/system/vulkan_enc/VulkanHandles.h
index 205e7e5..1c1cbc3 100644
--- a/system/vulkan_enc/VulkanHandles.h
+++ b/system/vulkan_enc/VulkanHandles.h
@@ -16,6 +16,9 @@
#include <vulkan/vulkan.h>
+namespace gfxstream {
+namespace vk {
+
#define GOLDFISH_VK_LIST_TRIVIAL_DISPATCHABLE_HANDLE_TYPES(f) \
f(VkPhysicalDevice) \
@@ -165,3 +168,5 @@
f(VkDescriptorSetLayout) \
f(VkDescriptorSet) \
+} // namespace vk
+} // namespace gfxstream
diff --git a/system/vulkan_enc/VulkanStreamGuest.cpp b/system/vulkan_enc/VulkanStreamGuest.cpp
index fedc826..3c11670 100644
--- a/system/vulkan_enc/VulkanStreamGuest.cpp
+++ b/system/vulkan_enc/VulkanStreamGuest.cpp
@@ -13,7 +13,8 @@
// limitations under the License.
#include "VulkanStreamGuest.h"
-namespace goldfish_vk {
+namespace gfxstream {
+namespace vk {
VulkanStreamGuest::VulkanStreamGuest(IOStream *stream): mStream(stream) {
unsetHandleMapping();
@@ -31,7 +32,7 @@
*ptrAddr = nullptr;
return;
}
-
+
*ptrAddr = mPool.alloc(bytes);
}
@@ -171,4 +172,5 @@
m_read = 0;
}
-} // namespace goldfish_vk
+} // namespace vk
+} // namespace gfxstream
diff --git a/system/vulkan_enc/VulkanStreamGuest.h b/system/vulkan_enc/VulkanStreamGuest.h
index fd73880..48c5a61 100644
--- a/system/vulkan_enc/VulkanStreamGuest.h
+++ b/system/vulkan_enc/VulkanStreamGuest.h
@@ -34,7 +34,8 @@
class IOStream;
-namespace goldfish_vk {
+namespace gfxstream {
+namespace vk {
class VulkanStreamGuest : public android::base::Stream {
public:
@@ -58,7 +59,7 @@
ssize_t read(void *buffer, size_t size) override;
ssize_t write(const void *buffer, size_t size) override;
-
+
void writeLarge(const void* buffer, size_t size);
// Frees everything that got alloc'ed.
@@ -102,4 +103,5 @@
size_t m_read = 0;
};
-} // namespace goldfish_vk
+} // namespace vk
+} // namespace gfxstream
diff --git a/system/vulkan_enc/func_table.cpp b/system/vulkan_enc/func_table.cpp
index 7b5a27c..91cfb6d 100644
--- a/system/vulkan_enc/func_table.cpp
+++ b/system/vulkan_enc/func_table.cpp
@@ -46,7 +46,8 @@
// implement them completely on the guest side.
#undef VK_KHR_android_surface
-namespace goldfish_vk {
+namespace gfxstream {
+namespace vk {
static void sOnInvalidDynamicallyCheckedCall(const char* apiname, const char* neededFeature) {
ALOGE("invalid call to %s: %s not supported", apiname, neededFeature);
@@ -15397,4 +15398,5 @@
return nullptr;
}
-} // namespace goldfish_vk
+} // namespace vk
+} // namespace gfxstream
diff --git a/system/vulkan_enc/func_table.h b/system/vulkan_enc/func_table.h
index a7b7b66..6a04926 100644
--- a/system/vulkan_enc/func_table.h
+++ b/system/vulkan_enc/func_table.h
@@ -33,7 +33,9 @@
#include "vulkan_gfxstream.h"
-namespace goldfish_vk {
+namespace gfxstream {
+namespace vk {
+
#ifdef VK_VERSION_1_0
#endif
#ifdef VK_VERSION_1_1
@@ -580,4 +582,5 @@
void* goldfish_vulkan_get_instance_proc_address(VkInstance instance, const char* name);
void* goldfish_vulkan_get_device_proc_address(VkDevice device, const char* name);
-} // namespace goldfish_vk
+} // namespace vk
+} // namespace gfxstream
diff --git a/system/vulkan_enc/goldfish_vk_counting_guest.cpp b/system/vulkan_enc/goldfish_vk_counting_guest.cpp
index 2a023a7..77e05db 100644
--- a/system/vulkan_enc/goldfish_vk_counting_guest.cpp
+++ b/system/vulkan_enc/goldfish_vk_counting_guest.cpp
@@ -36,7 +36,8 @@
#include "goldfish_vk_extension_structs_guest.h"
#include "goldfish_vk_private_defs.h"
-namespace goldfish_vk {
+namespace gfxstream {
+namespace vk {
void count_extension_struct(uint32_t featureBits, VkStructureType rootType,
const void* structExtension, size_t* count);
@@ -17380,4 +17381,5 @@
}
}
-} // namespace goldfish_vk
+} // namespace vk
+} // namespace gfxstream
diff --git a/system/vulkan_enc/goldfish_vk_counting_guest.h b/system/vulkan_enc/goldfish_vk_counting_guest.h
index 2e29028..4de8da0 100644
--- a/system/vulkan_enc/goldfish_vk_counting_guest.h
+++ b/system/vulkan_enc/goldfish_vk_counting_guest.h
@@ -35,7 +35,9 @@
#include "vk_platform_compat.h"
#include "vulkan_gfxstream.h"
-namespace goldfish_vk {
+namespace gfxstream {
+namespace vk {
+
#ifdef VK_VERSION_1_0
void count_VkExtent2D(uint32_t featureBits, VkStructureType rootType, const VkExtent2D* toCount,
size_t* count);
@@ -3570,4 +3572,5 @@
#endif
-} // namespace goldfish_vk
+} // namespace vk
+} // namespace gfxstream
diff --git a/system/vulkan_enc/goldfish_vk_deepcopy_guest.cpp b/system/vulkan_enc/goldfish_vk_deepcopy_guest.cpp
index 8d30be3..a9676c8 100644
--- a/system/vulkan_enc/goldfish_vk_deepcopy_guest.cpp
+++ b/system/vulkan_enc/goldfish_vk_deepcopy_guest.cpp
@@ -37,7 +37,8 @@
#include "goldfish_vk_private_defs.h"
#include "vk_util.h"
-namespace goldfish_vk {
+namespace gfxstream {
+namespace vk {
void deepcopy_extension_struct(Allocator* alloc, VkStructureType rootType,
const void* structExtension, void* structExtension_out);
@@ -21021,4 +21022,5 @@
}
}
-} // namespace goldfish_vk
+} // namespace vk
+} // namespace gfxstream
diff --git a/system/vulkan_enc/goldfish_vk_deepcopy_guest.h b/system/vulkan_enc/goldfish_vk_deepcopy_guest.h
index 679ddf0..22de00f 100644
--- a/system/vulkan_enc/goldfish_vk_deepcopy_guest.h
+++ b/system/vulkan_enc/goldfish_vk_deepcopy_guest.h
@@ -44,7 +44,9 @@
#undef VK_KHR_android_surface
#undef VK_ANDROID_external_memory_android_hardware_buffer
-namespace goldfish_vk {
+namespace gfxstream {
+namespace vk {
+
#ifdef VK_VERSION_1_0
void deepcopy_VkExtent2D(Allocator* alloc, VkStructureType rootType, const VkExtent2D* from,
VkExtent2D* to);
@@ -3951,4 +3953,5 @@
#endif
-} // namespace goldfish_vk
+} // namespace vk
+} // namespace gfxstream
diff --git a/system/vulkan_enc/goldfish_vk_extension_structs_guest.cpp b/system/vulkan_enc/goldfish_vk_extension_structs_guest.cpp
index aef23e9..6e780ba 100644
--- a/system/vulkan_enc/goldfish_vk_extension_structs_guest.cpp
+++ b/system/vulkan_enc/goldfish_vk_extension_structs_guest.cpp
@@ -31,7 +31,8 @@
#include "goldfish_vk_extension_structs_guest.h"
-namespace goldfish_vk {
+namespace gfxstream {
+namespace vk {
#ifdef VK_VERSION_1_0
#endif
@@ -3424,4 +3425,5 @@
}
}
-} // namespace goldfish_vk
+} // namespace vk
+} // namespace gfxstream
diff --git a/system/vulkan_enc/goldfish_vk_extension_structs_guest.h b/system/vulkan_enc/goldfish_vk_extension_structs_guest.h
index 67d83d7..8a84de5 100644
--- a/system/vulkan_enc/goldfish_vk_extension_structs_guest.h
+++ b/system/vulkan_enc/goldfish_vk_extension_structs_guest.h
@@ -41,7 +41,9 @@
#undef VK_KHR_android_surface
#undef VK_ANDROID_external_memory_android_hardware_buffer
-namespace goldfish_vk {
+namespace gfxstream {
+namespace vk {
+
uint32_t goldfish_vk_struct_type(const void* structExtension);
size_t goldfish_vk_extension_struct_size(VkStructureType rootType, const void* structExtension);
@@ -593,4 +595,5 @@
#ifdef VK_KHR_ray_query
#endif
-} // namespace goldfish_vk
+} // namespace vk
+} // namespace gfxstream
diff --git a/system/vulkan_enc/goldfish_vk_handlemap_guest.cpp b/system/vulkan_enc/goldfish_vk_handlemap_guest.cpp
index 21eee10..f3042ed 100644
--- a/system/vulkan_enc/goldfish_vk_handlemap_guest.cpp
+++ b/system/vulkan_enc/goldfish_vk_handlemap_guest.cpp
@@ -36,7 +36,8 @@
#include "goldfish_vk_extension_structs_guest.h"
#include "goldfish_vk_private_defs.h"
-namespace goldfish_vk {
+namespace gfxstream {
+namespace vk {
void handlemap_extension_struct(VulkanHandleMapping* handlemap, void* structExtension_out);
@@ -10574,4 +10575,5 @@
}
}
-} // namespace goldfish_vk
+} // namespace vk
+} // namespace gfxstream
diff --git a/system/vulkan_enc/goldfish_vk_handlemap_guest.h b/system/vulkan_enc/goldfish_vk_handlemap_guest.h
index a37c141..bfc3090 100644
--- a/system/vulkan_enc/goldfish_vk_handlemap_guest.h
+++ b/system/vulkan_enc/goldfish_vk_handlemap_guest.h
@@ -42,7 +42,9 @@
#undef VK_KHR_android_surface
#undef VK_ANDROID_external_memory_android_hardware_buffer
-namespace goldfish_vk {
+namespace gfxstream {
+namespace vk {
+
#ifdef VK_VERSION_1_0
void handlemap_VkExtent2D(VulkanHandleMapping* handlemap, VkExtent2D* toMap);
@@ -3005,4 +3007,5 @@
#endif
-} // namespace goldfish_vk
+} // namespace vk
+} // namespace gfxstream
diff --git a/system/vulkan_enc/goldfish_vk_marshaling_guest.cpp b/system/vulkan_enc/goldfish_vk_marshaling_guest.cpp
index 3fb53d2..b24484f 100644
--- a/system/vulkan_enc/goldfish_vk_marshaling_guest.cpp
+++ b/system/vulkan_enc/goldfish_vk_marshaling_guest.cpp
@@ -36,7 +36,8 @@
#include "goldfish_vk_extension_structs_guest.h"
#include "goldfish_vk_private_defs.h"
-namespace goldfish_vk {
+namespace gfxstream {
+namespace vk {
void marshal_extension_struct(VulkanStreamGuest* vkStream, VkStructureType rootType,
const void* structExtension);
@@ -33639,4 +33640,5 @@
}
}
-} // namespace goldfish_vk
+} // namespace vk
+} // namespace gfxstream
diff --git a/system/vulkan_enc/goldfish_vk_marshaling_guest.h b/system/vulkan_enc/goldfish_vk_marshaling_guest.h
index 316e356..6098399 100644
--- a/system/vulkan_enc/goldfish_vk_marshaling_guest.h
+++ b/system/vulkan_enc/goldfish_vk_marshaling_guest.h
@@ -44,7 +44,9 @@
#undef VK_KHR_android_surface
#undef VK_ANDROID_external_memory_android_hardware_buffer
-namespace goldfish_vk {
+namespace gfxstream {
+namespace vk {
+
#ifdef VK_VERSION_1_0
void marshal_VkExtent2D(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkExtent2D* forMarshaling);
@@ -7021,4 +7023,5 @@
#define OP_vkFirst 200000000
#define OP_vkLast 300000000
-} // namespace goldfish_vk
+} // namespace vk
+} // namespace gfxstream
diff --git a/system/vulkan_enc/goldfish_vk_reserved_marshaling_guest.cpp b/system/vulkan_enc/goldfish_vk_reserved_marshaling_guest.cpp
index 2631f9b..7cab997 100644
--- a/system/vulkan_enc/goldfish_vk_reserved_marshaling_guest.cpp
+++ b/system/vulkan_enc/goldfish_vk_reserved_marshaling_guest.cpp
@@ -37,7 +37,8 @@
#include "goldfish_vk_extension_structs_guest.h"
#include "goldfish_vk_private_defs.h"
-namespace goldfish_vk {
+namespace gfxstream {
+namespace vk {
void reservedmarshal_extension_struct(VulkanStreamGuest* vkStream, VkStructureType rootType,
const void* structExtension, uint8_t** ptr);
@@ -20280,4 +20281,5 @@
}
}
-} // namespace goldfish_vk
+} // namespace vk
+} // namespace gfxstream
diff --git a/system/vulkan_enc/goldfish_vk_reserved_marshaling_guest.h b/system/vulkan_enc/goldfish_vk_reserved_marshaling_guest.h
index 1449dfd..d35823d 100644
--- a/system/vulkan_enc/goldfish_vk_reserved_marshaling_guest.h
+++ b/system/vulkan_enc/goldfish_vk_reserved_marshaling_guest.h
@@ -44,7 +44,9 @@
#undef VK_KHR_android_surface
#undef VK_ANDROID_external_memory_android_hardware_buffer
-namespace goldfish_vk {
+namespace gfxstream {
+namespace vk {
+
#ifdef VK_VERSION_1_0
void reservedmarshal_VkExtent2D(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkExtent2D* forMarshaling, uint8_t** ptr);
@@ -3863,4 +3865,5 @@
#endif
-} // namespace goldfish_vk
+} // namespace vk
+} // namespace gfxstream
diff --git a/system/vulkan_enc/goldfish_vk_transform_guest.cpp b/system/vulkan_enc/goldfish_vk_transform_guest.cpp
index a5dab78..ac4bffe 100644
--- a/system/vulkan_enc/goldfish_vk_transform_guest.cpp
+++ b/system/vulkan_enc/goldfish_vk_transform_guest.cpp
@@ -37,7 +37,8 @@
#include "goldfish_vk_extension_structs_guest.h"
#include "goldfish_vk_private_defs.h"
-namespace goldfish_vk {
+namespace gfxstream {
+namespace vk {
void transform_tohost_extension_struct(ResourceTracker* resourceTracker, void* structExtension_out);
@@ -20987,4 +20988,5 @@
}
}
-} // namespace goldfish_vk
+} // namespace vk
+} // namespace gfxstream
diff --git a/system/vulkan_enc/goldfish_vk_transform_guest.h b/system/vulkan_enc/goldfish_vk_transform_guest.h
index acbf057..fd0edca 100644
--- a/system/vulkan_enc/goldfish_vk_transform_guest.h
+++ b/system/vulkan_enc/goldfish_vk_transform_guest.h
@@ -35,7 +35,9 @@
#include "vk_platform_compat.h"
#include "vulkan_gfxstream.h"
-namespace goldfish_vk {
+namespace gfxstream {
+namespace vk {
+
class ResourceTracker;
#define LIST_TRIVIAL_TRANSFORMED_TYPES(f) \
f(VkPhysicalDeviceExternalImageFormatInfo) \
@@ -5802,4 +5804,5 @@
#endif
-} // namespace goldfish_vk
+} // namespace vk
+} // namespace gfxstream
diff --git a/system/vulkan_enc/vk_format_info.h b/system/vulkan_enc/vk_format_info.h
index 9bad41a..9fbc82a 100644
--- a/system/vulkan_enc/vk_format_info.h
+++ b/system/vulkan_enc/vk_format_info.h
@@ -38,6 +38,9 @@
#include <vulkan/vulkan.h>
#include <vndk/hardware_buffer.h>
+namespace gfxstream {
+namespace vk {
+
/* See i915_private_android_types.h in minigbm. */
#define HAL_PIXEL_FORMAT_NV12_Y_TILED_INTEL 0x100
@@ -213,4 +216,7 @@
return aspects & VK_IMAGE_ASPECT_DEPTH_BIT;
}
+} // namespace vk
+} // namespace gfxstream
+
#endif /* VK_FORMAT_INFO_H */
diff --git a/system/vulkan_enc/vk_struct_id.h b/system/vulkan_enc/vk_struct_id.h
index 32d6b86..ebc1001 100644
--- a/system/vulkan_enc/vk_struct_id.h
+++ b/system/vulkan_enc/vk_struct_id.h
@@ -18,6 +18,9 @@
#include "goldfish_vk_private_defs.h"
#include "vulkan_gfxstream.h"
+namespace gfxstream {
+namespace vk {
+
template <class T> struct vk_get_vk_struct_id;
#define REGISTER_VK_STRUCT_ID(T, ID) \
@@ -73,3 +76,6 @@
REGISTER_VK_STRUCT_ID(VkMemoryOpaqueCaptureAddressAllocateInfo, VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO);
#undef REGISTER_VK_STRUCT_ID
+
+} // namespace vk
+} // namespace gfxstream
diff --git a/system/vulkan_enc/vk_util.h b/system/vulkan_enc/vk_util.h
index 160bf06..2e3267f 100644
--- a/system/vulkan_enc/vk_util.h
+++ b/system/vulkan_enc/vk_util.h
@@ -29,6 +29,9 @@
#include <stdlib.h>
#include "vk_struct_id.h"
+namespace gfxstream {
+namespace vk {
+
struct vk_struct_common {
VkStructureType sType;
struct vk_struct_common *pNext;
@@ -248,4 +251,7 @@
*i = vk_make_chain_iterator(vk_struct);
}
+} // namespace vk
+} // namespace gfxstream
+
#endif /* VK_UTIL_H */