Skip to content

Commit

Permalink
Fix shader compilation failure in IE11.
Browse files Browse the repository at this point in the history
Fixes #2358

A function needed only in 2D mode was not being included in 3D.  Other
browsers were ok with this because the functions that called the missing
one were never called, but IE had a problem with it.
  • Loading branch information
kring committed Dec 30, 2014
1 parent dc514fd commit a29b0ac
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions Source/Scene/GlobeSurfaceShaderSet.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,21 +155,19 @@ define([

vs.sources.push(getPositionMode);

if (sceneMode !== SceneMode.SCENE3D) {
var get2DYPositionFractionGeographicProjection = 'float get2DYPositionFraction() { return get2DGeographicYPositionFraction(); }';
var get2DYPositionFractionMercatorProjection = 'float get2DYPositionFraction() { return get2DMercatorYPositionFraction(); }';
var get2DYPositionFractionGeographicProjection = 'float get2DYPositionFraction() { return get2DGeographicYPositionFraction(); }';
var get2DYPositionFractionMercatorProjection = 'float get2DYPositionFraction() { return get2DMercatorYPositionFraction(); }';

var get2DYPositionFraction;
var get2DYPositionFraction;

if (useWebMercatorProjection) {
get2DYPositionFraction = get2DYPositionFractionMercatorProjection;
} else {
get2DYPositionFraction = get2DYPositionFractionGeographicProjection;
}

vs.sources.push(get2DYPositionFraction);
if (useWebMercatorProjection) {
get2DYPositionFraction = get2DYPositionFractionMercatorProjection;
} else {
get2DYPositionFraction = get2DYPositionFractionGeographicProjection;
}

vs.sources.push(get2DYPositionFraction);

var shader = context.createShaderProgram(vs, fs, this._attributeLocations);
surfaceShader = shadersByFlags[flags] = new GlobeSurfaceShader(numberOfDayTextures, flags, shader);
}
Expand Down

0 comments on commit a29b0ac

Please sign in to comment.