Skip to content

Initial DLSS implementation #19864

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

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open

Initial DLSS implementation #19864

wants to merge 27 commits into from

Conversation

JMS55
Copy link
Contributor

@JMS55 JMS55 commented Jun 29, 2025

Objective

Solution

  • Initial implementation of DLSS upscaling, via https://github.com/bevyengine/dlss_wgpu.
  • Future PRs will work more on transparency, exposure, working with custom viewports, fixing inevitable resolution override bugs, etc.
  • DLSS framegen is not planned, but ray-reconstruction is for solari.
  • FSR3/4, XeSS2, and MetalFX temporal upscaling should be easy to add now if a future contributor wants to. In the future we could have an auto-temporal AA component that handles DLSS/FSR/XeSS/MetalFX/TAA fallbacks automatically.

Testing

  • Did you test these changes? If so, how?
    • Run the anti_aliasing example
  • Are there any parts that need more testing?
    • Different types of scene content and rendering effects to make sure they work with DLSS/upscaling
    • Reviewing dlss_wgpu code

Showcase

bafkreib4u2hc7kgru7n6ujh6tjq5aydfcz7m7lfleexvfa6fdixegveaee

@JMS55 JMS55 added the A-Rendering Drawing game state to the screen label Jun 29, 2025
@JMS55 JMS55 added C-Feature A new feature, making something new possible M-Needs-Release-Note Work that should be called out in the blog due to impact M-Deliberate-Rendering-Change An intentional change to how tests and examples are rendered labels Jun 29, 2025
@JMS55 JMS55 added this to the 0.17 milestone Jun 29, 2025
Copy link
Contributor

It looks like your PR has been selected for a highlight in the next release blog post, but you didn't provide a release note.

Please review the instructions for writing release notes, then expand or revise the content in the release notes directory to showcase your changes.

@JMS55
Copy link
Contributor Author

JMS55 commented Jun 29, 2025

@cart not sure what licensing concerns there are with this. See the license notes in https://github.com/JMS55/dlss_wgpu/blob/main/README.md.

Copy link
Contributor

You added a new example but didn't add metadata for it. Please update the root Cargo.toml file.

@JMS55
Copy link
Contributor Author

JMS55 commented Jun 29, 2025

You added a new example but didn't add metadata for it. Please update the root Cargo.toml file.

Lies D:

Copy link
Contributor

You added a new example but didn't add metadata for it. Please update the root Cargo.toml file.

@alice-i-cecile alice-i-cecile added S-Needs-Review Needs reviewer attention (from anyone!) to move forward X-Contentious There are nontrivial implications that should be thought through labels Jun 30, 2025
@cart
Copy link
Member

cart commented Jul 1, 2025

Rad! My only concern here is that we're taking a dependency on an external crate that depends on a specific version of wgpu. This will make upstream bevy wgpu updates harder, as it will require collaboration with owner of the crate (in this case, you, which is much better than a stranger, but still a risk).

@cart not sure what licensing concerns there are with this. See the license notes in https://github.com/JMS55/dlss_wgpu/blob/main/README.md.

I think this is ok, given that the onus is on developers to wire up the SDK themselves.

@JMS55
Copy link
Contributor Author

JMS55 commented Jul 1, 2025

Theoretically it's an optional feature, so it shouldn't block wgpu upgrades. Of course I'm happy to update it asap.

I'm also happy to put it in the bevy repo, up to maintainers. I don't have a preference either way.

Copy link
Contributor

github-actions bot commented Jul 6, 2025

You added a new example but didn't add metadata for it. Please update the root Cargo.toml file.

//! NVIDIA Deep Learning Super Sampling.
//!
//! See https://github.com/bevyengine/dlss_wgpu for licensing requirements and setup instructions.
//!
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like information on "what happens if your user doesn't have a compatible graphics card here-ish.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uhh probably an error. Don't insert the component if you haven't checked DlssSupported :P

JMS55 and others added 3 commits July 9, 2025 11:42

#[cfg(feature = "dlss")]
#[derive(Resource)]
pub struct DlssProjectId(pub bevy_asset::uuid::Uuid);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be unique for each application instance? Stable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unique per app. The DLSS programming guide provides more details

return;
}

let dlss_project_id = app.world().resource::<DlssProjectId>().0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be nice to have a better error message here if the user forgets to add this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There already is, it's in bevy render :)

render_device: Res<RenderDevice>,
render_queue: Res<RenderQueue>,
frame_count: Res<FrameCount>,
mut commands: Commands,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: commands first

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have an obvious suggestion for another solution but I really don't like polluting this file with a bunch of dlss feature flags and specific code. It feels like we need a more generalized pattern for modifying the render initialization.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DLSS is special because we need native extensions that you can't enable via wgpu features. This won't be a problem for anything else.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, it's been a problem on some of my own projects, and while that's not going to be upstreamed, I still think having more robust pattern here would be beneficial as the DLSS feature spam adds a lot of noise for a specific rendering feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Feature A new feature, making something new possible M-Deliberate-Rendering-Change An intentional change to how tests and examples are rendered M-Needs-Release-Note Work that should be called out in the blog due to impact S-Needs-Review Needs reviewer attention (from anyone!) to move forward X-Contentious There are nontrivial implications that should be thought through
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

NVIDIA DLSS (Deep Learning Super Sampling)
4 participants