Repository navigation
Conversation
…tistics queries Vulkan drivers count mesh draws in IAVertices, IAPrimitives and VSInvocations and vertex draws in MESH_PRIMITIVES_GENERATED; D3D12 reports 0 there (measured on NVIDIA). prepare() records which kinds of draw each pipeline-statistics query saw between BeginQuery and EndQuery; a query that saw only one kind has those counters zeroed at resolve, after a transfer barrier. Queries that mix both kinds keep the driver's counts. d3d12_mesh_statistics_test now requires every counter to match the host.
Owner
Author
|
Superseded: ItsNotRexed#2870, rebuilt on ItsNotRexed#2359 (head 25373c4), fixes the IA/VS counters at the source, so this one-kind workaround is no longer needed. Closing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft for D3D-339, on top of ItsNotRexed#2870 (
617455ad); the base branch here is that head, so this diff is the fix alone. Not a PR to upstream: D3D-339 is @itsRevela's finding and builds on their PR.What
Vulkan drivers count mesh draws in IAVertices, IAPrimitives and VSInvocations, and vertex draws in
MESH_PRIMITIVES_GENERATED; D3D12 reports 0 there. D3D12 requires a query's BeginQuery and EndQuery in one command list, soprepare()can record which kinds of draw each pipeline-statistics query saw (DispatchMesh, or Draw/DrawIndexed/ExecuteIndirect draws). At resolve, a query that saw one kind only gets those counters zeroed (vkCmdFillBufferafter a transfer/compute → transfer barrier):The kinds travel with the query state (
QueryReplaypending values andQueryPool::draw_kinds), so a resolve in a later list or submission sees them too, and resolve runs only merge queries with the same kinds.Not covered: a query that mixes mesh and vertex draws keeps the driver's counts. That needs the split the finding describes (a segment per pipeline kind, with its own mask).
Tested
Windows 11, NVIDIA GeForce RTX 4060 Laptop GPU (Ada), driver 576.80, MSVC 14.44, Vulkan SDK 1.4.363. Synthetic tests only, no game files.
d3d12_mesh_statistics_testnow requires every counter to match host D3D12. Before: mesh queries 4/4/128 (and 2/2/64) in IAVertices/IAPrimitives/VSInvocations against the host's 0, and VS draw MSPrimitives 1 against 0. After: all 14 counters of all four queries match, including the split one.d3d12_mesh_test,replay_query_predication_test,d3d12_query_rules_test: pass.AI-assisted.