Skip to content

Commit 24244a5

Browse files
committed
Website updates
1 parent b06694d commit 24244a5

File tree

7 files changed

+34
-5
lines changed

7 files changed

+34
-5
lines changed

dist/en/main/examples/common.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/examples/common.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/ol/dist/ol.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/ol/dist/ol.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/ol/webgl/Helper.d.ts

+10
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,11 @@ declare class WebGLHelper extends Disposable {
358358
* @private
359359
*/
360360
private startTime_;
361+
/**
362+
* @type {number}
363+
* @private
364+
*/
365+
private maxAttributeCount_;
361366
/**
362367
* @param {Object<string, UniformValue>} uniforms Uniform definitions.
363368
*/
@@ -546,6 +551,11 @@ declare class WebGLHelper extends Disposable {
546551
* @param {Array<number>} value Matrix value
547552
*/
548553
setUniformMatrixValue(uniform: string, value: Array<number>): void;
554+
/**
555+
* Disable all vertex attributes.
556+
* @private
557+
*/
558+
private disableAllAttributes_;
549559
/**
550560
* Will set the currently bound buffer to an attribute of the shader program. Used by `#enableAttributes`
551561
* internally.

dist/en/main/ol/webgl/Helper.d.ts.map

+1-1
Original file line numberDiff line numberDiff line change

dist/en/main/ol/webgl/Helper.js

+19
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,14 @@ class WebGLHelper extends Disposable {
446446
* @private
447447
*/
448448
this.startTime_ = Date.now();
449+
450+
/**
451+
* @type {number}
452+
* @private
453+
*/
454+
this.maxAttributeCount_ = this.gl_.getParameter(
455+
this.gl_.MAX_VERTEX_ATTRIBS,
456+
);
449457
}
450458

451459
/**
@@ -894,6 +902,7 @@ class WebGLHelper extends Disposable {
894902
* @param {import("../Map.js").FrameState} [frameState] Frame state.
895903
*/
896904
useProgram(program, frameState) {
905+
this.disableAllAttributes_();
897906
const gl = this.gl_;
898907
gl.useProgram(program);
899908
this.currentProgram_ = program;
@@ -1065,6 +1074,16 @@ class WebGLHelper extends Disposable {
10651074
this.gl_.uniformMatrix4fv(this.getUniformLocation(uniform), false, value);
10661075
}
10671076

1077+
/**
1078+
* Disable all vertex attributes.
1079+
* @private
1080+
*/
1081+
disableAllAttributes_() {
1082+
for (let i = 0; i < this.maxAttributeCount_; i++) {
1083+
this.gl_.disableVertexAttribArray(i);
1084+
}
1085+
}
1086+
10681087
/**
10691088
* Will set the currently bound buffer to an attribute of the shader program. Used by `#enableAttributes`
10701089
* internally.

0 commit comments

Comments
 (0)