Skip to content

Commit 3e9ccc9

Browse files
authored
[Fix] Mini-stats uses 16bit index buffer insead of 32 (playcanvas#2347)
- makes it compatible with devices which dont support 32bit indices
1 parent ab55d86 commit 3e9ccc9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

extras/mini-stats/mini-stats.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function Render2d(device, maxQuads) {
4848
}]);
4949

5050
// generate quad indices
51-
var indices = new Uint32Array(maxQuads * 6);
51+
var indices = new Uint16Array(maxQuads * 6);
5252
for (var i = 0; i < maxQuads; ++i) {
5353
indices[i * 6 + 0] = i * 4;
5454
indices[i * 6 + 1] = i * 4 + 1;
@@ -66,7 +66,7 @@ function Render2d(device, maxQuads) {
6666
this.buffer = new pc.VertexBuffer(device, format, maxQuads * 4, pc.BUFFER_STREAM);
6767
this.data = new Float32Array(this.buffer.numBytes / 4);
6868

69-
this.indexBuffer = new pc.IndexBuffer(device, pc.INDEXFORMAT_UINT32, maxQuads * 6, pc.BUFFER_STATIC, indices);
69+
this.indexBuffer = new pc.IndexBuffer(device, pc.INDEXFORMAT_UINT16, maxQuads * 6, pc.BUFFER_STATIC, indices);
7070

7171
this.prims = [];
7272
this.prim = null;

0 commit comments

Comments
 (0)