Showing with 26 additions and 21 deletions.
  1. +1 −1 code/components/nui-core/src/NUIApp.cpp
  2. +0 −1 code/components/nui-core/src/NUIInitialize.cpp
  3. +23 −17 code/components/nui-core/src/NUIWindow.cpp
  4. +1 −1 code/tools/ci/build.ps1
  5. +1 −1 docs/building.md
2 changes: 1 addition & 1 deletion code/components/nui-core/src/NUIApp.cpp
Expand Up @@ -57,7 +57,7 @@ void NUIApp::OnBeforeCommandLineProcessing(const CefString& process_type, CefRef
command_line->AppendSwitch("enable-usermedia-screen-capture");
command_line->AppendSwitch("disable-direct-composition");
command_line->AppendSwitchWithValue("default-encoding", "utf-8");
command_line->AppendSwitch("disable-gpu-vsync");
//command_line->AppendSwitch("disable-gpu-vsync");
command_line->AppendSwitchWithValue("autoplay-policy", "no-user-gesture-required");
command_line->AppendSwitch("force-gpu-rasterization");

Expand Down
1 change: 0 additions & 1 deletion code/components/nui-core/src/NUIInitialize.cpp
Expand Up @@ -112,7 +112,6 @@ void FinalizeInitNUI()
cSettings.pack_loading_disabled = false; // true;
cSettings.windowless_rendering_enabled = false; // true;
cSettings.log_severity = LOGSEVERITY_DISABLE;
cSettings.shared_textures_enabled = true;

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

Expand Down
40 changes: 23 additions & 17 deletions code/components/nui-core/src/NUIWindow.cpp
Expand Up @@ -79,14 +79,15 @@ void NUIWindow::Initialize(CefString url)
m_client = new NUIClient(this);

CefWindowInfo info;
//info.SetAsWindowless(FindWindow(L"grcWindow", nullptr));
info.shared_textures_enabled = true;
info.SetAsWindowless(nullptr);
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;
settings.web_security = STATE_DISABLED;
settings.windowless_frame_rate = 60;
settings.windowless_frame_rate = 240;
CefString(&settings.default_encoding).FromString("utf-8");

CefRefPtr<CefRequestContext> rc = CefRequestContext::GetGlobalContext();
Expand Down Expand Up @@ -179,6 +180,23 @@ void NUIWindow::UpdateSharedResource(void* sharedHandle, uint64_t syncKey, const

void NUIWindow::UpdateFrame()
{
if (m_client)
{
auto client = ((NUIClient*)m_client.get());

auto browser = client->GetBrowser();

if (browser)
{
auto host = browser->GetHost();

if (host)
{
host->SendExternalBeginFrame(0, 0, 0);
}
}
}

if (!m_nuiTexture)
{
return;
Expand Down Expand Up @@ -236,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 @@ -253,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 @@ -278,16 +288,12 @@ void NUIWindow::UpdateFrame()
}

SetEvent(g_resetEvent);

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

keyedMutex->Release();
}
}

Expand Down
2 changes: 1 addition & 1 deletion code/tools/ci/build.ps1
Expand Up @@ -23,7 +23,7 @@ param (
$Identity = "C:\guava_deploy.ppk"
)

$CefName = "cef_binary_3.3325.1750.g45dd47e_windows64_minimal"
$CefName = "cef_binary_3.3359.1759.g5f8ab1c_windows64_minimal"

# from http://stackoverflow.com/questions/2124753/how-i-can-use-powershell-with-the-visual-studio-command-prompt
function Invoke-BatchFile
Expand Down
2 changes: 1 addition & 1 deletion docs/building.md
Expand Up @@ -2,7 +2,7 @@
To build FiveM's client components, you need the following dependencies:
* A Windows machine with Visual Studio 2017 (Build Tools/Community is fine) installed.
* [Boost 1.63.0](https://sourceforge.net/projects/boost/files/boost/1.63.0/boost_1_63_0.7z/download), extracted to a path defined by the environment variable `BOOST_ROOT`.
* [Modified CEF](https://runtime.fivem.net/build/cef/cef_binary_3.3325.1750.g45dd47e_windows64_minimal.zip), extracted to `vendor/cef` in the build tree.
* [Modified CEF](https://runtime.fivem.net/build/cef/cef_binary_3.3359.1759.g5f8ab1c_windows64_minimal.zip), extracted to `vendor/cef` in the build tree.
* [Python 2.7](https://python.org/) in your PATH as `python`.
* [Premake 5.0](https://premake.github.io/download.html) somewhere it can be found.

Expand Down