use a shared object with multiple length keys to store regl buffers #152
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously deepscatter had something called a TileBufferManager. This doesn't make a huge amount of sense, and had a concrete cost; if two tiles used the same underlying Arrow memory for a column (say, 2**16 floating point zeros), then we'd use different memory on the GPU for them.
This PR revamps that storage so that it uses the new TupleMap class. There is a single shared buffer manager across the whole plot, which uses a key that includes the tile itself and then the string name of the field desired (which is now actually string[], for help in the next PR.)
This map associates each column with its underlying Arrow vector memory, and it is that memory that is used as a key to the GPU buffers. This is a little weird, but the two-step operation means taht we can re-use memory more efficiently.
At some later point I'll more fully build on this. One goal is that for four types of floating point data we can always use a single webGL buffer instead of re-allocating them ad-infinitum:
All-false (or all-zero in float32 land)
All-true (or all-one in float32 land)
Nth-item-true, rest false (by creating a big array with a one in the middle at position K, and starting the view of that buffer at position K-N.
Nth-item-false, rest true (inverse of number 3).
Important
Introduces
BufferManager
for efficient GPU buffer management inregl_rendering.ts
, replacingTileBufferManager
, and updates rendering logic inReglRenderer
.BufferManager
inregl_rendering.ts
to replaceTileBufferManager
for managing GPU buffers.TupleMap
to associate Arrow vector memory with GPU buffers, allowing shared buffer management across the plot.BufferManager
handles buffer creation and memory reuse, improving efficiency.ReglRenderer
to useBufferManager
for buffer management.render_points()
andremake_renderer()
.ColorChange.svelte
.This description was created by for 5903dbd. It will automatically update as commits are pushed.