Skip to content

Commit ec5725c

Browse files
committed
Fix glDrawArrays
Fixes a bug introduced in f73929c. The parameters of the current implementation of the glDrawArrays cannot be deduced from the function prototype but the buffer length can be used. Change-Id: I3296bfeff983f517d5a003e1f3c52de39b190b9d Reviewed-by: Mårten Nordheim <[email protected]> Reviewed-by: Edward Welbourne <[email protected]>
1 parent 98991b4 commit ec5725c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/plugins/platforms/webgl/webqt.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -958,10 +958,12 @@ window.onload = function () {
958958
obj["parameterCount"] = 4;
959959
else if (obj["function"] === "swapBuffers")
960960
obj["parameterCount"] = 0;
961+
else if (obj["function"] == "drawArrays")
962+
obj["parameterCount"] = null; // glDrawArrays has a variable number of arguments
961963
else
962964
obj["parameterCount"] = gl[obj["function"]].length;
963965
function deserialize(container, count) {
964-
for (var i = 0; i < count; ++i) {
966+
for (var i = 0; count != null ? i < count : offset + 4 < buffer.byteLength; ++i) {
965967
var character = view.getUint8(offset);
966968
offset += 1;
967969
var parameterType = String.fromCharCode(character);

0 commit comments

Comments
 (0)