Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vertex shaders: On platforms with uniform buffers, use indexing and loop over the lights. #16787

Merged
merged 2 commits into from
Jan 11, 2023

Conversation

hrydgard
Copy link
Owner

@hrydgard hrydgard commented Jan 11, 2023

Instead of duplicating the code for each light.

Strangely, maybe because there's less code to parse, this speeds up ubershader pipeline creation on PowerVR by over 30%. There shouldn't be any performance difference at runtime as the loop is trivial and easy for the driver to unroll if it feels like it.

For now, we only do this in Vulkan and D3D11, but it would be possible to also support in OpenGL, though the uniform management gets tricker (or we need to start using uniform buffers in OpenGL).

@hrydgard hrydgard added Vulkan D3D11 Direct3D 11 labels Jan 11, 2023
@hrydgard hrydgard added this to the v1.15.0 milestone Jan 11, 2023
…oop for real over the lights.

Strangely, greatly speeds up pipeline creation on PowerVR.
@hrydgard hrydgard merged commit 8d3a328 into master Jan 11, 2023
@hrydgard hrydgard deleted the lighting-loop branch January 11, 2023 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
D3D11 Direct3D 11 Vulkan
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant