Skip to content

Commit

Permalink
Make functions local, as per review comment...
Browse files Browse the repository at this point in the history
  • Loading branch information
javagl committed Sep 27, 2024
1 parent 651a2b2 commit a7a0ece
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions packages/engine/Source/Scene/Model/ModelDrawCommands.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ ModelDrawCommands.buildModelDrawCommand = function (
frameState
) {
const shaderBuilder = primitiveRenderResources.shaderBuilder;
const shaderProgram = ModelDrawCommands.createShaderProgram(
const shaderProgram = createShaderProgram(
primitiveRenderResources,
shaderBuilder,
frameState
);

const command = ModelDrawCommands.buildDrawCommandForModel(
const command = buildDrawCommandForModel(
primitiveRenderResources,
shaderProgram,
frameState
Expand All @@ -70,7 +70,7 @@ ModelDrawCommands.buildModelDrawCommand = function (
/**
* @private
*/
ModelDrawCommands.createShaderProgram = function (
function createShaderProgram(
primitiveRenderResources,
shaderBuilder,
frameState
Expand All @@ -82,7 +82,7 @@ ModelDrawCommands.createShaderProgram = function (
const shaderProgram = shaderBuilder.buildShaderProgram(frameState.context);
model._pipelineResources.push(shaderProgram);
return shaderProgram;
};
}

/**
* Builds the {@link DrawCommand} that serves as the basis for either creating
Expand All @@ -97,14 +97,12 @@ ModelDrawCommands.createShaderProgram = function (
*
* @private
*/
ModelDrawCommands.buildDrawCommandForModel = function (
function buildDrawCommandForModel(
primitiveRenderResources,
shaderProgram,
frameState
) {
const indexBuffer = ModelDrawCommands.getIndexBuffer(
primitiveRenderResources
);
const indexBuffer = getIndexBuffer(primitiveRenderResources);

const vertexArray = new VertexArray({
context: frameState.context,
Expand Down Expand Up @@ -192,12 +190,12 @@ ModelDrawCommands.buildDrawCommandForModel = function (
receiveShadows: receiveShadows,
});
return command;
};
}

/**
* @private
*/
ModelDrawCommands.getIndexBuffer = function (primitiveRenderResources) {
function getIndexBuffer(primitiveRenderResources) {
const wireframeIndexBuffer = primitiveRenderResources.wireframeIndexBuffer;
if (defined(wireframeIndexBuffer)) {
return wireframeIndexBuffer;
Expand All @@ -215,6 +213,6 @@ ModelDrawCommands.getIndexBuffer = function (primitiveRenderResources) {
//>>includeEnd('debug');

return indices.buffer;
};
}

export default ModelDrawCommands;

0 comments on commit a7a0ece

Please sign in to comment.