Skip to content

Switch from Float32 to Uint16 for encoding colors in buffers #10587

Open
@mourner

Description

@mourner

Currently we use a pair of Float32 values to represent a color value in WebGL buffers:

type: 'Float32',
components: type === 'color' ? 2 : 1,

Using a pair of Uint16 instead should be enough precision while cutting the amount of data necessary to represent data-driven color properties in half, which might be a nice low hanging fruit to optimize performance in styles that extensively use data-driven colors (such as Mapbox core styles).

Metadata

Metadata

Assignees

No one assigned

    Labels

    performance ⚡Speed, stability, CPU usage, memory usage, or power usage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions