From 3ac3568b26f11b06c470fef3392ee1c321fc1922 Mon Sep 17 00:00:00 2001 From: Dan Bagnell Date: Mon, 9 May 2016 15:26:42 -0400 Subject: [PATCH] Fix failing sun tests with WebGL validation on. --- Source/Scene/Sun.js | 2 +- Source/Scene/SunPostProcess.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Scene/Sun.js b/Source/Scene/Sun.js index 6837cc21e2db..628a4c233386 100644 --- a/Source/Scene/Sun.js +++ b/Source/Scene/Sun.js @@ -178,7 +178,7 @@ define([ this._glowFactorDirty = false; var size = Math.max(drawingBufferWidth, drawingBufferHeight); - size = Math.pow(2.0, Math.ceil(Math.log(size) / Math.log(2.0)) - 2.0); + size = Math.max(1.0, Math.pow(2.0, Math.ceil(Math.log(size) / Math.log(2.0)) - 2.0)); this._texture = new Texture({ context : context, diff --git a/Source/Scene/SunPostProcess.js b/Source/Scene/SunPostProcess.js index 1dd0304ef198..67b79a48f9f5 100644 --- a/Source/Scene/SunPostProcess.js +++ b/Source/Scene/SunPostProcess.js @@ -215,7 +215,7 @@ define([ var downSampleWidth = Math.pow(2.0, Math.ceil(Math.log(width) / Math.log(2)) - 2.0); var downSampleHeight = Math.pow(2.0, Math.ceil(Math.log(height) / Math.log(2)) - 2.0); - var downSampleSize = Math.max(downSampleWidth, downSampleHeight); + var downSampleSize = Math.max(1.0, Math.max(downSampleWidth, downSampleHeight)); var downSampleViewport = downSampleViewportBoundingRectangle; downSampleViewport.width = downSampleSize;