Webgl points / skip hit detection render when out of sync

This happens when the indices buffer has been generated by the
worker but not the hit detection vertices buffer.
This commit is contained in:
Olivier Guyot
2019-08-30 10:38:41 +02:00
parent c48350b666
commit 5c1191dd5c

View File

@@ -544,6 +544,12 @@ class WebGLPointsLayerRenderer extends WebGLLayerRenderer {
* @param {import("../../PluggableMap.js").FrameState} frameState current frame state
*/
renderHitDetection(frameState) {
// skip render entirely if vertices buffers for display & hit detection have different sizes
// this typically means both buffers are temporarily out of sync
if (this.hitVerticesBuffer_.getSize() !== this.verticesBuffer_.getSize()) {
return;
}
this.hitRenderTarget_.setSize(frameState.size);
this.helper.useProgram(this.hitProgram_);