Merge pull request #4931 from laytan/webgl-improvements

webgl: add `BlendEquationSeparate` and `GetParameter4i`
This commit is contained in:
gingerBill
2025-03-13 09:21:44 +00:00
committed by GitHub
3 changed files with 23 additions and 11 deletions
+10
View File
@@ -402,6 +402,9 @@ class WebGLInterface {
BlendEquation: (mode) => {
this.ctx.blendEquation(mode);
},
BlendEquationSeparate: (modeRGB, modeAlpha) => {
this.ctx.blendEquationSeparate(modeRGB, modeAlpha);
},
BlendFunc: (sfactor, dfactor) => {
this.ctx.blendFunc(sfactor, dfactor);
},
@@ -633,6 +636,13 @@ class WebGLInterface {
GetParameter: (pname) => {
return this.ctx.getParameter(pname);
},
GetParameter4i: (pname, v0, v1, v2, v3) => {
const i4 = this.ctx.getParameter(pname);
this.mem.storeI32(v0, i4[0]);
this.mem.storeI32(v1, i4[1]);
this.mem.storeI32(v2, i4[2]);
this.mem.storeI32(v3, i4[3]);
},
GetProgramParameter: (program, pname) => {
return this.ctx.getProgramParameter(this.programs[program], pname)
},