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
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions renderdoc/driver/vulkan/vk_outputwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ VulkanReplay::OutputWindow::OutputWindow()
{
surface = VK_NULL_HANDLE;
swap = VK_NULL_HANDLE;
for(size_t i = 0; i < ARRAY_COUNT(colimg); i++)
for(size_t i = 0; i < colimg.size(); i++)
colimg[i] = VK_NULL_HANDLE;

WINDOW_HANDLE_INIT;
Expand Down Expand Up @@ -75,7 +75,7 @@ VulkanReplay::OutputWindow::OutputWindow()
VK_NULL_HANDLE,
{VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1},
};
for(size_t i = 0; i < ARRAY_COUNT(colBarrier); i++)
for(size_t i = 0; i < colBarrier.size(); i++)
colBarrier[i] = t;

bbBarrier = t;
Expand Down Expand Up @@ -118,7 +118,7 @@ void VulkanReplay::OutputWindow::Destroy(WrappedVulkan *driver, VkDevice device)
}

// not owned - freed with the swapchain
for(size_t i = 0; i < ARRAY_COUNT(colimg); i++)
for(size_t i = 0; i < colimg.size(); i++)
{
if(colimg[i] != VK_NULL_HANDLE)
GetResourceManager()->ReleaseWrappedResource(colimg[i]);
Expand Down Expand Up @@ -404,12 +404,15 @@ void VulkanReplay::OutputWindow::Create(WrappedVulkan *driver, VkDevice device,
vkr = vt->GetSwapchainImagesKHR(Unwrap(device), Unwrap(swap), &numImgs, NULL);
CHECK_VKR(driver, vkr);

RDCASSERT(numImgs <= 8, numImgs);
RDCASSERT(numImgs <= 12, numImgs);

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

colimg.resize(numImgs);
colBarrier.resize(numImgs);

for(size_t i = 0; i < numImgs; i++)
{
colimg[i] = imgs[i];
Expand Down
4 changes: 2 additions & 2 deletions renderdoc/driver/vulkan/vk_replay.h
Original file line number Diff line number Diff line change
Expand Up @@ -550,8 +550,8 @@ class VulkanReplay : public IReplayDriver
VkSurfaceKHR surface;
VkSwapchainKHR swap;
uint32_t numImgs;
VkImage colimg[8];
VkImageMemoryBarrier colBarrier[8];
rdcarray<VkImage> colimg;
rdcarray<VkImageMemoryBarrier> colBarrier;

VkImage bb;
VkImageView bbview;
Expand Down