Skip to content

Protect from uploading deleted ArrayBuffers - #6665

Merged
asheemmamoowala merged 1 commit into
masterfrom
6655-fix-arraybuffer
May 15, 2018
Merged

asheemmamoowala merged 1 commit into
masterfrom
6655-fix-arraybuffer

Conversation

@asheemmamoowala

Copy link
Copy Markdown
Contributor

Fixes #6655.

The PaintVertexArray's backing buffer is deleted after Binder#upload for properties that are not dependent on feature-state expressions. ProgramCongfiguration keeps track of whether its binders need to be re-uploaded after a feature-state expression is re-evaluated, but it doesn't discriminate between binders and tried to re-upload them all.

#6655 describes a scenario where multiple properties in a Program are data-driven, and the program tries (incorrectly) to re-upload them all even when they are not feature-state dependent.

Options for fixing this are:

  • Protect against the upload of a deleted array buffer
  • Have each Binder keep track of whether it's paint array(s) have been updated, and whether it needs to be uploaded.

In both cases, the fix is to check before attempting an upload. Protecting against using a null array buffer handles this and other potential situations, without needing an extra flag to indicate the valid state.

…f 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.
@asheemmamoowala
asheemmamoowala merged commit 4d2b9ad into master May 15, 2018
@asheemmamoowala
asheemmamoowala deleted the 6655-fix-arraybuffer branch May 15, 2018 16:32
mollymerp pushed a commit that referenced this pull request May 17, 2018
mollymerp pushed a commit that referenced this pull request Jul 26, 2018
mollymerp pushed a commit that referenced this pull request Aug 14, 2018
mollymerp pushed a commit that referenced this pull request Aug 14, 2018
mollymerp pushed a commit that referenced this pull request Aug 22, 2018
mollymerp pushed a commit that referenced this pull request Aug 24, 2018
…ll-extrusion-pattern properties

allow multiple attributes per style-spec property

add CrossFadedDataDrivenProp for line-pattern DDS"

convert line_pattern shaders to use pragmas

create layouts for data-driven line-pattern vertex buffers

add source function support for line-pattern to line bucket population and draw code

use min, mid, max images for cross-fading data-driven patterns

also use tile's IconAtlas for data constant line-pattern

extend Binders to support line-pattern properties

add initial render test

nit fix

ensure all possible icons for line-pattern camera funcs are added to the icon atlas

make arguments needed for ddpattern required

set binder type on property

make pattern attributes independent of line layer

implement data-driven styling for fill-pattern

add dds render test for fill-pattern

eliminate black flash on setPaintProperty with a pattern value

extend integer-only evaluation to CrossFadedDataDrivenProps

address review comments

remove getPossibleOutputs and fix rendering

extend feature state updating to CrossFadedCompositeBinder

use getPossibleOutputs instead of iterating over all features

add 1px padding wrap to sprites

separate icon and pattern sprites in ImageAtlas to fix wrapping in -pattern properties

rename imageAtlas --> iconAtlas now that it holds both icons and pattern images

update to use new style-spec expression schema

implement fill-extrusion-pattern dds

address review comments

simplify imageAtlas check

remove redundant CrossFaded properties

backport #6665

remove unpack function for pattern attrs

backport #6745 and fix rebase flubs

update with uniform binding state management

expose possibleOutputs() at the StylePropertyExpression level

add some query tests

rebase fix

Don't wait for pattern images to layout layers no -pattern property set

bonus: remove limitation on non-deterministic expression outputs for pattern properties and reliance on `possibleOutputs()` state

remove getPossibleOutputs from CrossFadedDataDrivenProperty

refactor CrossFaded and CrossfadeParameters

DRY bucket code with util function
mollymerp pushed a commit that referenced this pull request Aug 24, 2018
…ll-extrusion-pattern properties

allow multiple attributes per style-spec property

add CrossFadedDataDrivenProp for line-pattern DDS"

convert line_pattern shaders to use pragmas

create layouts for data-driven line-pattern vertex buffers

add source function support for line-pattern to line bucket population and draw code

use min, mid, max images for cross-fading data-driven patterns

also use tile's IconAtlas for data constant line-pattern

extend Binders to support line-pattern properties

add initial render test

nit fix

ensure all possible icons for line-pattern camera funcs are added to the icon atlas

make arguments needed for ddpattern required

set binder type on property

make pattern attributes independent of line layer

implement data-driven styling for fill-pattern

add dds render test for fill-pattern

eliminate black flash on setPaintProperty with a pattern value

extend integer-only evaluation to CrossFadedDataDrivenProps

address review comments

remove getPossibleOutputs and fix rendering

extend feature state updating to CrossFadedCompositeBinder

use getPossibleOutputs instead of iterating over all features

add 1px padding wrap to sprites

separate icon and pattern sprites in ImageAtlas to fix wrapping in -pattern properties

rename imageAtlas --> iconAtlas now that it holds both icons and pattern images

update to use new style-spec expression schema

implement fill-extrusion-pattern dds

address review comments

simplify imageAtlas check

remove redundant CrossFaded properties

backport #6665

remove unpack function for pattern attrs

backport #6745 and fix rebase flubs

update with uniform binding state management

expose possibleOutputs() at the StylePropertyExpression level

add some query tests

rebase fix

Don't wait for pattern images to layout layers no -pattern property set

bonus: remove limitation on non-deterministic expression outputs for pattern properties and reliance on `possibleOutputs()` state

remove getPossibleOutputs from CrossFadedDataDrivenProperty

refactor CrossFaded and CrossfadeParameters

DRY bucket code with util function
mollymerp pushed a commit that referenced this pull request Aug 24, 2018
…ll-extrusion-pattern properties

allow multiple attributes per style-spec property

add CrossFadedDataDrivenProp for line-pattern DDS"

convert line_pattern shaders to use pragmas

create layouts for data-driven line-pattern vertex buffers

add source function support for line-pattern to line bucket population and draw code

use min, mid, max images for cross-fading data-driven patterns

also use tile's IconAtlas for data constant line-pattern

extend Binders to support line-pattern properties

add initial render test

nit fix

ensure all possible icons for line-pattern camera funcs are added to the icon atlas

make arguments needed for ddpattern required

set binder type on property

make pattern attributes independent of line layer

implement data-driven styling for fill-pattern

add dds render test for fill-pattern

eliminate black flash on setPaintProperty with a pattern value

extend integer-only evaluation to CrossFadedDataDrivenProps

address review comments

remove getPossibleOutputs and fix rendering

extend feature state updating to CrossFadedCompositeBinder

use getPossibleOutputs instead of iterating over all features

add 1px padding wrap to sprites

separate icon and pattern sprites in ImageAtlas to fix wrapping in -pattern properties

rename imageAtlas --> iconAtlas now that it holds both icons and pattern images

update to use new style-spec expression schema

implement fill-extrusion-pattern dds

address review comments

simplify imageAtlas check

remove redundant CrossFaded properties

backport #6665

remove unpack function for pattern attrs

backport #6745 and fix rebase flubs

update with uniform binding state management

expose possibleOutputs() at the StylePropertyExpression level

add some query tests

rebase fix

Don't wait for pattern images to layout layers no -pattern property set

bonus: remove limitation on non-deterministic expression outputs for pattern properties and reliance on `possibleOutputs()` state

remove getPossibleOutputs from CrossFadedDataDrivenProperty

refactor CrossFaded and CrossfadeParameters

DRY bucket code with util function

refactor pattern bucket functions
mollymerp pushed a commit that referenced this pull request Aug 27, 2018
…ll-extrusion-pattern properties

allow multiple attributes per style-spec property

add CrossFadedDataDrivenProp for line-pattern DDS"

convert line_pattern shaders to use pragmas

create layouts for data-driven line-pattern vertex buffers

add source function support for line-pattern to line bucket population and draw code

use min, mid, max images for cross-fading data-driven patterns

also use tile's IconAtlas for data constant line-pattern

extend Binders to support line-pattern properties

add initial render test

nit fix

ensure all possible icons for line-pattern camera funcs are added to the icon atlas

make arguments needed for ddpattern required

set binder type on property

make pattern attributes independent of line layer

implement data-driven styling for fill-pattern

add dds render test for fill-pattern

eliminate black flash on setPaintProperty with a pattern value

extend integer-only evaluation to CrossFadedDataDrivenProps

address review comments

remove getPossibleOutputs and fix rendering

extend feature state updating to CrossFadedCompositeBinder

use getPossibleOutputs instead of iterating over all features

add 1px padding wrap to sprites

separate icon and pattern sprites in ImageAtlas to fix wrapping in -pattern properties

rename imageAtlas --> iconAtlas now that it holds both icons and pattern images

update to use new style-spec expression schema

implement fill-extrusion-pattern dds

address review comments

simplify imageAtlas check

remove redundant CrossFaded properties

backport #6665

remove unpack function for pattern attrs

backport #6745 and fix rebase flubs

update with uniform binding state management

expose possibleOutputs() at the StylePropertyExpression level

add some query tests

rebase fix

Don't wait for pattern images to layout layers no -pattern property set

bonus: remove limitation on non-deterministic expression outputs for pattern properties and reliance on `possibleOutputs()` state

remove getPossibleOutputs from CrossFadedDataDrivenProperty

refactor CrossFaded and CrossfadeParameters

DRY bucket code with util function

refactor pattern bucket functions
melitele pushed a commit to pirxpilot/mapbox-gl-js that referenced this pull request Mar 5, 2025
…ll-extrusion-pattern properties

allow multiple attributes per style-spec property

add CrossFadedDataDrivenProp for line-pattern DDS"

convert line_pattern shaders to use pragmas

create layouts for data-driven line-pattern vertex buffers

add source function support for line-pattern to line bucket population and draw code

use min, mid, max images for cross-fading data-driven patterns

also use tile's IconAtlas for data constant line-pattern

extend Binders to support line-pattern properties

add initial render test

nit fix

ensure all possible icons for line-pattern camera funcs are added to the icon atlas

make arguments needed for ddpattern required

set binder type on property

make pattern attributes independent of line layer

implement data-driven styling for fill-pattern

add dds render test for fill-pattern

eliminate black flash on setPaintProperty with a pattern value

extend integer-only evaluation to CrossFadedDataDrivenProps

address review comments

remove getPossibleOutputs and fix rendering

extend feature state updating to CrossFadedCompositeBinder

use getPossibleOutputs instead of iterating over all features

add 1px padding wrap to sprites

separate icon and pattern sprites in ImageAtlas to fix wrapping in -pattern properties

rename imageAtlas --> iconAtlas now that it holds both icons and pattern images

update to use new style-spec expression schema

implement fill-extrusion-pattern dds

address review comments

simplify imageAtlas check

remove redundant CrossFaded properties

backport mapbox#6665

remove unpack function for pattern attrs

backport mapbox#6745 and fix rebase flubs

update with uniform binding state management

expose possibleOutputs() at the StylePropertyExpression level

add some query tests

rebase fix

Don't wait for pattern images to layout layers no -pattern property set

bonus: remove limitation on non-deterministic expression outputs for pattern properties and reliance on `possibleOutputs()` state

remove getPossibleOutputs from CrossFadedDataDrivenProperty

refactor CrossFaded and CrossfadeParameters

DRY bucket code with util function

refactor pattern bucket functions
melitele pushed a commit to pirxpilot/mapbox-gl-js that referenced this pull request Mar 5, 2025
…ll-extrusion-pattern properties

allow multiple attributes per style-spec property

add CrossFadedDataDrivenProp for line-pattern DDS"

convert line_pattern shaders to use pragmas

create layouts for data-driven line-pattern vertex buffers

add source function support for line-pattern to line bucket population and draw code

use min, mid, max images for cross-fading data-driven patterns

also use tile's IconAtlas for data constant line-pattern

extend Binders to support line-pattern properties

add initial render test

nit fix

ensure all possible icons for line-pattern camera funcs are added to the icon atlas

make arguments needed for ddpattern required

set binder type on property

make pattern attributes independent of line layer

implement data-driven styling for fill-pattern

add dds render test for fill-pattern

eliminate black flash on setPaintProperty with a pattern value

extend integer-only evaluation to CrossFadedDataDrivenProps

address review comments

remove getPossibleOutputs and fix rendering

extend feature state updating to CrossFadedCompositeBinder

use getPossibleOutputs instead of iterating over all features

add 1px padding wrap to sprites

separate icon and pattern sprites in ImageAtlas to fix wrapping in -pattern properties

rename imageAtlas --> iconAtlas now that it holds both icons and pattern images

update to use new style-spec expression schema

implement fill-extrusion-pattern dds

address review comments

simplify imageAtlas check

remove redundant CrossFaded properties

backport mapbox#6665

remove unpack function for pattern attrs

backport mapbox#6745 and fix rebase flubs

update with uniform binding state management

expose possibleOutputs() at the StylePropertyExpression level

add some query tests

rebase fix

Don't wait for pattern images to layout layers no -pattern property set

bonus: remove limitation on non-deterministic expression outputs for pattern properties and reliance on `possibleOutputs()` state

remove getPossibleOutputs from CrossFadedDataDrivenProperty

refactor CrossFaded and CrossfadeParameters

DRY bucket code with util function

refactor pattern bucket functions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature-state with expression makes layer's tile disappear with WebGL: INVALID_VALUE: bufferData: no data

2 participants