mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
Track when GPU work for build inputs has completed
This commit is contained in:
@@ -1211,10 +1211,19 @@ void WrappedID3D12GraphicsCommandList::BuildRaytracingAccelerationStructure(
|
||||
return ProcessASBuildAfterSubmission(asbWrappedResourceId, asbWrappedResourceBufferOffset,
|
||||
dstASId, type, byteSize, buildData);
|
||||
},
|
||||
[buildData]() { buildData->Release(); });
|
||||
|
||||
// add a ref for the lambda below which tracks when it's ready for readback
|
||||
buildData->AddRef();
|
||||
|
||||
AddSubmissionASBuildCallback(
|
||||
true,
|
||||
[buildData]() {
|
||||
if(buildData)
|
||||
buildData->Release();
|
||||
});
|
||||
buildData->MarkWorkComplete();
|
||||
buildData->Release();
|
||||
return true;
|
||||
},
|
||||
[buildData]() { buildData->Release(); });
|
||||
|
||||
// an indirect AS build will pull in buffers we can't know about
|
||||
if(pDesc->Inputs.Type == D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL)
|
||||
|
||||
@@ -1125,6 +1125,9 @@ struct ASBuildData
|
||||
// geometry GPU addresses have been de-based to contain only offsets
|
||||
rdcarray<RTGeometryDesc> geoms;
|
||||
|
||||
void MarkWorkComplete() { complete = true; }
|
||||
bool IsWorkComplete() const { return complete; }
|
||||
|
||||
void AddRef();
|
||||
void Release();
|
||||
|
||||
@@ -1147,6 +1150,9 @@ private:
|
||||
// timestamp this build data was recorded on
|
||||
double timestamp = 0;
|
||||
|
||||
// has the GPU work for this build data finished and synchronised?
|
||||
bool complete = false;
|
||||
|
||||
// how many bytes of overhead are currently present, due to copying with strided vertex/AABB data
|
||||
uint64_t bytesOverhead = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user