Skip to content

Commit

Permalink
Add support for Integer attributes (#12830)
Browse files Browse the repository at this point in the history
* fix native sprites

* Babylon Native Sprites

* Add support for vertexAttribIPointer
  • Loading branch information
sebavan authored Aug 3, 2022
1 parent e15d49e commit b5b357c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/dev/core/src/Engines/thinEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2239,7 +2239,11 @@ export class ThinEngine {

if (changed || this._vaoRecordInProgress) {
this.bindArrayBuffer(buffer);
this._gl.vertexAttribPointer(indx, size, type, normalized, stride, offset);
if (type === this._gl.UNSIGNED_INT || type === this._gl.INT) {
this._gl.vertexAttribIPointer(indx, size, type, stride, offset);
} else {
this._gl.vertexAttribPointer(indx, size, type, normalized, stride, offset);
}
}
}

Expand Down
2 changes: 2 additions & 0 deletions packages/dev/core/src/LibDeclarations/webgl2.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ interface WebGLRenderingContext {
clearBufferiv(buffer: number, drawbuffer: number, values: ArrayBufferView, srcOffset: number | null): void;
clearBufferuiv(buffer: number, drawbuffer: number, values: ArrayBufferView, srcOffset: number | null): void;
clearBufferfi(buffer: number, drawbuffer: number, depth: number, stencil: number): void;

vertexAttribIPointer(index: number, size: number, type: number, stride: number, offset: number): void;
}

interface ImageBitmap {
Expand Down

0 comments on commit b5b357c

Please sign in to comment.