Repository navigation
Add reusable GPU memory statistics - #49
Conversation
|
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
| #include <unordered_set> | ||
|
|
||
| #if DONUT_WITH_DX12 | ||
| #include <d3d12.h> |
There was a problem hiding this comment.
This breaks the general rule that this should be done in NRHI.
| if (device == nullptr || buffer == nullptr) | ||
| return false; | ||
|
|
||
| const nvrhi::MemoryRequirements requirements = device->getBufferMemoryRequirements(buffer); |
There was a problem hiding this comment.
Note the D3D11 implementation.
MemoryRequirements Device::getBufferMemoryRequirements(IBuffer*)
{
utils::NotSupported();
return MemoryRequirements();
}
| return stats; | ||
| } | ||
|
|
||
| TopLevelAccelStructPrebuildStats QueryTopLevelAccelStructPrebuildStats( |
There was a problem hiding this comment.
Ideally I would like to see this as an NVRHI call. Ok to stub out on Vulkan for now, with verbose.
|
|
||
| struct GpuMemoryUsage | ||
| { | ||
| uint64_t CapacityBytes = 0; |
There was a problem hiding this comment.
This code base uses camelCase.
|
Updated the branch to address the review. The NVRHI dependency is NVIDIA-RTX/NVRHI#145.
The NVRHI fork URL/gitlink is intentional for this dependent review and was verified fetchable. Local native validation is not being presented as upstream build CI: the dependency's CLA check passes, but no upstream Build run has been observed. No merges performed. |
|
Follow-up published at The existing-resource query is now optional Both library follow-ups passed no-mistakes review/test/document/lint. Native Debug NVRHI D3D11/D3D12/Vulkan and Donut D3D11/D3D12 WARP regressions passed through raw and validation paths. Additional dependency checks covered actual enhanced-barrier off/on behavior, externally managed BLAS queries after compaction, and Vulkan TLAS/micromaps. D3D12 OMM query coverage remains unavailable in the library test configuration. The final dependency chain also passed the full consuming RTXPT Debug build, packaged memory regression, and 46 packaged shader checks. Both packaged Windows samples independently loaded/rendered their default scene with zero arguments and exited normally after a bounded normal window-close request; no desktop input automation was used. These are native validation results, not a claim of upstream build CI: the NVRHI Build workflow still requires maintainer approval. Both branches were updated with ordinary non-force pushes, NVRHI first, after verifying the dependency was fetchable. Neither review was merged. |
Single landing spot for useful memory stats that consuming applications might want to measure / visualize.