From 8b5062d6706e0afb3dad3a4e7b13d38f3c3ce69c Mon Sep 17 00:00:00 2001 From: Sean Lilley Date: Sun, 2 Jul 2017 20:11:25 -0400 Subject: [PATCH 1/2] Fix shader comparison --- lib/MergeDuplicateProperties.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/MergeDuplicateProperties.js b/lib/MergeDuplicateProperties.js index 849b7444..ad49072e 100644 --- a/lib/MergeDuplicateProperties.js +++ b/lib/MergeDuplicateProperties.js @@ -223,7 +223,7 @@ function shaderEquals(shaderOne, shaderTwo) { if (shaderOne.type !== shaderTwo.type) { return false; } - return shaderOne.extras._pipeline.source.equals(shaderTwo.extras._pipeline.source); + return shaderOne.extras._pipeline.source === shaderTwo.extras._pipeline.source; } /** From d20e08525215134434a51917c7efbde771b68fac Mon Sep 17 00:00:00 2001 From: Sean Lilley Date: Fri, 7 Jul 2017 13:26:14 -0400 Subject: [PATCH 2/2] Fix spec --- specs/lib/MergeDuplicatePropertiesSpec.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/specs/lib/MergeDuplicatePropertiesSpec.js b/specs/lib/MergeDuplicatePropertiesSpec.js index 187907dc..233971a7 100644 --- a/specs/lib/MergeDuplicatePropertiesSpec.js +++ b/specs/lib/MergeDuplicatePropertiesSpec.js @@ -139,8 +139,6 @@ describe('MergeDuplicateProperties', function() { var mergeShaders = MergeDuplicateProperties.mergeShaders; describe('mergeShaders', function() { - var testShaderBufferOne = Buffer.from('test shader one', 'utf8'); - var testShaderBufferTwo = Buffer.from('test shader two', 'utf8'); it('merges duplicate shaders', function() { var gltf = { programs : { @@ -158,7 +156,7 @@ describe('MergeDuplicateProperties', function() { type : WebGLConstants.VERTEX_SHADER, extras : { _pipeline : { - source : testShaderBufferOne + source : 'test shader one' } } }, @@ -166,7 +164,7 @@ describe('MergeDuplicateProperties', function() { type : WebGLConstants.FRAGMENT_SHADER, extras : { _pipeline : { - source : testShaderBufferOne + source : 'test shader one' } } }, @@ -174,7 +172,7 @@ describe('MergeDuplicateProperties', function() { type : WebGLConstants.VERTEX_SHADER, extras : { _pipeline : { - source : testShaderBufferTwo + source : 'test shader two' } } }, @@ -182,7 +180,7 @@ describe('MergeDuplicateProperties', function() { type : WebGLConstants.FRAGMENT_SHADER, extras : { _pipeline : { - source : testShaderBufferOne + source : 'test shader one' } } }