Conversation
…ain (to bring it into connectomics quickly...) experimental, might try typeGPU again
…sformer plugin...
…, to compare it with the type-gpu version
|
|
||
| type Content<V extends Cacheable> = Record<string, V> | ||
|
|
||
| export function buildScatterbrainCacheClient<V extends Cacheable>( |
There was a problem hiding this comment.
this file got moved - its mostly the same as the old webGL cache client! it did get a tiny tweak to make it agnostic to webGL / webGPU - you can use the same function (this one) to create either a webGL or webGPU cache-client, and they can even share the same cache, if you wanted
| @@ -0,0 +1,32 @@ | |||
| <!DOCTYPE html> | |||
There was a problem hiding this comment.
this is the demo I used to debug my webGPU implementation - we should remove it, but for now starlight seems to have trouble with our webGPU utils (a 3rd party helper)
| } & QuantitativeFilterRanges | ||
|
|
||
|
|
||
| export function generate(config: Config): string { |
There was a problem hiding this comment.
the guts of the shader that we generate to render a scatterplot in a particular configuration
| const toGpuBuffer = (buffer: ArrayBuffer, type: WebGLSafeBasicType) => { | ||
| if (type === 'uint16') { | ||
| // seems like uint16 is cursed - vertex buffers have to have a stride of at least 4... | ||
| const B = device.createBuffer({ size: buffer.byteLength * 2, usage: GPUBufferUsage.COPY_DST | GPUBufferUsage.VERTEX }); |
There was a problem hiding this comment.
here is the hack I use to deal with uint16 data - we expand it here when we cache it - its not slow, and we still get to keep our 16bit ints over the wire, but on the GPU we have to expand them to 32bit
There was a problem hiding this comment.
note that uint16 data is supported in webGPU, but any buffer that is bound as a vertex attribute must declare an arrayStride of at least 4 (bytes). this means if that its easy to use u16 data in an interleaved buffer, but impossible to use via separate buffers as we do for scatterbrain style columnar vertex data
| const bg1 = updateCategorical(categories); | ||
| const bg2 = updateGradient(viridis); // todo - dont do this every frame... | ||
|
|
||
| // so... the gad damn bindings - if you dont use a binding, it needs to be omitted from |
There was a problem hiding this comment.
this comment was made in anger, as I beat my head against a wall trying to get the shader to validate. remove!
| }; | ||
|
|
||
|
|
||
| export async function whatever() { |
There was a problem hiding this comment.
the bootstrap function for my demo - remote eventually
WIP Steps
This section is optional if the PR is fully ready for review
What
Replace this with 1-2 line Description of what feature, bugfix, chore does the PR contain the code for.
How
Replace this txt describing what kind of technical overlaying code changes were introduced here.
Screenshots
This section is optional if there are no visible changes
PR Checklist
main?