]> git.sesse.net Git - nageru/commit
Change Futatabi frames to be cached as textures instead of in system memory.
authorSteinar H. Gunderson <steinar+nageru@gunderson.no>
Sun, 8 Mar 2020 14:57:51 +0000 (15:57 +0100)
committerSteinar H. Gunderson <steinar+nageru@gunderson.no>
Sun, 8 Mar 2020 14:57:51 +0000 (15:57 +0100)
commitadc0df09f7a9dc88a3c0dbad47a21a805e728862
tree5acd2389a2252db2c0182df1f241fa418bc98cbb
parent02ea864dc5a6dde7450c497581ff18d784ab832c
Change Futatabi frames to be cached as textures instead of in system memory.

The JPEGs are now decoded into PBO bounce buffers, which saves a lot of CPU
time (copying is asynchronous, and done by the GPU -- plus we save a copy
into a staging buffer).

Similarly, keeping the cache in textures allows the driver (if it wants!)
to keep it in VRAM, saving repeated uploading if the same frame is used
multiple times.

CPU usage is down from 1.05 to 0.60 cores on my machine, when not playing.
More importantly, the 99-percentile player queue status is extremely much
better.
15 files changed:
futatabi/jpeg_frame.h
futatabi/jpeg_frame_view.cpp
futatabi/jpeg_frame_view.h
futatabi/mainwindow.cpp
futatabi/pbo_pool.cpp [new file with mode: 0644]
futatabi/pbo_pool.h [new file with mode: 0644]
futatabi/vaapi_jpeg_decoder.cpp
futatabi/video_stream.cpp
futatabi/ycbcr_converter.cpp
meson.build
nageru/image_input.cpp
nageru/image_input.h
shared/meson.build
shared/ref_counted_texture.cpp [new file with mode: 0644]
shared/ref_counted_texture.h