Skip to content

Commit

Permalink
nui: disable keyed mutexes pending daktronics/cef-mixer#8
Browse files Browse the repository at this point in the history
  • Loading branch information
copernicium committed Apr 14, 2018
1 parent 55eccf1 commit b49b9ff
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
2 changes: 0 additions & 2 deletions code/components/nui-core/src/NUIInitialize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,6 @@ void FinalizeInitNUI()
cSettings.pack_loading_disabled = false; // true;
cSettings.windowless_rendering_enabled = false; // true;
cSettings.log_severity = LOGSEVERITY_DISABLE;
cSettings.shared_texture_enabled = true;
cSettings.external_begin_frame_enabled = true;

CefString(&cSettings.browser_subprocess_path).FromWString(MakeCfxSubProcess(L"ChromeBrowser"));

Expand Down
15 changes: 2 additions & 13 deletions code/components/nui-core/src/NUIWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ void NUIWindow::Initialize(CefString url)
info.SetAsWindowless(FindWindow(L"grcWindow", nullptr));
info.shared_texture_enabled = true;
info.external_begin_frame_enabled = true;
info.shared_texture_sync_key = uint64_t(-1);

CefBrowserSettings settings;
settings.javascript_close_windows = STATE_DISABLED;
Expand Down Expand Up @@ -253,14 +254,6 @@ void NUIWindow::UpdateFrame()

if (texture)
{
IDXGIKeyedMutex* keyedMutex = nullptr;
texture->QueryInterface(__uuidof(IDXGIKeyedMutex), (void**)&keyedMutex);

if (!keyedMutex)
{
FatalError(__FUNCTION__ ": ID3D11Texture2D::QueryInterface(IDXGIKeyedMutex) failed - your GPU driver likely does not support Direct3D shared resources correctly. Please update to the latest version of Windows and your GPU driver to resolve this problem.");
}

//
// dirty flag checking and CopySubresourceRegion are disabled here due to some issue
// with scheduling frame copies from the OnAcceleratedPaint handler.
Expand All @@ -270,7 +263,7 @@ void NUIWindow::UpdateFrame()
//
if (InterlockedExchange(&m_dirtyFlag, 0) > 0)
{
HRESULT hr = keyedMutex->AcquireSync(m_syncKey, 0);
HRESULT hr = S_OK;

if (hr == S_OK)
{
Expand All @@ -295,16 +288,12 @@ void NUIWindow::UpdateFrame()
}

SetEvent(g_resetEvent);

keyedMutex->ReleaseSync(m_syncKey);
}
else
{
MarkRenderBufferDirty();
}
}

keyedMutex->Release();
}
}

Expand Down

0 comments on commit b49b9ff

Please sign in to comment.