-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
One time lag spike #42
Comments
Interesting, I don't think I've seen that before. Do you have a repro you'd be willing to share? |
@vdwtanner This might be a driver issue. I'm using a 3090. If you replace the static unsigned all_render_count = 0;
static unsigned actual_11on12_render_count = 0;
struct RaiiTimer
{
std::chrono::steady_clock::time_point start;
RaiiTimer()
: start(std::chrono::high_resolution_clock::now())
{
}
~RaiiTimer()
{
auto stop = std::chrono::high_resolution_clock::now();
auto duration = std::chrono::duration_cast<std::chrono::microseconds>(stop - start).count();
std::stringstream oss;
oss << "11on12 microseconds: " << duration << " all renders: " << all_render_count << " actual 11on12 work: " << actual_11on12_render_count << std::endl;
OutputDebugStringA(oss.str().c_str());
if (duration > 70'000)
auto break_point = 0;
}
};
void D3D1211on12::RenderUI()
{
auto timer = RaiiTimer{};
D2D1_SIZE_F rtSize = m_d2dRenderTargets[m_frameIndex]->GetSize();
D2D1_RECT_F textRect = D2D1::RectF(0, 0, rtSize.width, rtSize.height);
static const WCHAR text[] = L"11On12";
// Acquire our wrapped render target resource for the current back buffer.
m_d3d11On12Device->AcquireWrappedResources(m_wrappedBackBuffers[m_frameIndex].GetAddressOf(), 1);
m_d2dDeviceContext->SetTarget(m_d2dRenderTargets[m_frameIndex].Get());
m_d2dDeviceContext->BeginDraw();
m_d2dDeviceContext->SetTransform(D2D1::Matrix3x2F::Identity());
if (all_render_count++ % 2 == 0)
{
actual_11on12_render_count += 1;
m_d2dDeviceContext->DrawText(
text,
_countof(text) - 1,
m_textFormat.Get(),
&textRect,
m_textBrush.Get()
);
}
ThrowIfFailed(m_d2dDeviceContext->EndDraw());
m_d3d11On12Device->ReleaseWrappedResources(m_wrappedBackBuffers[m_frameIndex].GetAddressOf(), 1);
m_d3d11DeviceContext->Flush();
}
This isn't noticeable if it is for your 16 present. But it becomes noticeable if it is for your 160th present. Its easy enough to work around now that I understand it. |
I just double checked that this also happens on a release build
|
Hi @tom-huntington, |
@vdwtanner Desktop. From memory I only noticed this after I upgraded to a 3090. So probably a driver issue? |
Sure sounds like it. I'll try it again on a different machine tomorrow. Was your other card also from nvidia? Wonder if it's a general issue or more specific to the 3090 |
@vdwtanner yes 1060 |
I'm using
D3D11on12
for interop with direct2d.There is a one time 120 millisecond render where as the render work usually takes 1.5 milliseconds.
If the render work load is smaller it takes longer to happen. Seems something akin to when std::vector has to resize.
Do you know about this? Can you give any guidance?
The text was updated successfully, but these errors were encountered: