vk::Move<vk::VkDeviceMemory> indexBufferMemory;
vk::Move<vk::VkDeviceMemory> uniformBufferMemory;
vk::Move<vk::VkDeviceMemory> sboBufferMemory;
- vk::Move<vk::VkDeviceMemory> imageMemory;
+ vk::Move<vk::VkDeviceMemory> renderImageMemory;
+ vk::Move<vk::VkDeviceMemory> readImageMemory;
Move<VkRenderPass> renderPass;
Move<VkImage> renderImage;
memoryTypeNdx = getMemoryIndex(memReqs.memoryTypeBits, m_useHostMemory ? 0 : VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT);
allocInfo.allocationSize = memReqs.size;
allocInfo.memoryTypeIndex = memoryTypeNdx;
- imageMemory = allocateMemory(vk, *m_deviceGroup, &allocInfo);
+ renderImageMemory = allocateMemory(vk, *m_deviceGroup, &allocInfo);
+
+ dedicatedAllocInfo.image = *readImage;
+ dedicatedAllocInfo.buffer = DE_NULL;
+ memReqs = getImageMemoryRequirements(vk, *m_deviceGroup, readImage.get());
+ memoryTypeNdx = getMemoryIndex(memReqs.memoryTypeBits, m_useHostMemory ? 0 : VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT);
+ allocInfo.allocationSize = memReqs.size;
+ allocInfo.memoryTypeIndex = memoryTypeNdx;
+ readImageMemory = allocateMemory(vk, *m_deviceGroup, &allocInfo);
}
- VK_CHECK(vk.bindImageMemory(*m_deviceGroup, *renderImage, imageMemory.get(), 0));
- VK_CHECK(vk.bindImageMemory(*m_deviceGroup, *readImage, imageMemory.get(), 0));
+ VK_CHECK(vk.bindImageMemory(*m_deviceGroup, *renderImage, renderImageMemory.get(), 0));
+ VK_CHECK(vk.bindImageMemory(*m_deviceGroup, *readImage, readImageMemory.get(), 0));
// Create renderpass
{
VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO, // sType
&devGroupBindInfo, // pNext
*renderImage, // image
- imageMemory.get(), // memory
+ renderImageMemory.get(), // memory
0u, // memoryOffset
};
VK_CHECK(vk.bindImageMemory2(*m_deviceGroup, 1, &bindInfo));
VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO, // sType
&devGroupBindInfo, // pNext
peerImage.get(), // image
- imageMemory.get(), // memory
+ renderImageMemory.get(), // memory
0u, // memoryOffset
};
VK_CHECK(vk.bindImageMemory2(*m_deviceGroup, 1, &bindInfo));