When I try to load sponza model, I end up here getting an error:
template<typename IBaseInterface>
HRESULT TDepthStencilViewVariable<IBaseInterface>::SetDepthStencil(ID3D11DepthStencilView *pResource)
{
HRESULT hr = S_OK;
#ifdef _DEBUG
LPCSTR pFuncName = "ID3D11DepthStencilViewVariable::SetDepthStencil";
#endif
// Texture variables don't need to be dirtied.
SAFE_ADDREF(pResource); -> HERE
SAFE_RELEASE(Data.pDepthStencilView->pDepthStencilView);
Data.pDepthStencilView->pDepthStencilView = pResource;
lExit:
return hr;
}
But it doesn't happen with other models? what is going wrong here?