THIS PLUGIN IS NOT REQUIRED FOR RPG MAKER MV PROJECTS VERSIONS ABOVE 1.3.0 (11th August 2016 onwards)
Fixes the error as described by Companion Wolf here.
This will override the WebGL core method for buffer uploads. Will not affect canvas rendering in any way.
Very minimal, so performance impact should be near zero and because it overrides Pixi.js it should still work after the MV developers update 1.3 to fix this error (although by then you should remove this Plugin).
Activate simply by adding the Plugin. Should work in any order (as long as no other Plugins override WebGL core).
This fix simply reimplements the original Buffer.prototype.upload method, but changes line 2898 from being "else" to being;
This will make sure that an allocate is only attempted if there is actual data in the buffer.
This works fine because the buffer's name has already been pregenerated so the moment data actually has contents the bufferData call will occur. bufferSubData will only get called if the incoming data size is less than the stored data size, which will only cause a crash if the incoming data size is a negative number but the current stored data size is zero (unlikely to happen, but this code isn't 100% safe because of that one case).
NOTE: The about message for this Plugin is technically incorrect. Whilst the call that leads to the problem happens by the MV original code, the problem itself is within Pixi.js so the responsibility of fixing the problem is either party in this case.
I would expect Pixi to fix this problem first.
Fixes the error as described by Companion Wolf here.
This will override the WebGL core method for buffer uploads. Will not affect canvas rendering in any way.
Very minimal, so performance impact should be near zero and because it overrides Pixi.js it should still work after the MV developers update 1.3 to fix this error (although by then you should remove this Plugin).
Activate simply by adding the Plugin. Should work in any order (as long as no other Plugins override WebGL core).
This fix simply reimplements the original Buffer.prototype.upload method, but changes line 2898 from being "else" to being;
JavaScript:
} else if ( data.byteLength > 0 ) {
This works fine because the buffer's name has already been pregenerated so the moment data actually has contents the bufferData call will occur. bufferSubData will only get called if the incoming data size is less than the stored data size, which will only cause a crash if the incoming data size is a negative number but the current stored data size is zero (unlikely to happen, but this code isn't 100% safe because of that one case).
NOTE: The about message for this Plugin is technically incorrect. Whilst the call that leads to the problem happens by the MV original code, the problem itself is within Pixi.js so the responsibility of fixing the problem is either party in this case.
I would expect Pixi to fix this problem first.
I'm keeping it here for legacy support reasons.