Hi all,
I am working on D3D + XAML application for Winodws 8.1 and I am trying to get an all clear on the WACK test. Everything goes fine but one test "Direct3D Feature Test". The error message is: "One or more applications
in the package did not call Trim() on their DXGI Devices while being suspended."
I believe I am calling the Trim method properly. I was following a sample application code. This sample application is available with the name "DirectX 3D shooting game sample" in the "Windows 8.1 app samples" available on MSDN.
Below is a little code snippet.
void App::OnLaunched(LaunchActivatedEventArgs^ args)
{
Suspending += ref new SuspendingEventHandler(this, &App::OnSuspending);
Resuming += ref new EventHandler<Object^>(this, &App::OnResuming);
.....
}
void App::OnSuspending(Object^ sender, SuspendingEventArgs^ args)
{
SuspendingDeferral^ deferral = args->SuspendingOperation->GetDeferral();
create_task([this, deferral]()
{
m_deviceResources->Trim();
deferral->Complete();
});
}
//And inside the DeviceResources implementation
void DX::DeviceResources::Trim()
{
ComPtr<IDXGIDevice3> dxgiDevice;
DX::ThrowIfFailed(m_d3dDevice.As(&dxgiDevice));
dxgiDevice->Trim();
}
//declaration of m_d3dDevice
Microsoft::WRL::ComPtr<ID3D11Device2> m_d3dDevice;
Can someone please guide to what I might be missing? Perhaps, some additional suspend event handler registration or a different implementation/way of calling Trim() ?