diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2016-11-03 12:07:13 +0100 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2016-11-07 18:51:47 +0100 |
commit | bd3d4bc89a7ce072a32782f2113ef5d838a7913c (patch) | |
tree | 4be6bb340ed22a5d90b74cf56114d7cc00236e01 /src/mbgl/renderer/painter_raster.cpp | |
parent | ed72581e0c9a1f42dda2d659a1596de20201ce3e (diff) | |
download | qtlocation-mapboxgl-bd3d4bc89a7ce072a32782f2113ef5d838a7913c.tar.gz |
[core] force explicit initialization of uniform values
force users to use the actual names to avoid implicit conversion accidentally targeting the wrong shader
Diffstat (limited to 'src/mbgl/renderer/painter_raster.cpp')
-rw-r--r-- | src/mbgl/renderer/painter_raster.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/mbgl/renderer/painter_raster.cpp b/src/mbgl/renderer/painter_raster.cpp index 441bca9dc8..6acd29eb37 100644 --- a/src/mbgl/renderer/painter_raster.cpp +++ b/src/mbgl/renderer/painter_raster.cpp @@ -60,19 +60,19 @@ void Painter::renderRaster(PaintParameters& parameters, colorModeForRenderPass(), parameters.shaders.raster, RasterUniforms::Values { - tile.matrix, - 0, - 1, - properties.rasterOpacity.value, - 0, - properties.rasterBrightnessMin.value, - properties.rasterBrightnessMax.value, - saturationFactor(properties.rasterSaturation.value), - contrastFactor(properties.rasterContrast.value), - spinWeights(properties.rasterHueRotate.value), - 1.0f, - 1.0f, - std::array<float, 2> {{ 0.0f, 0.0f }} + uniforms::u_matrix::Value{ tile.matrix }, + uniforms::u_image0::Value{ 0 }, + uniforms::u_image1::Value{ 1 }, + uniforms::u_opacity0::Value{ properties.rasterOpacity.value }, + uniforms::u_opacity1::Value{ 0 }, + uniforms::u_brightness_low::Value{ properties.rasterBrightnessMin.value }, + uniforms::u_brightness_high::Value{ properties.rasterBrightnessMax.value }, + uniforms::u_saturation_factor::Value{ saturationFactor(properties.rasterSaturation.value) }, + uniforms::u_contrast_factor::Value{ contrastFactor(properties.rasterContrast.value) }, + uniforms::u_spin_weights::Value{ spinWeights(properties.rasterHueRotate.value) }, + uniforms::u_buffer_scale::Value{ 1.0f }, + uniforms::u_scale_parent::Value{ 1.0f }, + uniforms::u_tl_parent::Value{ std::array<float, 2> {{ 0.0f, 0.0f }} }, }, gl::Unindexed<gl::TriangleStrip>(rasterVertexBuffer) }); |