engine icon indicating copy to clipboard operation
engine copied to clipboard

Add support baseVertex for GPURenderPassEncoder

Open AlexAPPi opened this issue 1 year ago • 6 comments

Hi!

It would be nice to have baseVertex support for the mesh.

https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/drawIndexed

https://github.com/playcanvas/engine/blob/03920ded44f6cee81ab16a904551b8b1ddecaeb5/src/platform/graphics/webgpu/webgpu-graphics-device.js#L521

https://github.com/playcanvas/engine/blob/03920ded44f6cee81ab16a904551b8b1ddecaeb5/src/scene/mesh.js#L256

AlexAPPi avatar Jun 25 '24 18:06 AlexAPPi

WebGL 2 adds support for this using WEBGL_draw_instanced_base_vertex_base_instance but its support seems to be very low (less than 1%) here https://web3dsurvey.com/webgl2

mvaligursky avatar Jun 27 '24 10:06 mvaligursky

WebGL 2 adds support for this using WEBGL_draw_instanced_base_vertex_base_instance but its support seems to be very low (less than 1%) here https://web3dsurvey.com/webgl2

If you focus on chromium-like browsers, they have support; this greatly speeds up the work with indexes, for example for the LOD system.

AlexAPPi avatar Jun 27 '24 11:06 AlexAPPi

I see this:

Screenshot 2024-06-27 at 12 31 56

My MacOS on latest Chrome does not expose this extension.

What data do you see?

mvaligursky avatar Jun 27 '24 11:06 mvaligursky

Sorry, I'm talking about webGPU support.

https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/drawIndexed#browser_compatibility

AlexAPPi avatar Jun 27 '24 11:06 AlexAPPi

Closed https://github.com/playcanvas/engine/pull/6977

AlexAPPi avatar Sep 20 '24 14:09 AlexAPPi

this needs to stay open till the implementation is merged in.

mvaligursky avatar Sep 20 '24 14:09 mvaligursky