Skip to content

Commit

Permalink
Merge a1f3329 into b49e863
Browse files Browse the repository at this point in the history
  • Loading branch information
tsherif committed Sep 20, 2019
2 parents b49e863 + a1f3329 commit 63caf39
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/core/src/resource-management/program-manager.js
Expand Up @@ -91,8 +91,8 @@ export default class ProgramManager {
}

for (const key of injectKeys) {
defineHashes.push(this._getHash(key));
defineHashes.push(this._getHash(inject[key]));
injectHashes.push(this._getHash(key));
injectHashes.push(this._getHash(inject[key]));
}

const hash = `${vsHash}/${fsHash}D${defineHashes.join('/')}M${moduleHashes.join(
Expand Down
18 changes: 18 additions & 0 deletions modules/core/test/lib/program-manager.spec.js
Expand Up @@ -212,6 +212,24 @@ test('ProgramManager#hooks', t => {
t.ok(injectVs.indexOf('color *= 0.1') > -1, 'argument injection code included in shader hook');
t.ok(injectFs.indexOf('color += 0.1') > -1, 'argument injection code included in shader hook');

const injectDefineProgram1 = pm.get({
vs,
fs,
inject: {
'vs:LUMAGL_pickColor': 'color *= 0.1;'
}
});

const injectDefineProgram2 = pm.get({
vs,
fs,
defines: {
'vs:LUMAGL_pickColor': 'color *= 0.1;'
}
});

t.ok(injectDefineProgram1 !== injectDefineProgram2, 'Injects and defines hashed separately.');

t.end();
});

Expand Down

0 comments on commit 63caf39

Please sign in to comment.