summaryrefslogtreecommitdiff
path: root/src/gpu/Cells.zig
Commit message (Collapse)AuthorAge
* Add pardes's frame recording to CellsGabriel Schneider2 hours
| | | | | | | | | | | | Moved from pardes's src/gui/gui.zig (step S4b, the last of moving its renderer here): begin and submit acquire a frame's command buffer and give a frame up; mapCells grows and maps the cell instance buffer for the embedder to write in place; uploadCells sends it after the atlas's dirty rows; record makes the frame's render pass, cleared to the embedder's colour, and draws its groups (Group: cells, then pictures, then decor, each a run of instances), a scroll's shifted rows clipped to the rectangle given, then the overlay. uploadAtlas, drawImages, pushLayerOpacity and drawOverlay are Cells' own now.
* Add pardes's cell resources, pictures, overlay and atlas uploadGabriel Schneider2 hours
| | | | | | | | | | | | | | | | | Moved from pardes's src/gui/gui.zig (step S4a of moving its renderer here): Cells is now a struct over the embedder's device and swapchain format holding the four pipelines (and the addon one, made on first use), the glyph atlas's texture, nearest sampler and upload buffer, the pictures' linear sampler, the cells', pictures' and overlay's buffers, and the pictures' textures by key. init and deinit make and release them; image uploads a picture's RGBA, or only its dirty rows into the texture of the picture it replaces; mapImages, uploadImages and drawImages carry the frame's picture instances and draws, an ImageDraw's texture either one of Cells' own or the caller's, borrowed (an addon's premultiplied output); uploadAtlas sends the Atlas's dirty rows; uploadOverlay, pushLayerOpacity and drawOverlay the overlay's triangles. The SPIR-V is the embedder's `<name>.spv` imports; Cells.zig imports the Atlas as `font_atlas`.
* Add pardes's cell shaders, instance ABI and GPU resource helpersGabriel Schneider2 hours
Moved verbatim from pardes's src/gui/gui.zig (step S1 of moving its renderer here): the seven GLSL shaders and their committed SPIR-V under src/gpu/shaders/, and src/gpu/Cells.zig with the instance structs the shaders read, the vertex inputs, makePipeline, the layer blend, texture2d and growInstances (which takes the device instead of pardes's Gui). Cells.zig imports the embedder's own SDL translation as `c`; pardes compiles it from this checkout. `zig build shaders` refreshes the prebuilt SPIR-V.