Skip to content

Adds ray tracing enablement to ContextDesc.#296

Open
nathansizemore wants to merge 2 commits intokvark:mainfrom
nathansizemore:nvidia-bug
Open

Adds ray tracing enablement to ContextDesc.#296
nathansizemore wants to merge 2 commits intokvark:mainfrom
nathansizemore:nvidia-bug

Conversation

@nathansizemore
Copy link

@nathansizemore nathansizemore commented Feb 5, 2026

Switched ContextDesc to manual Default so ray_tracing defaults to true (preserves previous behavior).

Fixes #295

@kvark
Copy link
Owner

kvark commented Feb 18, 2026

Thank you for the PR!
I believe the right approach here would be to add this flag to ContextDesc (right after presentation). This would be the best way to communicate to Blade that no ray tracing init is needed.
Even better would be to understand what's wrong with this platform. Are we doing anything illegal? The original bug report says that Vulkan validation was enabled, yet there were no errors. If it's a driver/HW issue, we could also just detect it in the init and work around. But that requires understanding the scope of the bug.

@nathansizemore
Copy link
Author

...If it's a driver/HW issue, we could also just detect it in the init and work around. But that requires understanding the scope of the bug.

For sure down to debug further bc I am a small sample size and this may only effect a small number of others, but not being much of a graphics guy - I'm at the end of my knowledge bank on what else to check. Vulkan validation is basically my upper bound on debugging GPU stuffs.

If you have any ideas on how I can further the understanding, down to put the time in to test.

@nathansizemore nathansizemore changed the title Adds disable ray tracing env var toggle. Adds ray tracing enablement to ContextDesc. Feb 18, 2026
@nathansizemore
Copy link
Author

I believe the right approach here would be to add this flag to ContextDesc (right after presentation). This would be the best way to communicate to Blade that no ray tracing init is needed.

Updated

Copy link
Owner

@kvark kvark left a comment

Choose a reason for hiding this comment

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

In addition, we need to update Metal and GL backends.
In Metal, fail if the backend doesn't support RT but it was requested.
In GL, always fail if the RT was requested.

fn default() -> Self {
Self {
presentation: false,
ray_tracing: true,
Copy link
Owner

Choose a reason for hiding this comment

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

No need for a custom default, let's keep auto-deriving as false.
I know this will be breaking those who rely on ray tracing available by default. But it makes sense, and we aren't talking about a lot of users.

let context = Arc::new(unsafe { gpu::Context::init(gpu::ContextDesc::default()).unwrap() });
let context = Arc::new(unsafe {
gpu::Context::init(gpu::ContextDesc {
ray_tracing: true,
Copy link
Owner

Choose a reason for hiding this comment

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

this example probably doesn't need ray tracing

let context = unsafe { gpu::Context::init(gpu::ContextDesc::default()).unwrap() };
let context = unsafe {
gpu::Context::init(gpu::ContextDesc {
ray_tracing: true,
Copy link
Owner

Choose a reason for hiding this comment

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

this doesn't need it either

let context = unsafe {
gpu::Context::init(gpu::ContextDesc {
presentation: true,
ray_tracing: true,
Copy link
Owner

Choose a reason for hiding this comment

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

and this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crash in Zed: NVIDIA GeForce RTX 4070 Laptop GPU (driver 590.48.01)

2 participants