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

Improved estimation of vertex attribute buffer count when reserving for implicit buffer #2425

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

dboyan
Copy link
Contributor

@dboyan dboyan commented Jan 21, 2025

Currently, the vertex attribute buffer count estimation (to reserve binding for implicit buffers) is too generous. This merge request improves the estimation by introducing one case from the actual allocation logic, addVertexInputToPipeline, i.e., synthetic binding buffer if the vertex attribute offset is 0. This helps in reducing the required binding slots the majority of pipelines generated by ANGLE and allows vertex shaders that uses more than 10 attribute inputs to work.

In the meantime, the change brings bindings of implicit buffers and vertex attributes into close vicinity, and exposes a bug where implicit buffer interferes with vertex attribute at the same binding index across draw calls in the same render pass. This is masked by the previous over-conservative estimation. The second change fix the bug by adding dirty marks.

The only other (first) change is trivial style fix, and does not affect the visible behavior of the program.

…ding

To be consistent with initReservedVertexAttributeBufferCount.

This should not cause any visible effect.
…ing implicit buffer

In vertex shader, vertex attribute buffer and implicit buffer occupy the same
buffer binding space, but they are bound using different methods. When an
implicit buffer is used, it should mark the vertex (attribute) buffer at
the same buffer index as dirty so that it will be correctly bound when
activated.
…ving

The current vertex attribute buffer reservation is too generous.
According to addVertexInputToPipeline method, we don't need synthetic
binding buffer if the vertex attribute offset is 0.
Copy link
Collaborator

@cdavis5e cdavis5e left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should run this against the CTS and see if anything breaks...

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

Successfully merging this pull request may close these issues.

2 participants