diff options
author | Gurchetan Singh <gurchetansingh@google.com> | 2022-07-25 08:46:14 -0700 |
---|---|---|
committer | Gurchetan Singh <gurchetansingh@google.com> | 2022-07-25 08:58:44 -0700 |
commit | 7faa36c4d27ef043825dfb11a802c3dd20e6ef93 (patch) | |
tree | fbf3a160ea14ef4dc0c95dc669d9a12f2a469dbe | |
parent | a03b7373df4af5324f190e79418f449b19125188 (diff) | |
download | goldfish-opengl-7faa36c4d27ef043825dfb11a802c3dd20e6ef93.tar.gz |
goldfish-opengl: VK_KHR_imageless_framebuffer
Output of codegen. No additional streamFeature is specified,
since this extension will be only exposed on Linux guests where
we can have confidence the host is up to date.
BUG=240145689
TEST=no failures in ./deqp-vk --deqp-case=dEQP-VK.imageless_framebuffer.*
Change-Id: I234030bfe473292ccd9690684c7ab20156c56f4e
-rw-r--r-- | system/vulkan_enc/goldfish_vk_counting_guest.cpp | 7 | ||||
-rw-r--r-- | system/vulkan_enc/goldfish_vk_marshaling_guest.cpp | 30 | ||||
-rw-r--r-- | system/vulkan_enc/goldfish_vk_reserved_marshaling_guest.cpp | 17 |
3 files changed, 35 insertions, 19 deletions
diff --git a/system/vulkan_enc/goldfish_vk_counting_guest.cpp b/system/vulkan_enc/goldfish_vk_counting_guest.cpp index 086bc3fc..dee66827 100644 --- a/system/vulkan_enc/goldfish_vk_counting_guest.cpp +++ b/system/vulkan_enc/goldfish_vk_counting_guest.cpp @@ -2377,9 +2377,12 @@ void count_VkFramebufferCreateInfo( uint64_t cgen_var_0; *count += 1 * 8; *count += sizeof(uint32_t); - if (toCount->attachmentCount) + if ((!(featureBits & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT) || (((toCount->flags & VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT) == 0)))) { - *count += toCount->attachmentCount * 8; + if (toCount->attachmentCount) + { + *count += toCount->attachmentCount * 8; + } } *count += sizeof(uint32_t); *count += sizeof(uint32_t); diff --git a/system/vulkan_enc/goldfish_vk_marshaling_guest.cpp b/system/vulkan_enc/goldfish_vk_marshaling_guest.cpp index e53bcd29..de837fe0 100644 --- a/system/vulkan_enc/goldfish_vk_marshaling_guest.cpp +++ b/system/vulkan_enc/goldfish_vk_marshaling_guest.cpp @@ -4130,12 +4130,15 @@ void marshal_VkFramebufferCreateInfo( vkStream->handleMapping()->mapHandles_VkRenderPass_u64(&forMarshaling->renderPass, &cgen_var_0, 1); vkStream->write((uint64_t*)&cgen_var_0, 1 * 8); vkStream->write((uint32_t*)&forMarshaling->attachmentCount, sizeof(uint32_t)); - if (forMarshaling->attachmentCount) + if ((!(vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT) || (((forMarshaling->flags & VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT) == 0)))) { - uint64_t* cgen_var_1; - vkStream->alloc((void**)&cgen_var_1, forMarshaling->attachmentCount * 8); - vkStream->handleMapping()->mapHandles_VkImageView_u64(forMarshaling->pAttachments, cgen_var_1, forMarshaling->attachmentCount); - vkStream->write((uint64_t*)cgen_var_1, forMarshaling->attachmentCount * 8); + if (forMarshaling->attachmentCount) + { + uint64_t* cgen_var_0_0; + vkStream->alloc((void**)&cgen_var_0_0, forMarshaling->attachmentCount * 8); + vkStream->handleMapping()->mapHandles_VkImageView_u64(forMarshaling->pAttachments, cgen_var_0_0, forMarshaling->attachmentCount); + vkStream->write((uint64_t*)cgen_var_0_0, forMarshaling->attachmentCount * 8); + } } vkStream->write((uint32_t*)&forMarshaling->width, sizeof(uint32_t)); vkStream->write((uint32_t*)&forMarshaling->height, sizeof(uint32_t)); @@ -4159,12 +4162,19 @@ void unmarshal_VkFramebufferCreateInfo( vkStream->read((uint64_t*)&cgen_var_0, 1 * 8); vkStream->handleMapping()->mapHandles_u64_VkRenderPass(&cgen_var_0, (VkRenderPass*)&forUnmarshaling->renderPass, 1); vkStream->read((uint32_t*)&forUnmarshaling->attachmentCount, sizeof(uint32_t)); - if (forUnmarshaling->attachmentCount) + if ((!(vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT) || (((forUnmarshaling->flags & VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT) == 0)))) { - uint64_t* cgen_var_1; - vkStream->alloc((void**)&cgen_var_1, forUnmarshaling->attachmentCount * 8); - vkStream->read((uint64_t*)cgen_var_1, forUnmarshaling->attachmentCount * 8); - vkStream->handleMapping()->mapHandles_u64_VkImageView(cgen_var_1, (VkImageView*)forUnmarshaling->pAttachments, forUnmarshaling->attachmentCount); + if (forUnmarshaling->attachmentCount) + { + uint64_t* cgen_var_0_0; + vkStream->alloc((void**)&cgen_var_0_0, forUnmarshaling->attachmentCount * 8); + vkStream->read((uint64_t*)cgen_var_0_0, forUnmarshaling->attachmentCount * 8); + vkStream->handleMapping()->mapHandles_u64_VkImageView(cgen_var_0_0, (VkImageView*)forUnmarshaling->pAttachments, forUnmarshaling->attachmentCount); + } + } + else + { + forUnmarshaling->pAttachments = 0; } vkStream->read((uint32_t*)&forUnmarshaling->width, sizeof(uint32_t)); vkStream->read((uint32_t*)&forUnmarshaling->height, sizeof(uint32_t)); diff --git a/system/vulkan_enc/goldfish_vk_reserved_marshaling_guest.cpp b/system/vulkan_enc/goldfish_vk_reserved_marshaling_guest.cpp index 53a635db..436f9927 100644 --- a/system/vulkan_enc/goldfish_vk_reserved_marshaling_guest.cpp +++ b/system/vulkan_enc/goldfish_vk_reserved_marshaling_guest.cpp @@ -2964,18 +2964,21 @@ void reservedmarshal_VkFramebufferCreateInfo( *ptr += 1 * 8; memcpy(*ptr, (uint32_t*)&forMarshaling->attachmentCount, sizeof(uint32_t)); *ptr += sizeof(uint32_t); - if (forMarshaling->attachmentCount) + if ((!(vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT) || (((forMarshaling->flags & VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT) == 0)))) { - uint8_t* cgen_var_1_ptr = (uint8_t*)(*ptr); - if (forMarshaling) + if (forMarshaling->attachmentCount) { - for (uint32_t k = 0; k < forMarshaling->attachmentCount; ++k) + uint8_t* cgen_var_0_0_ptr = (uint8_t*)(*ptr); + if (forMarshaling) { - uint64_t tmpval = get_host_u64_VkImageView(forMarshaling->pAttachments[k]); - memcpy(cgen_var_1_ptr + k * 8, &tmpval, sizeof(uint64_t)); + for (uint32_t k = 0; k < forMarshaling->attachmentCount; ++k) + { + uint64_t tmpval = get_host_u64_VkImageView(forMarshaling->pAttachments[k]); + memcpy(cgen_var_0_0_ptr + k * 8, &tmpval, sizeof(uint64_t)); + } } + *ptr += 8 * forMarshaling->attachmentCount; } - *ptr += 8 * forMarshaling->attachmentCount; } memcpy(*ptr, (uint32_t*)&forMarshaling->width, sizeof(uint32_t)); *ptr += sizeof(uint32_t); |