Don't patch hitgroup/callable tables if not present

* The runtime seems to complain about an invalid address if it's at the end of a
  buffer even if the size is 0 bytes
This commit is contained in:
baldurk
2024-05-13 16:35:55 +01:00
parent 96da861a40
commit 53b21a1072
+4 -4
View File
@@ -925,9 +925,9 @@ PatchedRayDispatch D3D12RaytracingResourceAndUtilHandler::PatchRayDispatch(
unwrappedCmd->CopyBufferRegion(scratchBuffer->Resource(), scratchBuffer->Offset() + hitOffs,
res, offs, desc.HitGroupTable.SizeInBytes);
}
ret.desc.HitGroupTable.StartAddress = scratchBuffer->Address() + hitOffs;
ret.desc.HitGroupTable.StartAddress = scratchBuffer->Address() + hitOffs;
}
if(desc.CallableShaderTable.SizeInBytes > 0)
{
@@ -946,9 +946,9 @@ PatchedRayDispatch D3D12RaytracingResourceAndUtilHandler::PatchRayDispatch(
unwrappedCmd->CopyBufferRegion(scratchBuffer->Resource(), scratchBuffer->Offset() + callOffs,
res, offs, desc.CallableShaderTable.SizeInBytes);
}
ret.desc.CallableShaderTable.StartAddress = scratchBuffer->Address() + callOffs;
ret.desc.CallableShaderTable.StartAddress = scratchBuffer->Address() + callOffs;
}
barrier.Transition.pResource = scratchBuffer->Resource();
barrier.Transition.StateBefore = D3D12_RESOURCE_STATE_COPY_DEST;