Skip to content

Commit

Permalink
Merge pull request #1834 from AnalyticalGraphicsInc/hardwareConcurrency
Browse files Browse the repository at this point in the history
Add FeatureDetection.hardwareConcurrency
  • Loading branch information
pjcozzi committed Jun 17, 2014
2 parents 9d6e5e9 + 44288f7 commit 1cc6abe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion Source/Core/FeatureDetection.js
@@ -1,8 +1,10 @@
/*global define*/
define([
'./defaultValue',
'./defined',
'./Fullscreen'
], function(
defaultValue,
defined,
Fullscreen) {
"use strict";
Expand Down Expand Up @@ -123,7 +125,8 @@ define([
isWebkit : isWebkit,
webkitVersion : webkitVersion,
isInternetExplorer : isInternetExplorer,
internetExplorerVersion : internetExplorerVersion
internetExplorerVersion : internetExplorerVersion,
hardwareConcurrency : defaultValue(navigator.hardwareConcurrency, 3)
};

/**
Expand Down
4 changes: 3 additions & 1 deletion Source/Scene/Primitive.js
Expand Up @@ -8,6 +8,7 @@ define([
'../Core/defineProperties',
'../Core/destroyObject',
'../Core/DeveloperError',
'../Core/FeatureDetection',
'../Core/Geometry',
'../Core/GeometryAttribute',
'../Core/GeometryAttributes',
Expand Down Expand Up @@ -35,6 +36,7 @@ define([
defineProperties,
destroyObject,
DeveloperError,
FeatureDetection,
Geometry,
GeometryAttribute,
GeometryAttributes,
Expand Down Expand Up @@ -565,7 +567,7 @@ define([
return pickColors;
}

var numberOfCreationWorkers = 3;
var numberOfCreationWorkers = Math.max(FeatureDetection.hardwareConcurrency - 1, 1);
var createGeometryTaskProcessors;
var combineGeometryTaskProcessor = new TaskProcessor('combineGeometry', Number.POSITIVE_INFINITY);

Expand Down

0 comments on commit 1cc6abe

Please sign in to comment.