Giter VIP home page Giter VIP logo

practicalvulkan's Issues

Exception not handled correctly

I have seen at least at 2 places that the try/catch block are wrong.
In SampleCommon::AcquireImage and SampleCommon::FinishFrame there is something like this.

    vk::Result result = vk::Result::eSuccess;
    try {
      result = GetDevice().acquireNextImageKHR( *current_frame.Swapchain->Handle, 3000000000, *current_frame.FrameResources->ImageAvailableSemaphore, vk::Fence(), &current_frame.SwapchainImageIndex );
    } catch( ... ) {
      if( vk::Result::eErrorOutOfDateKHR == result ) {
        OnWindowSizeChanged();
      } else {
        throw;
      }
    }

The thing is that if acquireNextImageKHR throw and exception result will never be assigned and in the catch the if statement will always be false. There is a similar issue in FinishFrame and maybe more in the code base.

the solution is to have a catch block like this

  catch (const vk::OutOfDateKHRError& /*exception*/)
  {
    recreateSwapchain();
    return;
  }

VK_ERROR_OUT_OF_DATE_KHR issue

Please check this issue which is causing the sample to crash in case of VK_ERROR_OUT_OF_DATE_KHR in AcquireNextImageKHR.

UNASSIGNED-CoreValidation-DrawState-QueueForwardProgress(ERROR / SPEC): msgNum: 0 - Queue 0x3ece98 is waiting on semaphore 0x9 that has no way to be signaled.
    Objects: 1
       [0] 0x9, type: 5, name: (null)
Validation(ERROR): msg_code: 0:  [ UNASSIGNED-CoreValidation-DrawState-QueueForwardProgress ] Object: 0x9 (Type = 5) | Queue 0x3ece98 is waiting on semaphore 0x9 that has no way to be signaled.
UNASSIGNED-CoreValidation-DrawState-SwapchainImageNotAcquired(ERROR / SPEC): msgNum: 0 - vkQueuePresentKHR: Swapchain image index 2 has not been acquired.
    Objects: 1
       [0] 0x7f, type: 1000001000, name: (null)
Validation(ERROR): msg_code: 0:  [ UNASSIGNED-CoreValidation-State-SwapchainImageNotAcquired ] Object: 0x7f (Type = 27) | vkQueuePresentKHR: Swapchain image index 2 has not been acquired.
Could not present swapchain image

I am using latest 2ee3082 commit.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.