adrien-ben / imgui-rs-vulkan-renderer

A Vulkan renderer for imgui-rs using Ash
MIT License
63 stars 19 forks source link

Renderer appears to not work on HiDpi displays #13

Closed photex closed 3 years ago

photex commented 3 years ago

I'm trying to figure out whats missing exactly. If you have any ideas I'm happy to hear them and send a PR with anything that ends up working. :+1:

adrien-ben commented 3 years ago

Hi,

Can you provide more details about what is not working ? Is it not rendering at all or not at the proper scale ? Have you tried running the exemples with validation layers enabled ?

photex commented 3 years ago

The issue seems to be that imgui quads are all projected at the physical resolution instead of the logical (aka not at the proper scale as you've said). Events and scissor regions all appear to be correct otherwise. I'm on the road until this evening. I'll make a screen cap of the issue asap. This issue occurs with any of the example in this repo.

adrien-ben commented 3 years ago

Thanks for the details. When you have time could you try this branch https://github.com/adrien-ben/imgui-rs-vulkan-renderer/tree/fix_hidpi_scale and tell me if the results are better ?

I was able to reproduce the issue by changing the rendering scale of Windows and the change fixed it for me.

photex commented 3 years ago

Confirmed that this fixes the issue for me. :D Thanks for laying it out like that.

I stepped through everything with the debugger and came to the conclusion that the ortho projection was the problem, but I was convinced that the source of the problem lay elsewhere and that I must be using something wrong upstream. :D

adrien-ben commented 3 years ago

Nice :), for some reason I applied the window's scale to the projection.

Thanks for raising the issue now I know I can change Windows UI scale to test that kind of stuff ! :)

adrien-ben commented 3 years ago

Version 0.6.1 is now available :) Have a nice day !

photex commented 3 years ago

Awesome! Thanks for wrapping that up so quickly.