-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
Update ash & some other deps #118
Conversation
Wait really sorry |
I am sure you may be getting notifications every time I change something here. (Including my mistakes) |
Hello, @maximbaz Because after upgrading ash to v0.38 I don't know whether I made a mistake where I forgot about considering the wlroots while changing the vulkan.rs code or something else occured. |
Hello, I think it should react immediately, but to avoid any potential misconfiguration or setup issues, could you try with the main branch to see if vulkan+wlroots reacts there? |
Hello @maximbaz, I have tried a couple of times, and it shows the same error thrown at me in the main branch wluma. My assumption is that i was running both the wluma (AUR) as well as the cargo run which seems to mess up with wlroots at that moment. |
Sorry to ask but |
Unfortunately I'm in a position where I actually can't test vulkan part as my current hardware does not support vulkan 😭 So I don't know if it actually works. In the interest of getting something merged, I would suggest you continue the PR, especially as you have the ability to run it and verify that it works, and compare with the main branch. I think it's totally worth it to compare your ideas with how they done it in their patch, if nothing else then just in the interest of learning, but especially if you get stuck on something. |
Cargo.toml
Outdated
xdg = "~2.5" | ||
dbus = "~0.9" | ||
anyhow = "1.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's also use ~1.0
as other deps do - by the way, love the idea of trying this crate out 👍
In a separate PR after this is merged, I would totally be open to considering replacing the std::Result
with anyhow::Result
, i.e. that all the functions get changed from Result<T, Box<dyn Error>>
to anyhow's Result<T>
- should make it a lot easier!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still relevant 🙏
src/frame/vulkan.rs
Outdated
enabled_extension_count: instance_extensions.len() as u32, | ||
pp_enabled_extension_names: instance_extensions.as_ptr(), | ||
..Default::default() | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the quick glance, I think I prefer the changes made to this file in #86 (comment) , except I like your solution to the error types, not to introduce a ton of .expect()
calls. Would you like to try to converge your work and the work in #86 (comment) ?
Yeah, Absolutely! 😀 I'm eager to see Wluma work on Hyprland, but more than that, I am happy that I am able to learn rust indirectly from doing it.
Phew! I initially thought You wouldn't like the idea (I assumed that using anyhow could have some other backlash in the Wluma program), so I spent days trying to do it one by one, but, in the end, I gave up and used it anyhow, but I'm glad you liked my idea
I see, so it was intentionally done; I just found it somewhere as a reference to use default (read it in the changelogs as well), so I tried using it, and there were no errors being displayed, and it worked successfully. So I didn't question it. (I even asked ChatGPT for confirmation, but... well it failed.)
Ah! My bad, its not that i forgot about this one but i couldnt find the updated version for KhrExternalMemoryCapabilitiesFn and i think i missinterpretted it and assumed that both are inside vkGetPhysicalDeviceProperties2 🫣.
Yeah, Sure! I will do that in a couple of days. |
Also Just wanted some tip for you @maximbaz , How do you usually find which one is which after the dependency is updated. Since i was trying to update wlroots.rs, it became so messy to the point, i had to restart all over again today, just so i can make sense out of it 😵💫. |
Could you explain a bit what you mean by which is which after the dependency is updated? With an example, perhaps? 🙃 |
Like in wlroots.rs, EventQueue is still EventQueue (Small changes) Stuff like that is where I have to read the entire documentation to see if there is any difference. Takes a lot of time, and even if I read, sometimes I still don't get what I need to do next. |
Ahh I see what you mean now... There is no easy answer, I would start from the changelogs or release notes if they are there, and fall back to normal documentation otherwise. Many dependencies follow semantic versioning scheme, where just by looking at the version change from e.g. |
Ahh, I see; thanks for your explanation. I actually didn't know properly about semantic versioning till now. (Probably because most don't follow it) |
Updated to ash v0.38
Hello @maximbaz, I have re-updated Vulkan.rs code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good overall, some minor findings!
src/frame/vulkan.rs
Outdated
@@ -129,7 +136,7 @@ impl Vulkan { | |||
&device_memory_properties, | |||
vk::MemoryPropertyFlags::HOST_VISIBLE | vk::MemoryPropertyFlags::HOST_COHERENT, | |||
) | |||
.ok_or("Unable to find suitable memory type for the buffer")?; | |||
.expect("Unable to find suitable memory type for the buffer"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's revert to ok_or
, potentially map_err
oring it if needed.
src/frame/vulkan.rs
Outdated
@@ -220,7 +230,7 @@ impl Vulkan { | |||
self.device.unmap_memory(self.buffer_memory); | |||
self.device | |||
.reset_fences(&[self.fence]) | |||
.map_err(|e| Box::new(e) as Box<dyn Error>)?; | |||
.expect("Failed to reset fences"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here to revert to map_err
src/frame/vulkan.rs
Outdated
let image_memory = unsafe { | ||
self.device | ||
.allocate_memory(&image_allocate_info, None) | ||
.expect("Failed to allocate memory") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
map_err
🙏
src/frame/vulkan.rs
Outdated
} | ||
self.device | ||
.bind_image_memory(image, image_memory, 0) | ||
.expect("Failed to bind image memory"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
map_err
🙏
src/frame/vulkan.rs
Outdated
let frame_image = unsafe { | ||
self.device | ||
.create_image(&frame_image_create_info, None) | ||
.expect("Failed to create image") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
map_err
🙏
src/frame/vulkan.rs
Outdated
.queue_submit(self.queue, &[submit_info.build()], self.fence) | ||
.map_err(|e| Box::new(e) as Box<dyn Error>)?; | ||
.queue_submit(self.queue, &[submit_info], self.fence) | ||
.expect("Failed to submit queue"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
map_err
🙏
src/frame/vulkan.rs
Outdated
self.device | ||
.wait_for_fences(&[self.fence], true, FENCES_TIMEOUT_NS) | ||
.map_err(|e| Box::new(e) as Box<dyn Error>)?; | ||
.expect("Failed to wait for fences"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
map_err
🙏
Cargo.toml
Outdated
xdg = "~2.5" | ||
dbus = "~0.9" | ||
anyhow = "1.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still relevant 🙏
config.toml
Outdated
name = "keyboard-dell" | ||
path = "/sys/bus/platform/devices/dell-laptop/leds/dell::kbd_backlight" | ||
name = "keyboard-MSI" | ||
path = "/sys/class/net/enp4s0/enp4s0-2::lan" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's okay to keep it for now, but I suppose you want to undo this before final merge 😉
src/frame/vulkan.rs
Outdated
.queue_family_index(queue_family_index) | ||
.queue_priorities(&[1.0]) | ||
.build()]; | ||
//p_queue_priorities: [1.0f32].as_ptr(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you want to remove these commented parts, here and in a couple of other places, or you are experimenting with them?
Thank you for pointing out everything in detail. I will do just that now! 🔥
Oh sorry!😅 Will change it back!
Yeah will do. 😀 |
Ah! Sorry, I forgot about that, |
Hey @maximbaz , I have successfully made all the changes you asked to revert back. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my perspective this looks like a very clean PR now, I have just a couple minor suggestions, other than that I'm good to merge. Thanks! 🙏
I don't see why it wouldn't work, but just to be super explicit I will repeat that I personally don't have a hardware to validate this, so I trust your test results, and then the users who would run the code from main
branch.
Co-authored-by: Maxim Baz <[email protected]>
Co-authored-by: Maxim Baz <[email protected]>
Okay I am back to Doubting myself, |
Run it with wlroots. Look for this log lines: wluma/src/predictor/controller.rs Line 198 in 7184d0a
|
Unfortunately, My wlroots still doesn't work 🥲. I Here is the screen recording i took to send. 2024-09-18.01-07-26.mp42024-09-18.01-19-50.mp4I used my study lamp to light up in front of my camera. What do you think? |
At the same time I think the code change in this PR is very reasonable and I want to merge your very good progress, so that you can proceed with your awesome work from a fresh PR. Your contributions are very appreciated! I'll ask a friend to test this in the coming days, plus I'm sure some people are running the latest code from |
omg, I totally went after a different thing till now; well, all in all, at least I learnt something. PS: Just realised I can at least moving forward eliminate vulkan.rs for not being the culprit on not working on my Hyprland |
Ohh, if you asked this before and I mislead you into thinking that vulkan might be a culprit, I am sorry! (and still grateful for your PR 😁 ) |
I still believe this comment #111 (comment) to be true, hyprland has the "stable" version of that protocol and we still use the "unstable" one because of the old wayland-client dependency. As soon as we update wayland-client, the current code like |
I updated the ash and other dependencies to the latest version (Except Wayland-client and Wayland-protocol).
Added anyhow (version = "1.0") to fix some of the issues which normally would require writing a new code.
I just tried my best not to let any errors occur, but that doesn't mean the code is functioning properly.
As far as I tried, I don't seem to have faced an issue, but Please rewrite the code however you fit @maximbaz
Again Thanks for your help