Skip to content
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

If cameraMotionIncluded is set to false, dangling pointer occurs. #44

Open
BobAndBooBoo opened this issue Sep 13, 2024 · 0 comments
Open
Labels
ack Acknowledged. We may or may not do something, but won’t commit either way.

Comments

@BobAndBooBoo
Copy link

Version and Platform:

  • streamline v2.4.10
  • GPU: RTX4070Ti Super
  • Driver: 560.94

In order to run DLSS on a custom engine, I set cameraMotionIncluded to false and tried to calculate camera motion inside dlssEntry.cpp, but it didn’t work.
It seems dangling pointer occurs because viewport.mvec is not nullptr in dlssBeginEvent() in dlssEntry.cpp.

if (viewport.handle)
{
    SL_LOG_INFO("Detected resize, recreating DLSSContext feature");
    // Errors logged by sl.common
    ctx.ngxContext->releaseFeature(viewport.handle, "sl.dlss");
    viewport.handle = {};
    ctx.compute->destroyResource(viewport.mvec);   <------ viewport.mvec IS NOT nullptr
}

When dlssEndEvent() is executed in this state, an access violation occurs in the following part:

if (ctx.viewport->mvec)
{
    chi::ResourceDescription desc;
    ctx.compute->getResourceDescription(ctx.viewport->mvec, desc);   <--- ACCESS VIOLATION HERE
    if (desc.width != renderWidth || desc.height != renderHeight)
    {
        ctx.compute->destroyResource(ctx.viewport->mvec);
        ctx.viewport->mvec = nullptr;
    }
}

Also, in generic.cpp, in the Generic::destroyResource() function, it seems that nullptr is not assigned after delete resource, which could lead to dangling.

I tried setting cameraMotionIncluded to false to see if it could be reproduced in the StreamlineSample, but when changing AntiAliasingMode from NONE to DLSS, it crashed in StreamlineSample.cpp at GetDevice()->executeCommandList(m_CommandList);, so I was unable to cause dangling pointer.

@jake-nv jake-nv added the ack Acknowledged. We may or may not do something, but won’t commit either way. label Sep 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ack Acknowledged. We may or may not do something, but won’t commit either way.
Projects
None yet
Development

No branches or pull requests

2 participants