未验证 提交 c25d53c4 编写于 作者: J Jim 提交者: GitHub

Merge pull request #2259 from jpark37/increase-frame-queue

libobs-d3d11: Increase the frame queue capacity
......@@ -380,6 +380,25 @@ try {
return false;
}
static bool increase_maximum_frame_latency(ID3D11Device *device)
{
ComQIPtr<IDXGIDevice1> dxgiDevice(device);
if (!dxgiDevice) {
blog(LOG_DEBUG, "%s: Failed to get IDXGIDevice1", __FUNCTION__);
return false;
}
const HRESULT hr = dxgiDevice->SetMaximumFrameLatency(16);
if (FAILED(hr)) {
blog(LOG_DEBUG, "%s: SetMaximumFrameLatency failed",
__FUNCTION__);
return false;
}
blog(LOG_INFO, "DXGI increase maximum frame latency success");
return true;
}
#if USE_GPU_PRIORITY
static bool set_priority(ID3D11Device *device)
{
......@@ -467,7 +486,12 @@ void gs_device::InitDevice(uint32_t adapterIdx)
blog(LOG_INFO, "D3D11 loaded successfully, feature level used: %x",
(unsigned int)levelUsed);
/* adjust gpu thread priority on non-intel GPUs*/
/* prevent stalls sometimes seen in Present calls */
if (!increase_maximum_frame_latency(device)) {
blog(LOG_INFO, "DXGI increase maximum frame latency failed");
}
/* adjust gpu thread priority on non-intel GPUs */
#if USE_GPU_PRIORITY
if (desc.VendorId != 0x8086 && !set_priority(device)) {
blog(LOG_INFO, "D3D11 GPU priority setup "
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册