diff --git a/.gitignore b/.gitignore index 070094f9..03c3e8dc 100644 --- a/.gitignore +++ b/.gitignore @@ -18,4 +18,5 @@ npm-debug.log # Misc deploy_key -deploy_key.pub \ No newline at end of file +deploy_key.pub +.vscode/settings.json diff --git a/lib/aglsl/AGALTokenizer.ts b/lib/aglsl/AGALTokenizer.ts index 52c1f2a4..1f9e0a5d 100644 --- a/lib/aglsl/AGALTokenizer.ts +++ b/lib/aglsl/AGALTokenizer.ts @@ -12,17 +12,16 @@ export class AGALTokenizer { } public decribeAGALPart(array: ByteArray | Part): Description { - if (array instanceof ByteArray) { + if (array instanceof Part) { + const desc = this.decribeAGALByteArray(array.data); + desc.native = array.native; + return desc; + } else return this.decribeAGALByteArray(array); - } - - const desc = this.decribeAGALByteArray(array.data); - desc.native = array.native; - - return desc; } public decribeAGALByteArray(bytes: ByteArray): Description { + bytes.position = 0; const header: Header = new Header(); if (bytes.readUnsignedByte() != 0xa0) { diff --git a/lib/base/ContextGLProfile.ts b/lib/base/ContextGLProfile.ts index 776ee8b0..593e4b87 100644 --- a/lib/base/ContextGLProfile.ts +++ b/lib/base/ContextGLProfile.ts @@ -2,5 +2,9 @@ export enum ContextGLProfile { BASELINE, BASELINE_CONSTRAINED, - BASELINE_EXTENDED + BASELINE_EXTENDED, + STANDARD, + STANDARD_CONSTRAINED, + STANDARD_EXTENDED, + ENHANCED } \ No newline at end of file diff --git a/lib/webgl/ContextWebGL.ts b/lib/webgl/ContextWebGL.ts index 51e240e9..2a3ac492 100644 --- a/lib/webgl/ContextWebGL.ts +++ b/lib/webgl/ContextWebGL.ts @@ -744,11 +744,11 @@ export class ContextWebGL implements IContextGL { } public setVertexBufferAt( - index: number, buffer: VertexBufferWebGL, bufferOffset: number = 0, format: number = 4 + index: number, buffer: VertexBufferWebGL, bufferOffset: number = 0, format: number = 4, safeAttributeLocation:boolean = true ): void { this.stateChangeCallback && this.stateChangeCallback('setVertexBufferAt'); - - const location = this._currentProgram ? this._currentProgram.getAttribLocation(index) : -1; + + const location = safeAttributeLocation ? this._currentProgram ? this._currentProgram.getAttribLocation(index) : -1 : index; const gl = this._gl; // when we try bind any buffers without VAO we should unbound VAO