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

Don't dirty the vertex buffer for stride/rate changes on bundles. #2744

Merged

Conversation

jimblandy
Copy link
Member

wgpu_core::command::bundle::State::set_pipeline marks a vertex buffer slot dirty if the pipeline's stride or step mode for that vertex buffer slot differs from what had been previously established. The effect of marking the slot dirty is to ensure that a new SetVertexBuffer command is inserted before the next draw command that uses that vertex buffer. However, this is unnecessary: wgpu_hal::CommandEncoder::set_vertex_buffer does not need to be called simply because the stride or rate has changed.

@jimblandy jimblandy marked this pull request as ready for review June 6, 2022 22:59
@jimblandy jimblandy marked this pull request as draft June 6, 2022 23:03
`wgpu_core::command::bundle::State::set_pipeline` marks a vertex
buffer slot dirty if the pipeline's stride or step mode for that
vertex buffer slot differs from what had been previously established.
The effect of marking the slot dirty is to ensure that a new
`SetVertexBuffer` command is inserted before the next draw command
that uses that vertex buffer. However, this is unnecessary:
`wgpu_hal::CommandEncoder::set_vertex_buffer` does not need to be
called simply because the stride or rate has changed.
@jimblandy jimblandy force-pushed the vertex-stride-changes-not-dirty branch from 82c8b15 to 824da00 Compare June 6, 2022 23:05
@jimblandy jimblandy marked this pull request as ready for review June 6, 2022 23:34
Copy link
Member

@cwfitzgerald cwfitzgerald left a comment

Choose a reason for hiding this comment

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

GLTM

@cwfitzgerald cwfitzgerald merged commit d26c04c into gfx-rs:master Jun 7, 2022
@jimblandy jimblandy deleted the vertex-stride-changes-not-dirty branch June 7, 2022 06:11
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