Update min Vulkan version to 1.0.8.0, and fix various bugs
With updating the SDK, the debug layers also showed multiple bugs.
I have fixed those as well in this CL. These include:
1. Incorrectly tracking the allocated descriptor sets from the descriptor pools
2. Using MemoryBarriers inside render passes.
3. Correctly setting the Stencil Image layout anytime we are using a render pass with a stencil attachment
4. Setting the correct aspect mask for Depth/Stencil in a barrier.
TBR=bsalomon@google.com
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1906623002
Review URL: https://codereview.chromium.org/1906623002
diff --git a/tools/vulkan/VulkanTestContext.cpp b/tools/vulkan/VulkanTestContext.cpp
index b940656..03b7407 100644
--- a/tools/vulkan/VulkanTestContext.cpp
+++ b/tools/vulkan/VulkanTestContext.cpp
@@ -240,14 +240,14 @@
nullptr));
}
- GrVkFormatToPixelConfig(swapchainCreateInfo.imageFormat, &fPixelConfig);
-
- this->createBuffers();
+ this->createBuffers(swapchainCreateInfo.imageFormat);
return true;
}
-void VulkanTestContext::createBuffers() {
+void VulkanTestContext::createBuffers(VkFormat format) {
+ GrVkFormatToPixelConfig(format, &fPixelConfig);
+
GR_VK_CALL_ERRCHECK(fBackendContext->fInterface, GetSwapchainImagesKHR(fBackendContext->fDevice,
fSwapchain,
&fImageCount,
@@ -271,6 +271,7 @@
info.fAlloc = nullptr;
info.fImageLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
info.fImageTiling = VK_IMAGE_TILING_OPTIMAL;
+ info.fFormat = format;
desc.fWidth = fWidth;
desc.fHeight = fHeight;
desc.fConfig = fPixelConfig;
@@ -511,13 +512,14 @@
GR_VK_CALL_ERRCHECK(fBackendContext->fInterface,
EndCommandBuffer(backbuffer->fTransitionCmdBuffers[0]));
+ VkPipelineStageFlags waitDstStageFlags = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;
// insert the layout transfer into the queue and wait on the acquire
VkSubmitInfo submitInfo;
memset(&submitInfo, 0, sizeof(VkSubmitInfo));
submitInfo.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO;
submitInfo.waitSemaphoreCount = 1;
submitInfo.pWaitSemaphores = &backbuffer->fAcquireSemaphore;
- submitInfo.pWaitDstStageMask = 0;
+ submitInfo.pWaitDstStageMask = &waitDstStageFlags;
submitInfo.commandBufferCount = 1;
submitInfo.pCommandBuffers = &backbuffer->fTransitionCmdBuffers[0];
submitInfo.signalSemaphoreCount = 0;
diff --git a/tools/vulkan/VulkanTestContext.h b/tools/vulkan/VulkanTestContext.h
index b300a57..66171af 100644
--- a/tools/vulkan/VulkanTestContext.h
+++ b/tools/vulkan/VulkanTestContext.h
@@ -64,7 +64,7 @@
BackbufferInfo* getAvailableBackbuffer();
bool createSwapchain(uint32_t width, uint32_t height);
- void createBuffers();
+ void createBuffers(VkFormat format);
void destroyBuffers();
SkAutoTUnref<const GrVkBackendContext> fBackendContext;