Skip to content

Commit b463712

Browse files
committed
Added dirtying of data to ensure data is copied by the TransferTask when data->dirty() has been skipped by application.
1 parent 4adb4d6 commit b463712

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/vsg/state/BufferInfo.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ void BufferInfo::copyDataToBuffer()
106106

107107
void BufferInfo::copyDataToBuffer(uint32_t deviceID)
108108
{
109-
if (!buffer) return;
109+
if (!buffer || !data) return;
110110

111111
DeviceMemory* dm = buffer->getDeviceMemory(deviceID);
112112
if (dm)
@@ -115,6 +115,12 @@ void BufferInfo::copyDataToBuffer(uint32_t deviceID)
115115
{
116116
if (auto transferTask = dm->getDevice()->transferTask.ref_ptr())
117117
{
118+
// if data->dirty() hasn't been called since the last copy, assume it should have been done in call dirty on the data to ensure TransferTask copies the data.
119+
if (!data->differentModifiedCount(copiedModifiedCounts[deviceID]))
120+
{
121+
data->dirty();
122+
}
123+
118124
transferTask->assign(BufferInfoList{ref_ptr<BufferInfo>(this)});
119125
}
120126
else

0 commit comments

Comments
 (0)