goldfish-opengl: : enable deferredMapping and align to host requirements

- deferredMapping speeds up CTS runs in certain cases
- Some platforms need 16Kib blobs

BUG=281527670
BUG=280064176
TEST=launch_cvd --gpu_mode=gfxstream_guest_angle
     launch_cvd --gpu_mode=gfxstream

Change-Id: Idc8a3e7311c170bac8ac4dc7ae462311b45342c5
diff --git a/system/vulkan_enc/ResourceTracker.cpp b/system/vulkan_enc/ResourceTracker.cpp
index e74392f..f6dec28 100644
--- a/system/vulkan_enc/ResourceTracker.cpp
+++ b/system/vulkan_enc/ResourceTracker.cpp
@@ -80,13 +80,12 @@
 #include "HostVisibleMemoryVirtualization.h"
 #include "Resources.h"
 #include "VkEncoder.h"
-
 #include "aemu/base/AlignedBuf.h"
 #include "aemu/base/synchronization/AndroidLock.h"
-#include "virtgpu_gfxstream_protocol.h"
-
 #include "goldfish_address_space.h"
 #include "goldfish_vk_private_defs.h"
+#include "util.h"
+#include "virtgpu_gfxstream_protocol.h"
 #ifdef VK_USE_PLATFORM_ANDROID_KHR
 #include "vk_format_info.h"
 #endif
@@ -3000,7 +2999,8 @@
         vk_struct_chain_iterator structChainIter = vk_make_chain_iterator(&hostAllocationInfo);
 
         if (mCaps.gfxstreamCapset.deferredMapping || mCaps.params[kParamCreateGuestHandle]) {
-            hostAllocationInfo.allocationSize = ALIGN(pAllocateInfo->allocationSize, 4096);
+            hostAllocationInfo.allocationSize =
+                ALIGN(pAllocateInfo->allocationSize, mCaps.gfxstreamCapset.blobAlignment);
         } else if (dedicated) {
             // Over-aligning to kLargestSize to some Windows drivers (b:152769369).  Can likely
             // have host report the desired alignment.