Group all solid triangles independently of color#1538
Conversation
|
Changes seem good, thanks for doing this! Tested on macos M1 glow & wgpu (only computer I have access to at the moment), so cannot speak to old GL versions but I don't see any changes that would break anything there. Also tested WASM build and seems good. Only nit I have re: nesting |
|
Can also pull in the old Geometry example again from 0.4 branch since we have colors in vertex data again (happy to do this after the merge!) |
|
did we mention it's fast |
bungoboingo
left a comment
There was a problem hiding this comment.
Unless we want to add those From<Color> & From<Gradient>s in for canvas::style I'd say this is good to go.
I know it's pretty subjective, but I felt like the boundaries of the modules were a bit blurry (e.g. only some fields were public, methods needed to be called in a particular order and with correct indices, etc.). I usually prefer no boundaries at all than blurry ones. We could still move the modules to their own files but, since everything is pretty coupled, I feel the pipelines are easier to edit this way. |
This PR enhances our
trianglepipelines to batch all solid geometry independently of color.As a result, all solid geometry drawn sequentially in a
Canvaswill be batched together into a single draw call independently of color. The previous behavior produced as many draw calls as different colors used.We achieve this by introducing a new
ColoredVertex2Dtype and separatingMeshintoSolidMeshandGradientMeshvariants inPrimitive.No user-facing APIs have changed.