mirror of
https://github.com/odin-lang/Odin.git
synced 2026-04-19 21:10:30 +00:00
Fix storeInt call in webgl glue code
This commit is contained in:
10
vendor/wasm/WebGL/runtime.js
vendored
10
vendor/wasm/WebGL/runtime.js
vendored
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user