GPU: refuse a query heap with no queries #430

Open
github-bot wants to merge 1 commit from github-bot/gh-430 into main AGit
Owner

@⁠davutsimsekk on GitHub · 2026-11-25 00:45 UTC · original
davutsimsekk:fix/query-heap-count → main · +23 −0 · 1 files · 1 commits · open

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.
**@⁠davutsimsekk** on GitHub · 2026-11-25 00:45 UTC · [original](https://github.com/fxceless/victory-fork/pull/430) `davutsimsekk:fix/query-heap-count` → `main` · +23 −0 · 1 files · 1 commits · open `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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:43:09 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/430/head:github-bot/gh-430'
git switch 'github-bot/gh-430'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-430'
git switch 'github-bot/gh-430'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-430'
git switch 'github-bot/gh-430'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-430'
git switch 'main'
git merge --squash 'github-bot/gh-430'
git switch 'main'
git merge --ff-only 'github-bot/gh-430'
git switch 'main'
git merge 'github-bot/gh-430'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.