diff --git a/src/render/draw_line.js b/src/render/draw_line.js index 01a52f55c32..4a9da385509 100644 --- a/src/render/draw_line.js +++ b/src/render/draw_line.js @@ -14,6 +14,7 @@ import type SourceCache from '../source/source_cache.js'; import type LineStyleLayer from '../style/style_layer/line_style_layer.js'; import type LineBucket from '../data/bucket/line_bucket.js'; import type {OverscaledTileID} from '../source/tile_id.js'; +import type {DynamicDefinesType} from './program/program_uniforms.js'; import {clamp, nextPowerOfTwo} from '../util/util.js'; import {renderColorRamp} from '../util/color_ramp.js'; import EXTENT from '../data/extent.js'; diff --git a/src/render/program/line_program.js b/src/render/program/line_program.js index 7b01970fc20..6e2bd364d07 100644 --- a/src/render/program/line_program.js +++ b/src/render/program/line_program.js @@ -42,6 +42,8 @@ export type LinePatternUniformsType = {| 'u_fade': Uniform1f |}; +export type LineDefinesType = 'RENDER_LINE_GRADIENT' | 'RENDER_LINE_DASH'; + const lineUniforms = (context: Context, locations: UniformLocations): LineUniformsType => ({ 'u_matrix': new UniformMatrix4f(context, locations.u_matrix), 'u_ratio': new Uniform1f(context, locations.u_ratio), @@ -86,8 +88,8 @@ const lineUniformValues = ( 'u_dash_image': 0, 'u_gradient_image': 1, 'u_image_height': imageHeight, - 'u_texsize': 0, - 'u_scale': [], + 'u_texsize': [0, 0], + 'u_scale': [0, 0, 0], 'u_mix': 0 }; if (layer.paint.get('line-dasharray').value.value) { diff --git a/src/render/program/program_uniforms.js b/src/render/program/program_uniforms.js index 9e7c78ec643..c97a369aa4c 100644 --- a/src/render/program/program_uniforms.js +++ b/src/render/program/program_uniforms.js @@ -2,7 +2,7 @@ import type {CircleDefinesType} from './circle_program.js'; import type {SymbolDefinesType} from './symbol_program.js'; -import type {LineDefineTypes} from './line_program.js'; +import type {LineDefinesType} from './line_program.js'; import {fillExtrusionUniforms, fillExtrusionPatternUniforms} from './fill_extrusion_program.js'; import {fillUniforms, fillPatternUniforms, fillOutlineUniforms, fillOutlinePatternUniforms} from './fill_program.js'; import {circleUniforms} from './circle_program.js'; @@ -19,7 +19,7 @@ import {terrainRasterUniforms} from '../../terrain/terrain_raster_program.js'; import {skyboxUniforms, skyboxGradientUniforms} from './skybox_program.js'; import {skyboxCaptureUniforms} from './skybox_capture_program.js'; -export type DynamicDefinesType = CircleDefinesType | SymbolDefinesType | LineDefineTypes; +export type DynamicDefinesType = CircleDefinesType | SymbolDefinesType | LineDefinesType; export const programUniforms = { fillExtrusion: fillExtrusionUniforms,