-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect rendering when transitioning a style property to and from a property function #3453
Comments
Even with this, I think you'll still have problems with the current recalculated style not matching the programConfiguration of a tile. In your example the tiles need the style to calculate a constant value for property P in order for the rendering to work. But the style has already been changed to use a property function so it can't calculate a constant value for it. And what if multiple loaded tiles in a layer use different programConfigurations? I don't think the answer is to have multiple versions of the style recalculated for different tiles. I think we need to make sure all tiles being rendered are on the same style version. I'm imagining:
|
I agree this is the best long-term solution. 👍 |
Good point; I hadn't considered that. It would be possible for
This would also avoid the partial redraws as single tiles come in with updated paint vertex buffers. It seems like it could be a big, difficult architectural change though... |
@jfirebaugh This would also address one of the major performance regressions caused by DDS, per #3342. So while it's a big, difficult change, I think it's worth it by a wide margin. |
Capturing another related idea from chat:
|
→ #4012. |
In order for rendering to obtain the correct result, three things must be mutually consistent, in the sense that they must all be calculated using a consistent view of layer paint properties:
Bucket#paintAttributes
(orprogramConfigurations
, post Introduce ProgramConfiguration #3439)paintVertexArrayTypes
paintVertexArrays
(worker) /paintVertexBuffers
(main thread)The worker serializes and sends
paintVertexArrayTypes
along withpaintVertexArrays
, ensuring that the latter two items are mutually consistent. However, it's possible that the first two items are inconsistent. Consider the following scenario:(L, P, constant)
.(L, P, constant)
.map.setPaintProperty(L, P, propertyFunction)
, resulting in state(L, P, propertyFunction)
.(L, P, constant)
are completed and received by the main thread.This will produce an incorrect rendering. In step 4, the
Bucket
s constructpaintAttributes
(orprogramConfigurations
, post #3439) using the current layer state, rather than the state seen by the worker. Thus they producepaintAttributes
corresponding to(L, P, propertyFunction)
, indicating that P is data-driven and bound via a vertex attribute. However,paintVertexArrays
are for the state(L, P, constant)
, and do not contain this attribute. In my testing, this resulted in no features being drawn for this layer. I suspect it may also trigger WebGL errors, which we are not currently checking for.The solution I have in mind is to fully serialize and transfer
paintAttributes
along withpaintVertexArrayTypes
andpaintVertexArrays
, and never pass current style state intoBucket
deserialization functions.This is difficult to write an automated test for. It's actually not too hard to get the timing right -- the difficulty is that our runtime styling tests have a
"wait"
command but no "rerender now" command. Simply omitting"wait"
does not trigger a rerender. You can queue a rerender with e.g. a camera operation, but then there's no way to wait for it to occur without also waiting for tile loads to finish, and the bug only manifests in the interim period.The text was updated successfully, but these errors were encountered: