Skip to content

Expose device_information#143

Merged
kvark merged 5 commits into
kvark:mainfrom
zed-industries:debug
Jul 23, 2024
Merged

Expose device_information#143
kvark merged 5 commits into
kvark:mainfrom
zed-industries:debug

Conversation

@ConradIrwin

Copy link
Copy Markdown
Contributor

We'd like to be able to tell users not to use a software renderer, and to provide more information in the case of failures.

Fixes: #142

I have not yet implemented this on metal, but can do so if this approach seems sound to you.

We'd like to be able to tell users not to use a software renderer,
and to provide more information in the case of failures.

Fixes: kvark#142

@kvark kvark left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Generally speaking, exposing some information about the device is good and helpful.

However, I would very much like to squeeze this information to a form that is useful, as opposed to blindly exposing everything that Vulkan gives us. For example, Vulkan drivers aren't even in agreement about what is considered an integrated GPU and what not. This line is being blurred, and it's not really actionable by the user anyway.

What the user does need to know is if the adapter is emulated in software. That is definitely a strong distinction, where the line isn't blurred. So, we would ideally expose something like this:

struct DeviceInformation {
  name: String,
  is_software_emulated: bool,
}

@ConradIrwin

Copy link
Copy Markdown
Contributor Author

@kvark 👍 can make that change.

I had a few people on the linux channel suggest it would be useful to return the driver info too to help people debug what's happening. Is that information obtainable a different way, or should I keep returning that?

@ConradIrwin

Copy link
Copy Markdown
Contributor Author

@kvark updated to just return a bool. Kept all three strings, but can simplify if you'd prefer

@kvark kvark left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Sorry, one last thing

Comment thread blade-graphics/src/metal/mod.rs Outdated
}

pub fn device_information(&self) -> &crate::DeviceInformation {
todo!();

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Can we return a default implementation instead? Crashing isn't fun for this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done!

@ConradIrwin

Copy link
Copy Markdown
Contributor Author

@kvark I'm keen to ship a new build to zed preview on Wednesday. I can pull this in, but is #144 something you feel comfortable with too?

@kvark kvark merged commit 7e497c5 into kvark:main Jul 23, 2024
@kvark

kvark commented Jul 23, 2024

Copy link
Copy Markdown
Owner

@ConradIrwin I don't want to merge #144 until we confirm that it helps people.

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.

Allow querying the name and driver info of the chosen adapter

2 participants