GPU: refuse a query heap with no queries #430

Open
davutsimsekk wants to merge 1 commit from upstream-pr/430 into main
davutsimsekk commented 2026-11-25 00:45:00 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by davutsimsekk on 2026-11-25T00:45:00Z.


ID3D12Device::CreateQueryHeap returned S_OK and handed out a heap for D3D12_QUERY_HEAP_DESC::NumDescriptors == 0. D3D12 validates that the count is greater than 0 and returns E_INVALIDARG; the sibling creations here (queue, fence, signature) already reject empty descriptions.

This returns E_INVALIDARG when count == 0. Valid heaps and the null-description path are unchanged.

Test

query::tests::a_query_heap_needs_a_query calls create with count = 0 and asserts E_INVALIDARG with a null out pointer. On main it returns S_OK.

  • cargo test -p victory-gpu --lib a_query_heap_needs_a_query: 1 passed
  • cargo clippy -p victory-gpu --all-targets --locked -- -D warnings: clean
  • rustfmt --edition 2024 --check crates/victory-gpu/src/query.rs: clean
  • No game data or GPU was used.
<!-- greyfinch-sync:fxceless/victory-fork:issue:6594491396 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/430). Originally posted by [davutsimsekk](https://github.com/davutsimsekk) on 2026-11-25T00:45:00Z. --- `ID3D12Device::CreateQueryHeap` returned `S_OK` and handed out a heap for `D3D12_QUERY_HEAP_DESC::NumDescriptors == 0`. D3D12 validates that the count is greater than 0 and returns `E_INVALIDARG`; the sibling creations here (`queue`, `fence`, `signature`) already reject empty descriptions. This returns `E_INVALIDARG` when `count == 0`. Valid heaps and the null-description path are unchanged. ## Test `query::tests::a_query_heap_needs_a_query` calls `create` with `count = 0` and asserts `E_INVALIDARG` with a null out pointer. On `main` it returns `S_OK`. - `cargo test -p victory-gpu --lib a_query_heap_needs_a_query`: 1 passed - `cargo clippy -p victory-gpu --all-targets --locked -- -D warnings`: clean - `rustfmt --edition 2024 --check crates/victory-gpu/src/query.rs`: clean - No game data or GPU was used.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/430:upstream-pr/430'
git switch 'upstream-pr/430'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/430'
git switch 'upstream-pr/430'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/430'
git switch 'upstream-pr/430'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/430'
git switch 'main'
git merge --squash 'upstream-pr/430'
git switch 'main'
git merge --ff-only 'upstream-pr/430'
git switch 'main'
git merge 'upstream-pr/430'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
fxceless/victory-fork!430
No description provided.