Skip to content

Commit

Permalink
Fixes for vao instanced bind (#128)
Browse files Browse the repository at this point in the history
* Unified Buffer's and BufferChannel's bind method

* 0.13.3
  • Loading branch information
EvgenyRodygin authored Mar 13, 2023
1 parent 749bcc3 commit 4ef7658
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ declare module '2gl' {

export class BufferChannel {
constructor(buffer: Buffer, options: Partial<BufferBindOptions>);
public bind(gl: WebGLRenderingContext, location?: number): this;
public bind(gl: WebGLRenderingContext, location?: number, options?: BufferBindOptions, instancesExt?: ANGLE_instanced_arrays): this;
}

export interface TextureOptions {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "2gl",
"version": "0.13.2",
"version": "0.13.3",
"description": "WebGL library for 2GIS projects",
"repository": {
"type": "git",
Expand Down
4 changes: 2 additions & 2 deletions src/BufferChannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ class BufferChannel {
* Связывает данные с контекстом WebGL с нужными параметрами.
* Вызывает {@link Buffer#bind} исходного буфера.
*/
bind(gl, location, instancesExt) {
this._buffer.bind(gl, location, this.options, instancesExt);
bind(gl, location, options, instancesExt) {
this._buffer.bind(gl, location, options || this.options, instancesExt);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Vao.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class Vao {
if (shaderAttribute.index !== true) {
gl.enableVertexAttribArray(shaderAttribute.location);
}
attributes[name].bind(gl, shaderAttribute.location, instancesExt);
attributes[name].bind(gl, shaderAttribute.location, null, instancesExt);
}
if (this.indicesBuffer) {
this.indicesBuffer.bind(gl);
Expand Down

0 comments on commit 4ef7658

Please sign in to comment.