• Advertisement
Sign in to follow this  

Sponza rendering issue

This topic is 1356 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Edited by newtechnology

Share this post


Link to post
Share on other sites
Advertisement

What error?

it just takes me there.

 

EDIT: If I do this while loading mesh (i.e subtract 15)

for (UINT i = 0; i < pScene->mNumMeshes - 15; ++i)
{//..........................

then it works.

Edited by newtechnology

Share this post


Link to post
Share on other sites
What does that mean? Is it a compile error? A runtime error? What information is given?

Share this post


Link to post
Share on other sites

You have given us little information to go on. Debugging is a bit like police work: you need to get a lot of clues and from that distill what happened.

 

As far as I see the runtime error occurs in the DX11 Effects-framework. Since you say 'it just goes there', I'm suspecting your debugger stopped execution there because of a crash, or an exception. Could it be pResource is just NULL? You can check in the debugger (or by checking in the code).

 

You already deduced that the error only occurs in the last 15 meshes. How many meshes are there (i.e. is at least one mesh actually succesfully loaded?). Can you pinpoint which exact meshes fail to load? Oh also, there's lots of versions of the Sponza model. It may help to know which one you're using.

 

Please try to dig a little deeper. That way, either you figure it out yourself, or are able to provide us with some information to help you better.

Good luck.

Share this post


Link to post
Share on other sites

I fixed it by passing null SRV in my std::vector and then checking if the SRV was not null in the vector then only render.

1904141_881040891922266_6097043545267747

Edited by newtechnology

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement