Skip to content

Commit

Permalink
Fixes review changes requests for PR #1377
Browse files Browse the repository at this point in the history
  • Loading branch information
jacomyal committed Oct 4, 2023
1 parent 699fc58 commit 6b27c92
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
7 changes: 4 additions & 3 deletions src/rendering/webgl/programs/common/program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export abstract class Program<Uniform extends string = string> implements Abstra
`Program: error while getting constant data (one vector has ${vector.length} items instead of ${constantAttributesItemsCount})`,
);

constantData.push(...vector);
for (let j = 0; j < vector.length; j++) constantData.push(vector[j]);
}

this.STRIDE = this.ATTRIBUTES_ITEMS_COUNT;
Expand Down Expand Up @@ -224,12 +224,13 @@ export abstract class Program<Uniform extends string = string> implements Abstra
gl.vertexAttribDivisor(location, 1);
} else {
const ext = gl.getExtension("ANGLE_instanced_arrays");
if (ext) ext.vertexAttribDivisorANGLE(location, 1);
if (!ext) throw new Error(`Program.bind: cannot retrieve WebGL extension "ANGLE_instanced_arrays"`);
ext.vertexAttribDivisorANGLE(location, 1);
}
}

const sizeFactor = SIZE_FACTOR_PER_ATTRIBUTE_TYPE[attr.type];
if (typeof sizeFactor !== "number") throw new Error(`Program.bind: yet unsupported attribute type "${attr.type}"!`);
if (typeof sizeFactor !== "number") throw new Error(`Program.bind: yet unsupported attribute type "${attr.type}"`);

return attr.size * sizeFactor;
}
Expand Down
9 changes: 0 additions & 9 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -430,15 +430,6 @@ export function extractPixel(gl: WebGLRenderingContext, x: number, y: number, ar
return data;
}

/**
* Function used to know whether given webgl context can use 32 bits indices.
*/
export function canUse32BitsIndices(gl: WebGLRenderingContext): boolean {
const webgl2 = typeof WebGL2RenderingContext !== "undefined" && gl instanceof WebGL2RenderingContext;

return webgl2 || !!gl.getExtension("OES_element_index_uint");
}

/**
* Check if the graph variable is a valid graph, and if sigma can render it.
*/
Expand Down

0 comments on commit 6b27c92

Please sign in to comment.