Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase number of Vulkan swapchain images to 12 #3524

Open
wants to merge 1 commit into
base: v1.x
Choose a base branch
from

Conversation

MartynJacques-Arm
Copy link

Vivo X90 devices provide 11 swapchain images, increase the Vulkan OutputWindow properties to handle this

@@ -550,7 +550,7 @@ class VulkanReplay : public IReplayDriver
VkSurfaceKHR surface;
VkSwapchainKHR swap;
uint32_t numImgs;
VkImage colimg[8];
VkImage colimg[12];
VkImageMemoryBarrier colBarrier[8];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You haven't changed the size of colBarrier here so you're indexing out of bounds. At this point these should be replaced with rdcarray<VkImage> and rdcarray<VkImageMemoryBarrier> and resized properly (there was no reason to before really, it was probably just early bootstrap hardcoded max that never got changed because drivers were usually sane).

Copy link
Owner

@baldurk baldurk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is missing updates to other places that access the colimg/colBarrier arrays - they are accessing the size via ARRAY_COUNT and so will get the wrong count and will crash accessing invalid indices or not iterate enough.


VkImage *imgs = new VkImage[numImgs];
vkr = vt->GetSwapchainImagesKHR(Unwrap(device), Unwrap(swap), &numImgs, imgs);
CHECK_VKR(driver, vkr);

colimg.reserve(numImgs);
colBarrier.reserve(numImgs);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reserve is not the correct call to make here. This isn't immediately broken because it still allocates the memory. The rdcarray functions are named identically to vector - you should call resize.

Vivo X90 devices provide 11 swapchain images. Dynamically
allocate output window arrays to handle this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants