hotham icon indicating copy to clipboard operation
hotham copied to clipboard

[Bug] Extremely slow framerate when one UIPanel has an emoji and another does not

Open ickk opened this issue 2 years ago • 1 comments

This was a weird one to track down. If you spawn two separate UIPanels, and in one you include an emoji in the text field, but the other you do not, then hotham turns into a slide show.

This is the log output:

07-14 21:57:19.659  9587  9623 I RustStdoutStderr: [HOTHAM_DRAW_GUI] Done!
07-14 21:57:19.668  9587  9623 I RustStdoutStderr: [HOTHAM_DRAW_GUI] Updating font texture..
07-14 21:57:19.752  9587  9623 I RustStdoutStderr: [HOTHAM_VULKAN] Creating staging buffer..
07-14 21:57:19.752  9587  9623 I RustStdoutStderr: [HOTHAM_VULKAN] Allocated 2097152 bits of buffer memory: 0x6f8da9de80
07-14 21:57:19.753  9587  9623 I RustStdoutStderr: [HOTHAM_VULKAN] ..done!
07-14 21:57:19.753  9587  9623 I RustStdoutStderr: [HOTHAM_VULKAN] Copying buffer to image..
07-14 21:57:19.754  9587  9623 I RustStdoutStderr: [HOTHAM_VULKAN] ..done! Transitioning image layout..
07-14 21:57:19.754  9587  9623 I RustStdoutStderr: [HOTHAM_VULKAN] ..done! Freeing staging buffer..
07-14 21:57:19.754  9587  9623 I RustStdoutStderr: [HOTHAM_VULKAN] ..done!
07-14 21:57:19.754  9587  9623 I RustStdoutStderr: [HOTHAM_DRAW_GUI] Done!
07-14 21:57:19.754  9587  9623 I RustStdoutStderr: [HOTHAM_DRAW_GUI] Updating font texture..
07-14 21:57:19.838  9587  9623 I RustStdoutStderr: [HOTHAM_VULKAN] Creating staging buffer..
07-14 21:57:19.838  9587  9623 I RustStdoutStderr: [HOTHAM_VULKAN] Allocated 2097152 bits of buffer memory: 0x6f8da9e380
07-14 21:57:19.839  9587  9623 I RustStdoutStderr: [HOTHAM_VULKAN] ..done!
07-14 21:57:19.840  9587  9623 I RustStdoutStderr: [HOTHAM_VULKAN] Copying buffer to image..
07-14 21:57:19.840  9587  9623 I RustStdoutStderr: [HOTHAM_VULKAN] ..done! Transitioning image layout..
07-14 21:57:19.840  9587  9623 I RustStdoutStderr: [HOTHAM_VULKAN] ..done! Freeing staging buffer..
07-14 21:57:19.840  9587  9623 I RustStdoutStderr: [HOTHAM_VULKAN] ..done!
07-14 21:57:19.840  9587  9623 I RustStdoutStderr: [HOTHAM_DRAW_GUI] Done!
07-14 21:57:19.848  9587  9623 I RustStdoutStderr: [HOTHAM_DRAW_GUI] Updating font texture..

ad infinitum

A blind guess to the cause is that maybe the renderer is trying to swap the font every frame.


Reproduction available on: https://github.com/leetvr/hotham/tree/ickk/issue268-minimal_reproduction 153a58a864267e952ab2b53ffb80df51bdbda596 in the benchmarks folder

ickk avatar Jul 14 '22 12:07 ickk

This is absolutely amazing. Great find, mate!

kanerogers avatar Jul 14 '22 13:07 kanerogers