Fix storeInt call in webgl glue code

This commit is contained in:
Rehkitzdev
2021-12-11 18:38:32 +01:00
parent 3257454209
commit b7c78da1fb

View File

@@ -416,7 +416,7 @@ class WebGLInterface {
log = log.substring(0, n);
this.mem.loadBytes(buf_ptr, buf_len).set(new TextEncoder("utf-8").encode(log))
storeInt(length_ptr, n);
this.mem.storeInt(length_ptr, n);
}
},
GetShaderInfoLog: (shader, buf_ptr, buf_len, length_ptr) => {
@@ -429,7 +429,7 @@ class WebGLInterface {
log = log.substring(0, n);
this.mem.loadBytes(buf_ptr, buf_len).set(new TextEncoder("utf-8").encode(log))
storeInt(length_ptr, n);
this.mem.storeInt(length_ptr, n);
}
},
GetShaderiv: (shader, pname, p) => {
@@ -439,11 +439,11 @@ class WebGLInterface {
if (log === null) {
log = "(unknown error)";
}
storeInt(p, log.length+1);
this.mem.storeInt(p, log.length+1);
} else if (pname == 35720) {
let source = this.ctx.getShaderSource(this.shaders[shader]);
let sourceLength = (source === null || source.length == 0) ? 0 : source.length+1;
storeInt(p, sourceLength);
this.mem.storeInt(p, sourceLength);
} else {
let param = this.ctx.getShaderParameter(this.shaders[shader], pname);
this.mem.storeI32(p, param);
@@ -994,7 +994,7 @@ class WebGLInterface {
let n = Math.min(buf_len, name.length);
name = name.substring(0, n);
this.mem.loadBytes(buf_ptr, buf_len).set(new TextEncoder("utf-8").encode(name))
storeInt(length_ptr, n);
this.mem.storeInt(length_ptr, n);
},
UniformBlockBinding: (program, uniformBlockIndex, uniformBlockBinding) => {
this.assertWebGL2();