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