When profiling enabled, D3D11 RS crashed in TransferOwnership() in some of our clients, because when QueryInterface(ID3DUserDefinedAnnotation) failed, the current code did not check hr, dereferencing null. Here is a quick fix:
Code: Select all
hr = mImmediateContext->QueryInterface(__uuidof(ID3DUserDefinedAnnotation), (LPVOID*)&mPerf);
if (!SUCCEEDED(hr) || !mPerf->GetStatus()) {
SAFE_RELEASE(mPerf);
}