Fix for Linux/Vulkan/Editor crash on startup

* Temporary fix for Linux/Vulkan/XCB where the swap chain is not ready to present until the resize is complete
* Fix invalid GUID from LinuxXcbConnectionManager

Signed-off-by: spham-amzn <spham@amazon.com>
monroegm-disable-blank-issue-2
Steve Pham 4 years ago committed by GitHub
parent bb372f05cd
commit b46a80be2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -35,7 +35,7 @@ namespace AzFramework
class LinuxXcbConnectionManager
{
public:
AZ_RTTI(LinuxXcbConnectionManager, "{649951316-3626-4C9D-9DCA-2E7ABF84C0A9}");
AZ_RTTI(LinuxXcbConnectionManager, "{1F756E14-8D74-42FD-843C-4863307710DB}");
virtual ~LinuxXcbConnectionManager() = default;

@ -81,6 +81,15 @@ namespace AZ
AZ_RTTI(SwapChain, "{888B64A5-D956-406F-9C33-CF6A54FC41B0}", Object);
#if defined(PAL_TRAIT_LINUX_WINDOW_MANAGER_XCB)
// On Linux platforms that uses XCB, a resize may occur in the swap chain but the command queue may still
// reference the original surface. This flag is a temporary fix to make sure that all the swap chains
// have finished their resize events before presenting the command queue.
// [GFX TODO][GHI - 2678]
AZStd::atomic_bool m_resized{ false };
#endif // PAL_TRAIT_LINUX_WINDOW_MANAGER_XCB
protected:
SwapChain();

@ -164,6 +164,10 @@ namespace AZ
m_currentImageIndex = 0;
}
#if defined(PAL_TRAIT_LINUX_WINDOW_MANAGER_XCB)
m_resized.store(true);
#endif // PAL_TRAIT_LINUX_WINDOW_MANAGER_XCB
return resultCode;
}

@ -42,6 +42,15 @@ namespace AZ
void CommandQueue::ExecuteWork(const RHI::ExecuteWorkRequest& rhiRequest)
{
#if defined(PAL_TRAIT_LINUX_WINDOW_MANAGER_XCB)
for (RHI::SwapChain* swapChain : rhiRequest.m_swapChainsToPresent)
{
if (!swapChain->m_resized)
{
return;
}
}
#endif // PAL_TRAIT_LINUX_WINDOW_MANAGER_XCB
const ExecuteWorkRequest& request = static_cast<const ExecuteWorkRequest&>(rhiRequest);
QueueCommand([=](void* queue)
{

Loading…
Cancel
Save