>>14175539draw each point of a stroke to a 3d texture, or, if needed, a spatial map data structure in a ssbo
as the invocation ID increases (multiplied by the parameter), we increase depth, which avoids your intersection problem
in a separate invocation, we then apply our brush texture to each point, with either one or more workgroups depending on HW implementation requirements and brush size, there is no overdraw here because each brush point is still on its own layer
we then progressively flatten each pixel of the final image concurrently, iterating through the layers, and if the value on our current layer is non-zero, we draw the arithmetic mean of our current pixel and the final pixel to the final pixel, avoiding opacity overflow
we've calculated every point on every line simultaneously, and we've drawn our brush texture to each point simultaneously, and we've flattened each pixel of our layers into a final image simultaneously, with an arbitrary brush and level of opacity
only 3 compute shader invocations to produce a final image in far, far less than a second