{
const Allocation& geometryAlloc = vertexBuffer->getAllocation();
deUint8* bufferStart = static_cast<deUint8*>(geometryAlloc.getHostPtr());
- const VkDeviceSize bufferSize = getVertexBufferSize(geometriesData);
VkDeviceSize bufferOffset = geometriesOffset;
for (size_t geometryNdx = 0; geometryNdx < geometriesData.size(); ++geometryNdx)
bufferOffset += deAlignSize(geometryPtrSize,8);
}
- flushMappedMemoryRange(vk, device, geometryAlloc.getMemory(), geometryAlloc.getOffset()+geometriesOffset, bufferSize);
+ // Flush the whole allocation. We could flush only the interesting range, but we'd need to be sure both the offset and size
+ // align to VkPhysicalDeviceLimits::nonCoherentAtomSize, which we are not considering. Also note most code uses Coherent memory
+ // for the vertex and index buffers, so flushing is actually not needed.
+ flushAlloc(vk, device, geometryAlloc);
}
VkDeviceSize getIndexBufferSize (const std::vector<de::SharedPtr<RaytracedGeometryBase>>& geometriesData)
{
const Allocation& indexAlloc = indexBuffer->getAllocation();
deUint8* bufferStart = static_cast<deUint8*>(indexAlloc.getHostPtr());
- const VkDeviceSize bufferSize = getIndexBufferSize(geometriesData);
VkDeviceSize bufferOffset = geometriesOffset;
for (size_t geometryNdx = 0; geometryNdx < geometriesData.size(); ++geometryNdx)
}
}
- flushMappedMemoryRange(vk, device, indexAlloc.getMemory(), indexAlloc.getOffset()+geometriesOffset, bufferSize);
+ // Flush the whole allocation. We could flush only the interesting range, but we'd need to be sure both the offset and size
+ // align to VkPhysicalDeviceLimits::nonCoherentAtomSize, which we are not considering. Also note most code uses Coherent memory
+ // for the vertex and index buffers, so flushing is actually not needed.
+ flushAlloc(vk, device, indexAlloc);
}
class BottomLevelAccelerationStructureKHR : public BottomLevelAccelerationStructure