So I’m porting my material plugins from glsl to wgsl and keep running into maxVertexBuffer errors. Apparently, the spec now is fixed at 8 which is apparently a regression compared against webgl. Milestone 2 will raise this to 16. Unfortunately, there is no timeline as to when that will happen.
I need to ask: what is the best practice when the attributes passed into the shader exceeds the vertexBuffer limit. Its actually pretty easy to hit the limit, especially with vat, matrix data etc… Should I rewrite to use new stuff (custom uniform buffers/storage buffers), will it help me pass the attributes in? or wait for Milestone 2?
1 Like
pinging the master @Evgeni_Popov
Unfortunately, there aren’t many solutions here, other than waiting for milestone 2… You could try using a storage buffer instead of a vertex buffer if you’re using your own shaders (should not be too difficult), but if you want this to work with existing shaders (standard materials / PBR), it may be much more difficult to replace the vertex buffer with a storage buffer (because the declaration and use of the buffer are not the same in both cases)…
Its mainly material plugins. I don’t see anything related to storage buffers in the MaterialPluginBase class so I guess it would be a lot of (possibly) unnecessary work writing helpers to use storage buffers to work around the limit. And me rewriting plugins to shaderMaterial is similarly moot when they were shaderMaterial b4 I rewrote to plugins (lol).
Eventually when glsl gets completely phased out, everything will just be gpu based and all the materials can be rewritten. Thanks for the quick response, I’ll kiv for now. Cheers!