Skip to content
This repository has been archived by the owner on Aug 17, 2021. It is now read-only.

Line rendering without geometry shaders? #3

Closed
rastertail opened this issue Sep 20, 2019 · 2 comments
Closed

Line rendering without geometry shaders? #3

rastertail opened this issue Sep 20, 2019 · 2 comments

Comments

@rastertail
Copy link
Collaborator

Some old hardware may not support geometry shaders, which are currently required for line rendering. It is possible to implement it without geometry shaders, however it is at the expense of generating more verts on the CPU and using a bit more memory bandwidth every frame. It may not even be worth it to support devices this old, especially depending on what the overall performance cost will be.

@rastertail
Copy link
Collaborator Author

Turns out wgpu intentionally doesn't support geometry shaders due to some performance concerns. 😃 Looks like we will either have to deal with the CPU penalty or use computer shaders, and I'm not a big fan of compute shaders.

@rastertail
Copy link
Collaborator Author

New plan: upload line data to an SSBO, don't bind a vertex buffer, and assemble the line quads directly in the vertex shader. This solves everything with no apparent drawbacks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant