NVIDIA-RTX / NVIDIA-RTX/Streamline
If cameraMotionIncluded is set to false, dangling pointer occurs.
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 1.2k
- Forks
- 159
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Trace viewport.mvec through dlssBeginEvent() and dlssEndEvent() in _dlssEntry.cpp, then inspect Generic::destroyResource() in generic.cpp for the reported resource lifetime. Use the cameraMotionIncluded=false path and the StreamlineSample.cpp DLSS transition as starting points; done means the access violations and dangling-resource behavior are resolved without introducing the reported sample crash.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100