gpu/internal/opengl: avoid PACK/UNPACK_ROW_LENGTH on WebGL 1

Fixes gio#259

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2021-09-05 10:23:45 +02:00
parent 0403b1ff8e
commit bde046de54
2 changed files with 20 additions and 3 deletions
+6
View File
@@ -262,6 +262,12 @@ func (f *Functions) GetBindingi(pname Enum, idx int) Object {
return Object(obj)
}
func (f *Functions) GetInteger(pname Enum) int {
if !f.isWebGL2 {
switch pname {
case PACK_ROW_LENGTH, UNPACK_ROW_LENGTH:
return 0 // PACK_ROW_LENGTH and UNPACK_ROW_LENGTH is only available on WebGL 2
}
}
return paramVal(f.Ctx.Call("getParameter", int(pname)))
}
func (f *Functions) GetFloat(pname Enum) float32 {