@@ -65,7 +65,7 @@ namespace nvrhi
6565{
6666 // Version of the public API provided by NVRHI.
6767 // Increment this when any changes to the API are made.
68- static constexpr uint32_t c_HeaderVersion = 27 ;
68+ static constexpr uint32_t c_HeaderVersion = 28 ;
6969
7070 // Verifies that the version of the implementation matches the version of the header.
7171 // Returns true if they match. Use this when initializing apps using NVRHI as a shared library.
@@ -3318,6 +3318,16 @@ namespace nvrhi
33183318
33193319 typedef RefCountPtr<ICommandListLifetimeTracker> CommandListLifetimeTrackerHandle;
33203320
3321+ // Memory held by a command list's internal chunk pools, see ICommandList::getInternalMemoryUsage.
3322+ struct CommandListMemoryUsage
3323+ {
3324+ // AS build scratch chunks, in device-local memory.
3325+ uint64_t scratchBytes = 0 ;
3326+
3327+ // Upload chunks, in CPU-visible memory.
3328+ uint64_t uploadBytes = 0 ;
3329+ };
3330+
33213331 // ////////////////////////////////////////////////////////////////////////
33223332 // ICommandList
33233333 // ////////////////////////////////////////////////////////////////////////
@@ -3813,6 +3823,12 @@ namespace nvrhi
38133823
38143824 // Returns the CommandListParameters structure that was used to create the command list.
38153825 virtual const CommandListParameters& getDesc () = 0;
3826+
3827+ // Returns the total size of the chunks created by the upload and scratch managers. The chunks are only
3828+ // freed when the command list is destroyed, so this never decreases. Not safe to call while another thread
3829+ // is recording into this command list.
3830+ // - DX11: Always returns zeros.
3831+ [[nodiscard]] virtual CommandListMemoryUsage getInternalMemoryUsage () const = 0;
38163832 };
38173833
38183834 typedef RefCountPtr<ICommandList> CommandListHandle;
0 commit comments