From 0fba9cab89d87f4af8bac87ea48b94ede11bf13f Mon Sep 17 00:00:00 2001 From: Asheem Mamoowala Date: Mon, 14 May 2018 13:52:56 -0700 Subject: [PATCH] The PaintVertexArray's backing array buffer is deleted after upload if the Binder refers to a non state-dependent property expression. Ensure that Binder#upload does not attempt to re-upload the PaintVertexArray after a subsequent feature-state update. --- src/data/program_configuration.js | 4 +- .../mapbox-gl-js#6655/expected.png | Bin 0 -> 445 bytes .../regressions/mapbox-gl-js#6655/style.json | 59 ++++++++++++++++++ 3 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 test/integration/render-tests/regressions/mapbox-gl-js#6655/expected.png create mode 100644 test/integration/render-tests/regressions/mapbox-gl-js#6655/style.json diff --git a/src/data/program_configuration.js b/src/data/program_configuration.js index 6f1ff830a34..0c3a6ea1659 100644 --- a/src/data/program_configuration.js +++ b/src/data/program_configuration.js @@ -184,7 +184,7 @@ class SourceExpressionBinder implements Binder { } upload(context: Context) { - if (this.paintVertexArray) { + if (this.paintVertexArray && this.paintVertexArray.arrayBuffer) { this.paintVertexBuffer = context.createVertexBuffer(this.paintVertexArray, this.paintVertexAttributes, this.expression.isStateDependent); } } @@ -279,7 +279,7 @@ class CompositeExpressionBinder implements Binder { } upload(context: Context) { - if (this.paintVertexArray) { + if (this.paintVertexArray && this.paintVertexArray.arrayBuffer) { this.paintVertexBuffer = context.createVertexBuffer(this.paintVertexArray, this.paintVertexAttributes, this.expression.isStateDependent); } } diff --git a/test/integration/render-tests/regressions/mapbox-gl-js#6655/expected.png b/test/integration/render-tests/regressions/mapbox-gl-js#6655/expected.png new file mode 100644 index 0000000000000000000000000000000000000000..0f286c436a1bdbb7331b758294fc3a76c27a6a72 GIT binary patch literal 445 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=Or9=|Ar*{or0Om)Fff*ZcyAAG z%!*2sV7O4c-rKR@va8Xugu)HYyB|cm7(LaUWLe3rZs^?pO|+$lZ>z%D2N5wz)42R3 zFFA4Ty{@8iy59JSwL6Dmi+~f1_)wQ}&yAV6#5N+SZEaWTs;dW8tLAMxAh<46C3tS| zoa(v8F)JK=P5lbreQn!ucTxl3T^2}+4wG?IYifp;j6H$GvqqMts zQzKBIRP;+^rQ`gmo7S}yy^qmbyR^x&J