as / a

A graphical text editor
BSD 3-Clause "New" or "Revised" License
345 stars 25 forks source link

a: investigate why swizzle lags the ui so much; is pre-swizzle worth the complexity? #123

Closed as closed 6 years ago

as commented 6 years ago

Unswizzled shiny lives in github.com/as/shiny. It's like exp/shiny, but doesn't swizzle. Swizzle refers to the swapping of RGBA pixels into the native Windows pixel format. The current shiny implementation implements a swizzle in assembler remarkably faster than GDI's bitfields by orders of magnitude, using SSSE3 registers, etc. However, it seems that no matter how fast the implementation, there is considerable entropy in the following process current to exp/shiny:

1.) Lock the buffer 2.) Swizzle the buffer 3.) Upload the buffer 4.) Unswizzle the buffer

On a 4k screen, this algorithm performs unfavorably on most systems. Forcing the use of residency masks and rectangle caches to update text smoothly.

It is cheap to pre-compute the BGRA colors in as/frame and omit the swizzle entirely. However, it becomes a mess quickly when images are involved.