Skip to content
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

No Text #16

Closed
C0D3-M4513R opened this issue Jul 9, 2021 · 15 comments
Closed

No Text #16

C0D3-M4513R opened this issue Jul 9, 2021 · 15 comments

Comments

@C0D3-M4513R
Copy link
Contributor

I am using the example basic_app.
I had to modify some imports, the version, and fix #15 , but with that in place, Basalt runs.
It compiles, and starts up correctly.

However, it does not display Text.
I am currently on Win 10.

@AustinJ235
Copy link
Owner

Merged #15

@C0D3-M4513R
Copy link
Contributor Author

C0D3-M4513R commented Jul 10, 2021

This is not solved with #15. This is a separate issue. This is ongoing, after #15 was implemented.

@AustinJ235 AustinJ235 reopened this Jul 10, 2021
@AustinJ235
Copy link
Owner

Whoops... What is your gpu by chance? Also try adding this to the Options builder, interface_limit_draw(false)

@C0D3-M4513R
Copy link
Contributor Author

GPU is Nvidia 2060Super. Detailed info here: l3lackShark/gosumemory#71 (comment)

@AustinJ235
Copy link
Owner

Instead of enabling all supported features by default, Basalt will now only enable features it requires, with additional features now configurable through options. Vulkano recently switched the examples away from this behavior due to users having issues. I believe this may be the culprit since you did find that not all features were actually supported on your device. At least not at the same time anyways.

If you want to give the latest master a go, I think I may have fixed this in 49157c9

@C0D3-M4513R
Copy link
Contributor Author

C0D3-M4513R commented Jul 12, 2021

I just checked that commit, and still no text.
image
I use this code, I use for testing right now: /examples/src/bin/basic_app.rs

@AustinJ235
Copy link
Owner

There is a few guess as to what could be going on. I have created a branch with extra debug messages and some options disabled/enabled. See https://github.com/AustinJ235/basalt/tree/nvidia_test

Theories:

  • Temporary images provided by the atlas are being held too long by the swap chain preventing the atlas from updating.
  • Atlas command future may have not been handled correctly possibly depending on undefined behavior.
  • Swapchain isn't sync'ing correctly, there has been issues around nvidia requiring fence/wait after ever frame.
  • Limit redraw option could be too limiting preventing and update when one is needed.
  • Some other less likely ones...

Hopefully sometime in the future I can pickup an nvidia card to do testing on that platform, as I have in the past.

@C0D3-M4513R
Copy link
Contributor Author

I'd love to look into the code, but the codebase is right now too large, for me to understand.
I got some output for you.
I added some logging statements myself.

In the future, you might wanna look into using the log crate.
That crate provides 4 important macros: trace!,debug!,info!,warn!,error!

The exe can then select the verboseness of each crate individually.

[Basalt]: VK Queues [2/2/2]
odb: update: 0 bins are alive
odb: update: gonna do updates now!
main: add background
[Basalt]: Swapchain B8G8R8A8Srgb/SrgbNonLinear
main: set background style
style_update: updated style
main: add button
main: set button style
style_update: updated style
main: set button on_mouse_press callback
main: wait_for_exit
[Basalt]: Swapchain Num Images: 3, Min: 2, Max: 8
odb: update: 2 bins are alive
odb: update: gonna do updates now!
bin: do_update: start
bin: do_update: start
bin: do_update: done
[Basalt]: Atlas Creating Image: 0
[Basalt]: Atlas Updated Image: 0
Atlas Updated in 58.3 ms. 1:21x23
[Basalt]: Atlas Creating Image: 1
[Basalt]: Atlas Updated Image: 1
Atlas Updated in 1.7 ms. 1:21x53
[Basalt]: Atlas Updating Existing Image: 0
[Basalt]: Atlas Updated Image: 0
Atlas Updated in 2.9 ms. 1:21x92
[Basalt]: Atlas Updating Existing Image: 1
[Basalt]: Atlas Updated Image: 1
Atlas Updated in 2.3 ms. 1:21x129
[Basalt]: Atlas Updating Existing Image: 0
[Basalt]: Atlas Updated Image: 0
Atlas Updated in 1.8 ms. 1:21x164
bin: do_update: done
[Basalt]: Atlas Updating Existing Image: 1
[Basalt]: Atlas Updated Image: 1
Atlas Updated in 2.1 ms. 1:21x201
[Basalt]: Atlas Updating Existing Image: 0
[Basalt]: Atlas Updated Image: 0
Atlas Updated in 1.5 ms. 1:21x201
odb: update: 2 bins are alive
[Basalt]: Atlas Creating Image: 2
odb: update: gonna do updates now!
bin: do_update: start
bin: do_update: start
bin: do_update: done
[Basalt]: Atlas Updated Image: 2
bin: do_update: done
Atlas Updated in 1.7 ms. 1:21x201
[Basalt]: Atlas not updating, nothing to do.
odb: update: 2 bins are alive
odb: update: gonna do updates now!
bin: do_update: start
bin: do_update: start
bin: do_update: done
bin: do_update: done

@AustinJ235
Copy link
Owner

Found my old GTX 780 to test on. I am getting a DeviceLost error from within ilmenite which is my lib for font rasterizing. I'll continue to investigate the cause. Hopefully Nvidia will be working soon™.

@AustinJ235
Copy link
Owner

Doing further research I am a bit lost as to why a DeviceLost error may occur. As you may know I use vulkano and I am not sure how sound the code is around compute shaders. One of the major differences that may be causing issues between amd and nvidia cards is that at least the 780 has very different memory alignment requirements, which I think may be causing the shader to read/write memory it isn't suppose to causing the DeviceLost error. TBH I am kind of surprise you don't 'run into any errors rather the shader just outputs zeros.

At the time of creation for ilmenite, the font space in rust was a bit limited and didn't produce results of my liking. Thus I went about creating ilmenite. Ilmenite does however depend on the gpu for text rasterizing and is slower than other alternatives out there, but the over all glyph positioning and handling of other languages that aren't latin based is much better.

I spent a little time tonight implementing fontdue as changing backends in Basalt isn't terribly difficult. The glyph positioning definitely isn't that great in comparison to ilmenite, but at least it works on nvidia cards. Check out the maybe_fontdue branch if you want to continue trying out Basalt.

I am probably going to continue to use ilmenite however. Switching over to a graphics based pipeline instead of a compute one I hope should solve some issues.

@AustinJ235
Copy link
Owner

Few hours later... I decided to implement cpu rasterization for ilmenite. Ilmenite will now default to this for now since the compute shader version seems to be broken on nvidia cards. I went ahead and released ilmenite 0.4.1 and basalt 0.11.2.

Have a go I believe this should fix your issue.

@C0D3-M4513R
Copy link
Contributor Author

Text now also works for me. The solution is not the best, but nothing to be done about it.
Btw. I get a Qwery from ScanCode: Unsupported keycode: 0 on window focus.

@AustinJ235
Copy link
Owner

I removed the warning about unsupported keycode on windows. Not sure why winit is outputting it in the first place.

@AustinJ235
Copy link
Owner

AustinJ235 commented Jul 30, 2021

@C0D3-M4513R gpu acceleration for ilmenite has been reenabled! (works on my 780). Turns out where I thought a buffer should had been a storage buffer and vulkano was saying it should have been a uniform buffer, I was correct. Specifying the vulkan & spriv version in the shader resolves issues with vulkano's detection in the current release. Vulkano master wouldn't need this work around as I merged a pull request over there that resolves this issue.

@C0D3-M4513R
Copy link
Contributor Author

C0D3-M4513R commented Jul 30, 2021

@AustinJ235 still works. just tested https://github.com/AustinJ235/basalt#26774d0b. still works as expected, also from me!

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

No branches or pull requests

2 participants