Skip to content

Commit

Permalink
Drop v suffix from Uniform* names
Browse files Browse the repository at this point in the history
  • Loading branch information
jfirebaugh authored and Anand Thakker committed Aug 8, 2018
1 parent 1a9cfd7 commit 4c843a7
Show file tree
Hide file tree
Showing 15 changed files with 239 additions and 239 deletions.
48 changes: 24 additions & 24 deletions src/render/program/background_program.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { patternUniformValues } from './pattern';
import {
Uniform1i,
Uniform1f,
Uniform2fv,
Uniform2f,
UniformColor,
UniformMatrix4fv
UniformMatrix4f
} from '../uniform_binding';
import { extend } from '../../util/util';

Expand All @@ -18,53 +18,53 @@ import type {CrossFaded} from '../../style/cross_faded';
import type {OverscaledTileID} from '../../source/tile_id';

export type BackgroundUniformsType = {|
'u_matrix': UniformMatrix4fv,
'u_matrix': UniformMatrix4f,
'u_opacity': Uniform1f,
'u_color': UniformColor
|};

export type BackgroundPatternUniformsType = {|
'u_matrix': UniformMatrix4fv,
'u_matrix': UniformMatrix4f,
'u_opacity': Uniform1f,
// pattern uniforms:
'u_image': Uniform1i,
'u_pattern_tl_a': Uniform2fv,
'u_pattern_br_a': Uniform2fv,
'u_pattern_tl_b': Uniform2fv,
'u_pattern_br_b': Uniform2fv,
'u_texsize': Uniform2fv,
'u_pattern_tl_a': Uniform2f,
'u_pattern_br_a': Uniform2f,
'u_pattern_tl_b': Uniform2f,
'u_pattern_br_b': Uniform2f,
'u_texsize': Uniform2f,
'u_mix': Uniform1f,
'u_pattern_size_a': Uniform2fv,
'u_pattern_size_b': Uniform2fv,
'u_pattern_size_a': Uniform2f,
'u_pattern_size_b': Uniform2f,
'u_scale_a': Uniform1f,
'u_scale_b': Uniform1f,
'u_pixel_coord_upper': Uniform2fv,
'u_pixel_coord_lower': Uniform2fv,
'u_pixel_coord_upper': Uniform2f,
'u_pixel_coord_lower': Uniform2f,
'u_tile_units_to_pixels': Uniform1f
|};

const backgroundUniforms = (context: Context, locations: UniformLocations): BackgroundUniformsType => ({
'u_matrix': new UniformMatrix4fv(context, locations.u_matrix),
'u_matrix': new UniformMatrix4f(context, locations.u_matrix),
'u_opacity': new Uniform1f(context, locations.u_opacity),
'u_color': new UniformColor(context, locations.u_color)
});

const backgroundPatternUniforms = (context: Context, locations: UniformLocations): BackgroundPatternUniformsType => ({
'u_matrix': new UniformMatrix4fv(context, locations.u_matrix),
'u_matrix': new UniformMatrix4f(context, locations.u_matrix),
'u_opacity': new Uniform1f(context, locations.u_opacity),
'u_image': new Uniform1i(context, locations.u_image),
'u_pattern_tl_a': new Uniform2fv(context, locations.u_pattern_tl_a),
'u_pattern_br_a': new Uniform2fv(context, locations.u_pattern_br_a),
'u_pattern_tl_b': new Uniform2fv(context, locations.u_pattern_tl_b),
'u_pattern_br_b': new Uniform2fv(context, locations.u_pattern_br_b),
'u_texsize': new Uniform2fv(context, locations.u_texsize),
'u_pattern_tl_a': new Uniform2f(context, locations.u_pattern_tl_a),
'u_pattern_br_a': new Uniform2f(context, locations.u_pattern_br_a),
'u_pattern_tl_b': new Uniform2f(context, locations.u_pattern_tl_b),
'u_pattern_br_b': new Uniform2f(context, locations.u_pattern_br_b),
'u_texsize': new Uniform2f(context, locations.u_texsize),
'u_mix': new Uniform1f(context, locations.u_mix),
'u_pattern_size_a': new Uniform2fv(context, locations.u_pattern_size_a),
'u_pattern_size_b': new Uniform2fv(context, locations.u_pattern_size_b),
'u_pattern_size_a': new Uniform2f(context, locations.u_pattern_size_a),
'u_pattern_size_b': new Uniform2f(context, locations.u_pattern_size_b),
'u_scale_a': new Uniform1f(context, locations.u_scale_a),
'u_scale_b': new Uniform1f(context, locations.u_scale_b),
'u_pixel_coord_upper': new Uniform2fv(context, locations.u_pixel_coord_upper),
'u_pixel_coord_lower': new Uniform2fv(context, locations.u_pixel_coord_lower),
'u_pixel_coord_upper': new Uniform2f(context, locations.u_pixel_coord_upper),
'u_pixel_coord_lower': new Uniform2f(context, locations.u_pixel_coord_lower),
'u_tile_units_to_pixels': new Uniform1f(context, locations.u_tile_units_to_pixels)
});

Expand Down
12 changes: 6 additions & 6 deletions src/render/program/circle_program.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import {
Uniform1i,
Uniform1f,
Uniform2fv,
UniformMatrix4fv
Uniform2f,
UniformMatrix4f
} from '../uniform_binding';
import pixelsToTileUnits from '../../source/pixels_to_tile_units';

Expand All @@ -19,16 +19,16 @@ export type CircleUniformsType = {|
'u_camera_to_center_distance': Uniform1f,
'u_scale_with_map': Uniform1i,
'u_pitch_with_map': Uniform1i,
'u_extrude_scale': Uniform2fv,
'u_matrix': UniformMatrix4fv
'u_extrude_scale': Uniform2f,
'u_matrix': UniformMatrix4f
|};

const circleUniforms = (context: Context, locations: UniformLocations): CircleUniformsType => ({
'u_camera_to_center_distance': new Uniform1f(context, locations.u_camera_to_center_distance),
'u_scale_with_map': new Uniform1i(context, locations.u_scale_with_map),
'u_pitch_with_map': new Uniform1i(context, locations.u_pitch_with_map),
'u_extrude_scale': new Uniform2fv(context, locations.u_extrude_scale),
'u_matrix': new UniformMatrix4fv(context, locations.u_matrix)
'u_extrude_scale': new Uniform2f(context, locations.u_extrude_scale),
'u_matrix': new UniformMatrix4f(context, locations.u_matrix)
});

const circleUniformValues = (
Expand Down
6 changes: 3 additions & 3 deletions src/render/program/clipping_mask_program.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
// @flow

import { UniformMatrix4fv } from '../uniform_binding';
import { UniformMatrix4f } from '../uniform_binding';

import type Context from '../../gl/context';
import type {UniformValues, UniformLocations} from '../uniform_binding';

export type ClippingMaskUniformsType = {|
'u_matrix': UniformMatrix4fv
'u_matrix': UniformMatrix4f
|};

const clippingMaskUniforms = (context: Context, locations: UniformLocations): ClippingMaskUniformsType => ({
'u_matrix': new UniformMatrix4fv(context, locations.u_matrix)
'u_matrix': new UniformMatrix4f(context, locations.u_matrix)
});

const clippingMaskUniformValues = (matrix: Float32Array): UniformValues<ClippingMaskUniformsType> => ({
Expand Down
12 changes: 6 additions & 6 deletions src/render/program/collision_program.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import {
Uniform1f,
Uniform2fv,
UniformMatrix4fv
Uniform2f,
UniformMatrix4f
} from '../uniform_binding';
import pixelsToTileUnits from '../../source/pixels_to_tile_units';

Expand All @@ -13,18 +13,18 @@ import type Transform from '../../geo/transform';
import type Tile from '../../source/tile';

export type CollisionUniformsType = {|
'u_matrix': UniformMatrix4fv,
'u_matrix': UniformMatrix4f,
'u_camera_to_center_distance': Uniform1f,
'u_pixels_to_tile_units': Uniform1f,
'u_extrude_scale': Uniform2fv,
'u_extrude_scale': Uniform2f,
'u_overscale_factor': Uniform1f
|};

const collisionUniforms = (context: Context, locations: UniformLocations): CollisionUniformsType => ({
'u_matrix': new UniformMatrix4fv(context, locations.u_matrix),
'u_matrix': new UniformMatrix4f(context, locations.u_matrix),
'u_camera_to_center_distance': new Uniform1f(context, locations.u_camera_to_center_distance),
'u_pixels_to_tile_units': new Uniform1f(context, locations.u_pixels_to_tile_units),
'u_extrude_scale': new Uniform2fv(context, locations.u_extrude_scale),
'u_extrude_scale': new Uniform2f(context, locations.u_extrude_scale),
'u_overscale_factor': new Uniform1f(context, locations.u_overscale_factor)
});

Expand Down
6 changes: 3 additions & 3 deletions src/render/program/debug_program.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import {
UniformColor,
UniformMatrix4fv
UniformMatrix4f
} from '../uniform_binding';

import type Context from '../../gl/context';
Expand All @@ -11,12 +11,12 @@ import type Color from '../../style-spec/util/color';

export type DebugUniformsType = {|
'u_color': UniformColor,
'u_matrix': UniformMatrix4fv
'u_matrix': UniformMatrix4f
|};

const debugUniforms = (context: Context, locations: UniformLocations): DebugUniformsType => ({
'u_color': new UniformColor(context, locations.u_color),
'u_matrix': new UniformMatrix4fv(context, locations.u_matrix)
'u_matrix': new UniformMatrix4f(context, locations.u_matrix)
});

const debugUniformValues = (matrix: Float32Array, color: Color): UniformValues<DebugUniformsType> => ({
Expand Down
74 changes: 37 additions & 37 deletions src/render/program/fill_extrusion_program.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { patternUniformValues } from './pattern';
import {
Uniform1i,
Uniform1f,
Uniform2fv,
Uniform3fv,
UniformMatrix4fv
Uniform2f,
Uniform3f,
UniformMatrix4f
} from '../uniform_binding';

import {mat3, vec3, mat4} from 'gl-matrix';
Expand All @@ -20,74 +20,74 @@ import type {UniformValues, UniformLocations} from '../uniform_binding';
import type FillExtrusionStyleLayer from '../../style/style_layer/fill_extrusion_style_layer';

export type FillExtrusionUniformsType = {|
'u_matrix': UniformMatrix4fv,
'u_lightpos': Uniform3fv,
'u_matrix': UniformMatrix4f,
'u_lightpos': Uniform3f,
'u_lightintensity': Uniform1f,
'u_lightcolor': Uniform3fv
'u_lightcolor': Uniform3f
|};

export type FillExtrusionPatternUniformsType = {|
'u_matrix': UniformMatrix4fv,
'u_lightpos': Uniform3fv,
'u_matrix': UniformMatrix4f,
'u_lightpos': Uniform3f,
'u_lightintensity': Uniform1f,
'u_lightcolor': Uniform3fv,
'u_lightcolor': Uniform3f,
'u_height_factor': Uniform1f,
// pattern uniforms:
'u_image': Uniform1i,
'u_pattern_tl_a': Uniform2fv,
'u_pattern_br_a': Uniform2fv,
'u_pattern_tl_b': Uniform2fv,
'u_pattern_br_b': Uniform2fv,
'u_texsize': Uniform2fv,
'u_pattern_tl_a': Uniform2f,
'u_pattern_br_a': Uniform2f,
'u_pattern_tl_b': Uniform2f,
'u_pattern_br_b': Uniform2f,
'u_texsize': Uniform2f,
'u_mix': Uniform1f,
'u_pattern_size_a': Uniform2fv,
'u_pattern_size_b': Uniform2fv,
'u_pattern_size_a': Uniform2f,
'u_pattern_size_b': Uniform2f,
'u_scale_a': Uniform1f,
'u_scale_b': Uniform1f,
'u_pixel_coord_upper': Uniform2fv,
'u_pixel_coord_lower': Uniform2fv,
'u_pixel_coord_upper': Uniform2f,
'u_pixel_coord_lower': Uniform2f,
'u_tile_units_to_pixels': Uniform1f
|};

export type ExtrusionTextureUniformsType = {|
'u_matrix': UniformMatrix4fv,
'u_world': Uniform2fv,
'u_matrix': UniformMatrix4f,
'u_world': Uniform2f,
'u_image': Uniform1i,
'u_opacity': Uniform1f
|};

const fillExtrusionUniforms = (context: Context, locations: UniformLocations): FillExtrusionUniformsType => ({
'u_matrix': new UniformMatrix4fv(context, locations.u_matrix),
'u_lightpos': new Uniform3fv(context, locations.u_lightpos),
'u_matrix': new UniformMatrix4f(context, locations.u_matrix),
'u_lightpos': new Uniform3f(context, locations.u_lightpos),
'u_lightintensity': new Uniform1f(context, locations.u_lightintensity),
'u_lightcolor': new Uniform3fv(context, locations.u_lightcolor)
'u_lightcolor': new Uniform3f(context, locations.u_lightcolor)
});

const fillExtrusionPatternUniforms = (context: Context, locations: UniformLocations): FillExtrusionPatternUniformsType => ({
'u_matrix': new UniformMatrix4fv(context, locations.u_matrix),
'u_lightpos': new Uniform3fv(context, locations.u_lightpos),
'u_matrix': new UniformMatrix4f(context, locations.u_matrix),
'u_lightpos': new Uniform3f(context, locations.u_lightpos),
'u_lightintensity': new Uniform1f(context, locations.u_lightintensity),
'u_lightcolor': new Uniform3fv(context, locations.u_lightcolor),
'u_lightcolor': new Uniform3f(context, locations.u_lightcolor),
'u_height_factor': new Uniform1f(context, locations.u_height_factor),
'u_image': new Uniform1i(context, locations.u_image),
'u_pattern_tl_a': new Uniform2fv(context, locations.u_pattern_tl_a),
'u_pattern_br_a': new Uniform2fv(context, locations.u_pattern_br_a),
'u_pattern_tl_b': new Uniform2fv(context, locations.u_pattern_tl_b),
'u_pattern_br_b': new Uniform2fv(context, locations.u_pattern_br_b),
'u_texsize': new Uniform2fv(context, locations.u_texsize),
'u_pattern_tl_a': new Uniform2f(context, locations.u_pattern_tl_a),
'u_pattern_br_a': new Uniform2f(context, locations.u_pattern_br_a),
'u_pattern_tl_b': new Uniform2f(context, locations.u_pattern_tl_b),
'u_pattern_br_b': new Uniform2f(context, locations.u_pattern_br_b),
'u_texsize': new Uniform2f(context, locations.u_texsize),
'u_mix': new Uniform1f(context, locations.u_mix),
'u_pattern_size_a': new Uniform2fv(context, locations.u_pattern_size_a),
'u_pattern_size_b': new Uniform2fv(context, locations.u_pattern_size_b),
'u_pattern_size_a': new Uniform2f(context, locations.u_pattern_size_a),
'u_pattern_size_b': new Uniform2f(context, locations.u_pattern_size_b),
'u_scale_a': new Uniform1f(context, locations.u_scale_a),
'u_scale_b': new Uniform1f(context, locations.u_scale_b),
'u_pixel_coord_upper': new Uniform2fv(context, locations.u_pixel_coord_upper),
'u_pixel_coord_lower': new Uniform2fv(context, locations.u_pixel_coord_lower),
'u_pixel_coord_upper': new Uniform2f(context, locations.u_pixel_coord_upper),
'u_pixel_coord_lower': new Uniform2f(context, locations.u_pixel_coord_lower),
'u_tile_units_to_pixels': new Uniform1f(context, locations.u_tile_units_to_pixels)
});

const extrusionTextureUniforms = (context: Context, locations: UniformLocations): ExtrusionTextureUniformsType => ({
'u_matrix': new UniformMatrix4fv(context, locations.u_matrix),
'u_world': new Uniform2fv(context, locations.u_world),
'u_matrix': new UniformMatrix4f(context, locations.u_matrix),
'u_world': new Uniform2f(context, locations.u_world),
'u_image': new Uniform1i(context, locations.u_image),
'u_opacity': new Uniform1f(context, locations.u_opacity)
});
Expand Down
Loading

0 comments on commit 4c843a7

Please sign in to comment.