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

Fix indexed drawing with RenderBundle #5441

Merged
merged 3 commits into from Mar 30, 2024

Conversation

Wumpf
Copy link
Member

@Wumpf Wumpf commented Mar 27, 2024

Connections

Description
Turns out index drawing with render bundles was completely broken due to a simple mistake in render bundle's index checking. The fix is a simple comparision flip, but the fact this wasn't tested is rather concerning! I expanded the vertex_indices test to account for this. The test is already fairly overloaded, but after originally starting a separate testsuite I figured this is after all a great spot for it, also all of the tests there should run anyways with render bundles as well.
In the future we should add more tests that take subsets of vertex & index buffer and test various error cases as well.

Testing
Most of this PR is the test!
(and indeed it breaks without the fix)

Checklist

  • Run cargo fmt.
  • Run cargo clippy. If applicable, add:
    • --target wasm32-unknown-unknown
    • --target wasm32-unknown-emscripten
  • Run cargo xtask test to run tests.
  • Add change to CHANGELOG.md. See simple instructions inside file.

@Wumpf Wumpf added the PR: needs back-porting PR with a fix that needs to land on crates label Mar 27, 2024
@Wumpf Wumpf added this to the v0.20 milestone Mar 27, 2024
@Wumpf Wumpf requested a review from a team as a code owner March 27, 2024 11:01
@Wumpf Wumpf changed the title Fix index drawing with RenderBundle Fix indexed drawing with RenderBundle Mar 27, 2024
@Wumpf Wumpf merged commit ed7d9de into gfx-rs:trunk Mar 30, 2024
27 checks passed
@Wumpf Wumpf deleted the fix-renderbundle-index-drawing branch March 30, 2024 09:19
@cwfitzgerald
Copy link
Member

cwfitzgerald commented Apr 17, 2024

This doesn't need backporting as it's not an issue on 0.19, it was introduced in a refactor on main. The cherry-picked test case passes.

@cwfitzgerald cwfitzgerald removed the PR: needs back-porting PR with a fix that needs to land on crates label Apr 17, 2024
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.

Why drawIndexed(indexCount) indexCount should > indexBuffer size?
3 participants