Create two render targets and set pipeline with 4 vertex attributes to first one, and pipeline with 3 vertex attributes to second one.
Render something to first render target.
Render something to second render target.
In this case, Graphics.setVertexBuffer call for the second render target leaves fourth vertex attribute enabled, because it simply doesn't know how many vertex attributes were enabled by another instance of Graphics.
https://github.com/Kode/Kha/blob/4fd2d7f17adcc3b7bafd21df9197835ce51be2d9/Backends/HTML5/kha/js/graphics4/Graphics.hx#L47 This field should be static. Otherwise, render to different render targets (using different instances of Graphics) with different number of enabled vertex attributes leads to GL_INVALID_OPERATION.
Reproduce steps:
In this case, Graphics.setVertexBuffer call for the second render target leaves fourth vertex attribute enabled, because it simply doesn't know how many vertex attributes were enabled by another instance of Graphics.