Skip to content

Commit

Permalink
Finish up uniformMatrix4fv
Browse files Browse the repository at this point in the history
  • Loading branch information
Fancy2209 committed Sep 16, 2024
1 parent 41f39fc commit 88209df
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
1 change: 0 additions & 1 deletion lib/aglsl/AGALTokenizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export class AGALTokenizer {
const desc: Description = new Description();
const tokens: Token[] = [];
while (bytes.position < bytes.length) {
console.log(bytes.position)
const token: Token = new Token();

token.opcode = bytes.readUnsignedInt();
Expand Down
19 changes: 17 additions & 2 deletions lib/webgl/ProgramWebGL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -357,9 +357,24 @@ export class ProgramWebGL implements IProgram {
this._gl.uniform4fv(location, value);
}

public uniformMatrix4fv(type: number, transpose: boolean, matrixRawData:Float32Array):void{
public uniformMatrix4fv(type: number, transpose: boolean, value:Float32Array):void{
const location = this.getUniformLocation(type)
this._gl.uniformMatrix4fv(location, transpose, matrixRawData)

if (!location) {
return;
}

if (Settings.ENABLE_UNIFORM_CACHE) {
const hash = this._needCache(type * 4, value);

// return undef hash if not require to uppload;
if (hash === void 0) {
return;
}
this._uniformCache[type * 4] = hash;
}

this._gl.uniformMatrix4fv(location, transpose, value)
}

public dispose(): void {
Expand Down

0 comments on commit 88209df

Please sign in to comment.