mainTwoPassFineWGSL¶
Overview¶
Fine rasterization stage for the "two-pass" setup.
Each bin (16x16, or smaller if grid-filtering) will have a linked list of (non-overlapping) faces that need to be rendered into its pixels. We spawn a workgroup PER bin, so we have (nominally) a thread-per-pixel. We'll loop over the faces, accumulating the color for each pixel. Then once done, we can gamut-map it and store it.
There will be the following filter types: - Box filtering (implemented) - Bilinear filtering (implemented) - Mitchell-Netravali filtering (not implemented) TODO: implement Mitchell-Netravali (both grid and arbitrary-scale)
When filter scale is 1, we can use a grid-filtering approach for bilinear+ filtering, where we will compute a full 16x16 grid of integrals (and colors), which will then be combined into the proper (e.g. 15x15) set of pixels. Thus the bin size can be 15x15 (if bilinear and filter_scale=1), or 13x13 (if Mitchell-Netravali and filter_scale=1).
Should be dispatched with one workgroup PER bin (one thread per grid "pixel")
TODO: optimize is_constant
@author Jonathan Olson <jonathan.olson@colorado.edu>
Type mainTwoPassFineWGSLOptions¶
- config: BufferSlot<TwoPassConfig>
- addresses: BufferSlot<number[]>
- fineRenderableFaces: BufferSlot<TwoPassFineRenderableFace[]>
- renderProgramInstructions: BufferSlot<number[]>
- edges: BufferSlot<LinearEdge[]>
- output: TextureViewSlot
- storageFormat: GPUTextureFormat
- supportsGridFiltering?: boolean
- supportsBilinear?: boolean
- supportsMitchellNetravali?: boolean
Source Code¶
See the source for mainTwoPassFineWGSL.ts in the alpenglow repository.