Webgl / remove handling of element_index_uint extension

From now on we will assume this extension is always enabled.

An error message have been added in the unlikely scenario of a lack
of support.
This commit is contained in:
Olivier Guyot
2019-06-05 14:36:02 +02:00
parent 87d5f4c8bc
commit 2412fe0211
9 changed files with 20 additions and 65 deletions
+1 -1
View File
@@ -89,7 +89,7 @@ describe('ol.renderer.webgl.Layer', function() {
beforeEach(function() {
vertexBuffer = new Float32Array(100);
indexBuffer = new Uint16Array(100);
indexBuffer = new Uint32Array(100);
instructions = new Float32Array(100);
elementIndex = 3;
-6
View File
@@ -2,7 +2,6 @@ import WebGLArrayBuffer, {getArrayClassForType} from '../../../../src/ol/webgl/B
import {
ARRAY_BUFFER,
ELEMENT_ARRAY_BUFFER,
EXTENSIONS as WEBGL_EXTENSIONS,
STATIC_DRAW,
STREAM_DRAW
} from '../../../../src/ol/webgl.js';
@@ -37,11 +36,6 @@ describe('ol.webgl.Buffer', function() {
expect(getArrayClassForType(ARRAY_BUFFER)).to.be(Float32Array);
expect(getArrayClassForType(ELEMENT_ARRAY_BUFFER)).to.be(Uint32Array);
});
it('returns the correct typed array constructor (without OES uint extension)', function() {
WEBGL_EXTENSIONS.length = 0;
expect(getArrayClassForType(ELEMENT_ARRAY_BUFFER)).to.be(Uint16Array);
});
});
describe('populate methods', function() {
-19
View File
@@ -45,25 +45,6 @@ describe('ol/worker/webgl', function() {
worker.postMessage(message);
});
it('responds with buffer data (fallback to Uint16Array)', function(done) {
worker.addEventListener('error', done);
worker.addEventListener('message', function(event) {
expect(event.data.indexBuffer).to.eql(Uint16Array.BYTES_PER_ELEMENT * 6);
done();
});
const instructions = new Float32Array(POINT_INSTRUCTIONS_COUNT);
const message = {
type: WebGLWorkerMessageType.GENERATE_BUFFERS,
renderInstructions: instructions,
useShortIndices: true
};
worker.postMessage(message);
});
});
});