<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Can not detect VK_ERROR_OUT_OF_DATE_KHR or VK_SUBOPTIMAL_KHR when window resizing"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=111097">111097</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Can not detect VK_ERROR_OUT_OF_DATE_KHR or VK_SUBOPTIMAL_KHR when window resizing
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>Mesa
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>19.1
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>x86-64 (AMD64)
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux (All)
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Drivers/Vulkan/intel
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>intel-3d-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>xing.xu@intel.com
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>intel-3d-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>jason@jlekstrand.net
          </td>
        </tr></table>
      <p>
        <div>
        <pre>When window is resized, vkQueuePresentKHR should return
VK_ERROR_OUT_OF_DATE_KHR.
vkAcquireNextImageKHR should return VK_ERROR_OUT_OF_DATE_KHR ||
VK_SUBOPTIMAL_KHR. 
So that application got a chance to recreate the swap-chain. But on several
Linux HD graphics, it always return VK_SUCESS.

These are detailed in the vulkan
spec(<a href="https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/VkResult.html">https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/VkResult.html</a>):
“VK_ERROR_OUT_OF_DATE_KHR A surface has changed in such a way that it is no
longer compatible with the swapchain, and further presentation requests using
the swapchain will fail. Applications must query the new surface properties and
recreate their swapchain if they wish to continue presenting to the surface.
VK_SUBOPTIMAL_KHR A swapchain no longer matches the surface properties exactly,
but can still be used to present to the surface successfully."

Reproduce steps:
1. Download angle source and install deps:
git clone <a href="https://chromium.googlesource.com/angle/angle">https://chromium.googlesource.com/angle/angle</a>
cd angle
python scripts/bootstrap.py
gclient sync
git checkout master
./build/install-build-deps.sh
gn gen out/Release

2.  disable feature 'perFrameWindowSizeQuery' in RendererVk.cpp
+++ b/src/libANGLE/renderer/vulkan/RendererVk.cpp
@@ -1242,7 +1242,7 @@ void RendererVk::initFeatures(const ExtensionNameList
&deviceExtensionNames)
     if (IsIntel(mPhysicalDeviceProperties.vendorID) ||
         (IsWindows() && IsAMD(mPhysicalDeviceProperties.vendorID)))
     {
-        mFeatures.perFrameWindowSizeQuery.enabled = true;
+        mFeatures.perFrameWindowSizeQuery.enabled = false;


If you meet fenceInfo unused error, try patch as below:
--- a/src/libANGLE/renderer/vulkan/ContextVk.cpp
+++ b/src/libANGLE/renderer/vulkan/ContextVk.cpp
@@ -683,9 +683,9 @@ angle::Result ContextVk::submitFrame(const VkSubmitInfo
&submitInfo,
                                        vk::PrimaryCommandBuffer
&&commandBuffer)
 {
        ANGLE_TRACE_EVENT0("gpu.angle", "RendererVk::submitFrame");
-       VkFenceCreateInfo fenceInfo = {};
-       fenceInfo.sType                 = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO;
-       fenceInfo.flags                 = 0;
+       //VkFenceCreateInfo fenceInfo = {};
+       //fenceInfo.sType               = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO;
+       //fenceInfo.flags               = 0;

3.  Build
ninja -C out/Release

4.  Run test case
./out/Release/angle_end2end_tests
--gtest_filter=EGLSurfaceTest.ResizeWindow/ES2_Vulkan_NoFixture

I have reproduced this issue on below platforms:
Mesa 18.0.5/Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor Integrated
Graphics Controller (rev 06)/Ubuntu 18.04
Mesa 19.1.1/Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor Integrated
Graphics Controller (rev 06)/Ubuntu 18.04
Mesa 19.1.1/Intel I7 7700K/Intel HD Graphics 630 (Kaby Lake GT2)/Ubuntu 19.04

I can not reproduce this on:
OpenGL version string: 4.6.0 NVIDIA 430.26/GeForce GTX 1060/Ubuntu 18.04.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the QA Contact for the bug.</li>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>