Skip to content

Commit 5bf5966

Browse files
Copilotchrxh
andcommitted
Refactor geometry test infrastructure: use single testOnly_copyBuffersFromCudaToCpu method with CpuGeometryBuffers struct
Co-authored-by: chrxh <[email protected]>
1 parent 6e50610 commit 5bf5966

File tree

11 files changed

+234
-106
lines changed

11 files changed

+234
-106
lines changed

source/EngineGpuKernels/GeometryKernelsService.cu

Lines changed: 157 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,13 @@ void GeometryKernelsService::extractObjectData(
9595
SettingsForSimulation const& settings,
9696
SimulationData data,
9797
CudaGeometryBuffers& renderingData,
98-
RealRect const& visibleWorldRect)
98+
RealRect const& visibleWorldRect,
99+
bool useInterop)
99100
{
100101
auto const& gpuSettings = settings.cudaSettings;
101102
float2 const visibleTopLeft{visibleWorldRect.topLeft.x, visibleWorldRect.topLeft.y};
102103

103-
if (GlobalSettings::get().isInterop()) {
104+
if (useInterop) {
104105
// Interop mode: use CUDA-OpenGL interoperability
105106
CHECK_FOR_CUDA_ERROR(cudaGraphicsMapResources(1, &renderingData.vertexBuffer));
106107
CellVertexData* mappedCellBuffer;
@@ -208,64 +209,176 @@ void GeometryKernelsService::extractObjectData(
208209
}
209210
}
210211

211-
std::vector<SelectedObjectVertexData> GeometryKernelsService::testOnly_getSelectedObjectData(SettingsForSimulation const& settings, SimulationData data)
212+
void GeometryKernelsService::extractObjectDataToCpuBuffers(
213+
SettingsForSimulation const& settings,
214+
SimulationData data,
215+
CpuGeometryBuffers& cpuBuffers,
216+
RealRect const& visibleWorldRect)
212217
{
213218
auto const& gpuSettings = settings.cudaSettings;
219+
float2 const visibleTopLeft{visibleWorldRect.topLeft.x, visibleWorldRect.topLeft.y};
214220

215-
// First count how many selected objects
216-
setValueToDevice(_numSelectedObjects, static_cast<uint64_t>(0));
217-
KERNEL_CALL(cudaExtractSelectedObjectData, data, nullptr, _numSelectedObjects);
218-
cudaDeviceSynchronize();
219-
auto numObjects = copyToHost(_numSelectedObjects);
220-
221-
if (numObjects == 0) {
222-
return {};
223-
}
221+
// Get counts first
222+
auto numCells = data.objects.cells.getNumEntries_host();
223+
auto numParticles = data.objects.particles.getNumEntries_host();
224224

225-
// Allocate device memory and extract data
226-
SelectedObjectVertexData* deviceBuffer;
227-
CHECK_FOR_CUDA_ERROR(cudaMalloc(&deviceBuffer, numObjects * sizeof(SelectedObjectVertexData)));
225+
setValueToDevice(_numLocations, static_cast<uint64_t>(0));
226+
KERNEL_CALL_1_1(cudaExtractLocationData, data, nullptr, _numLocations, visibleTopLeft);
227+
cudaDeviceSynchronize();
228+
auto numLocations = copyToHost(_numLocations);
228229

229230
setValueToDevice(_numSelectedObjects, static_cast<uint64_t>(0));
230-
KERNEL_CALL(cudaExtractSelectedObjectData, data, deviceBuffer, _numSelectedObjects);
231+
KERNEL_CALL(cudaExtractSelectedObjectData, data, nullptr, _numSelectedObjects);
231232
cudaDeviceSynchronize();
233+
auto numSelectedObjects = copyToHost(_numSelectedObjects);
232234

233-
// Copy to host
234-
std::vector<SelectedObjectVertexData> result(numObjects);
235-
CHECK_FOR_CUDA_ERROR(cudaMemcpy(result.data(), deviceBuffer, numObjects * sizeof(SelectedObjectVertexData), cudaMemcpyDeviceToHost));
236-
237-
CHECK_FOR_CUDA_ERROR(cudaFree(deviceBuffer));
238-
239-
return result;
240-
}
235+
setValueToDevice(_numLineIndices, static_cast<uint64_t>(0));
236+
KERNEL_CALL(cudaExtractLineIndices, data, nullptr, _numLineIndices);
237+
cudaDeviceSynchronize();
238+
auto numLineIndices = copyToHost(_numLineIndices);
241239

242-
std::vector<ConnectionArrowVertexData> GeometryKernelsService::testOnly_getConnectionArrowData(SettingsForSimulation const& settings, SimulationData data)
243-
{
244-
auto const& gpuSettings = settings.cudaSettings;
240+
setValueToDevice(_numTriangleIndices, static_cast<uint64_t>(0));
241+
KERNEL_CALL(cudaExtractTriangleIndices, data, nullptr, _numTriangleIndices);
242+
cudaDeviceSynchronize();
243+
auto numTriangleIndices = copyToHost(_numTriangleIndices);
245244

246-
// First count how many connection arrow vertices
247245
setValueToDevice(_numSelectedConnectionVertices, static_cast<uint64_t>(0));
248246
KERNEL_CALL(cudaExtractSelectedConnectionData, data, nullptr, _numSelectedConnectionVertices);
249247
cudaDeviceSynchronize();
250-
auto numVertices = copyToHost(_numSelectedConnectionVertices);
251-
252-
if (numVertices == 0) {
253-
return {};
254-
}
255-
256-
// Allocate device memory and extract data
257-
ConnectionArrowVertexData* deviceBuffer;
258-
CHECK_FOR_CUDA_ERROR(cudaMalloc(&deviceBuffer, numVertices * sizeof(ConnectionArrowVertexData)));
248+
auto numConnectionArrows = copyToHost(_numSelectedConnectionVertices);
259249

260-
setValueToDevice(_numSelectedConnectionVertices, static_cast<uint64_t>(0));
261-
KERNEL_CALL(cudaExtractSelectedConnectionData, data, deviceBuffer, _numSelectedConnectionVertices);
250+
setValueToDevice(_numAttackEventVertices, static_cast<uint64_t>(0));
251+
KERNEL_CALL(cudaExtractAttackEventData, data, nullptr, _numAttackEventVertices);
262252
cudaDeviceSynchronize();
253+
auto numAttackEvents = copyToHost(_numAttackEventVertices);
263254

264-
// Copy to host
265-
std::vector<ConnectionArrowVertexData> result(numVertices);
266-
CHECK_FOR_CUDA_ERROR(cudaMemcpy(result.data(), deviceBuffer, numVertices * sizeof(ConnectionArrowVertexData), cudaMemcpyDeviceToHost));
255+
setValueToDevice(_numDetonationEventVertices, static_cast<uint64_t>(0));
256+
KERNEL_CALL(cudaExtractDetonationEventData, data, nullptr, _numDetonationEventVertices);
257+
cudaDeviceSynchronize();
258+
auto numDetonationEvents = copyToHost(_numDetonationEventVertices);
259+
260+
// Allocate device buffers
261+
CellVertexData* deviceCellBuffer = nullptr;
262+
EnergyParticleVertexData* deviceEnergyParticleBuffer = nullptr;
263+
LocationVertexData* deviceLocationBuffer = nullptr;
264+
SelectedObjectVertexData* deviceSelectedObjectBuffer = nullptr;
265+
unsigned int* deviceLineIndexBuffer = nullptr;
266+
unsigned int* deviceTriangleIndexBuffer = nullptr;
267+
ConnectionArrowVertexData* deviceConnectionArrowBuffer = nullptr;
268+
AttackEventVertexData* deviceAttackEventBuffer = nullptr;
269+
DetonationEventVertexData* deviceDetonationEventBuffer = nullptr;
270+
271+
if (numCells > 0) {
272+
CHECK_FOR_CUDA_ERROR(cudaMalloc(&deviceCellBuffer, numCells * sizeof(CellVertexData)));
273+
}
274+
if (numParticles > 0) {
275+
CHECK_FOR_CUDA_ERROR(cudaMalloc(&deviceEnergyParticleBuffer, numParticles * sizeof(EnergyParticleVertexData)));
276+
}
277+
if (numLocations > 0) {
278+
CHECK_FOR_CUDA_ERROR(cudaMalloc(&deviceLocationBuffer, numLocations * sizeof(LocationVertexData)));
279+
}
280+
if (numSelectedObjects > 0) {
281+
CHECK_FOR_CUDA_ERROR(cudaMalloc(&deviceSelectedObjectBuffer, numSelectedObjects * sizeof(SelectedObjectVertexData)));
282+
}
283+
if (numLineIndices > 0) {
284+
CHECK_FOR_CUDA_ERROR(cudaMalloc(&deviceLineIndexBuffer, numLineIndices * sizeof(unsigned int)));
285+
}
286+
if (numTriangleIndices > 0) {
287+
CHECK_FOR_CUDA_ERROR(cudaMalloc(&deviceTriangleIndexBuffer, numTriangleIndices * sizeof(unsigned int)));
288+
}
289+
if (numConnectionArrows > 0) {
290+
CHECK_FOR_CUDA_ERROR(cudaMalloc(&deviceConnectionArrowBuffer, numConnectionArrows * sizeof(ConnectionArrowVertexData)));
291+
}
292+
if (numAttackEvents > 0) {
293+
CHECK_FOR_CUDA_ERROR(cudaMalloc(&deviceAttackEventBuffer, numAttackEvents * sizeof(AttackEventVertexData)));
294+
}
295+
if (numDetonationEvents > 0) {
296+
CHECK_FOR_CUDA_ERROR(cudaMalloc(&deviceDetonationEventBuffer, numDetonationEvents * sizeof(DetonationEventVertexData)));
297+
}
267298

268-
CHECK_FOR_CUDA_ERROR(cudaFree(deviceBuffer));
299+
// Extract data to device buffers
300+
if (numCells > 0) {
301+
KERNEL_CALL(cudaExtractCellData, data, deviceCellBuffer);
302+
}
303+
if (numParticles > 0) {
304+
KERNEL_CALL(cudaExtractEnergyParticleData, data, deviceEnergyParticleBuffer);
305+
}
306+
if (numLocations > 0) {
307+
setValueToDevice(_numLocations, static_cast<uint64_t>(0));
308+
KERNEL_CALL_1_1(cudaExtractLocationData, data, deviceLocationBuffer, _numLocations, visibleTopLeft);
309+
}
310+
if (numSelectedObjects > 0) {
311+
setValueToDevice(_numSelectedObjects, static_cast<uint64_t>(0));
312+
KERNEL_CALL(cudaExtractSelectedObjectData, data, deviceSelectedObjectBuffer, _numSelectedObjects);
313+
}
314+
if (numLineIndices > 0) {
315+
setValueToDevice(_numLineIndices, static_cast<uint64_t>(0));
316+
KERNEL_CALL(cudaExtractLineIndices, data, deviceLineIndexBuffer, _numLineIndices);
317+
}
318+
if (numTriangleIndices > 0) {
319+
setValueToDevice(_numTriangleIndices, static_cast<uint64_t>(0));
320+
KERNEL_CALL(cudaExtractTriangleIndices, data, deviceTriangleIndexBuffer, _numTriangleIndices);
321+
}
322+
if (numConnectionArrows > 0) {
323+
setValueToDevice(_numSelectedConnectionVertices, static_cast<uint64_t>(0));
324+
KERNEL_CALL(cudaExtractSelectedConnectionData, data, deviceConnectionArrowBuffer, _numSelectedConnectionVertices);
325+
}
326+
if (numAttackEvents > 0) {
327+
setValueToDevice(_numAttackEventVertices, static_cast<uint64_t>(0));
328+
KERNEL_CALL(cudaExtractAttackEventData, data, deviceAttackEventBuffer, _numAttackEventVertices);
329+
}
330+
if (numDetonationEvents > 0) {
331+
setValueToDevice(_numDetonationEventVertices, static_cast<uint64_t>(0));
332+
KERNEL_CALL(cudaExtractDetonationEventData, data, deviceDetonationEventBuffer, _numDetonationEventVertices);
333+
}
334+
cudaDeviceSynchronize();
269335

270-
return result;
336+
// Resize CPU buffers
337+
cpuBuffers.cells.resize(numCells);
338+
cpuBuffers.energyParticles.resize(numParticles);
339+
cpuBuffers.locations.resize(numLocations);
340+
cpuBuffers.selectedObjects.resize(numSelectedObjects);
341+
cpuBuffers.lineIndices.resize(numLineIndices);
342+
cpuBuffers.triangleIndices.resize(numTriangleIndices);
343+
cpuBuffers.connectionArrows.resize(numConnectionArrows);
344+
cpuBuffers.attackEvents.resize(numAttackEvents);
345+
cpuBuffers.detonationEvents.resize(numDetonationEvents);
346+
347+
// Copy from device to host
348+
if (numCells > 0) {
349+
CHECK_FOR_CUDA_ERROR(cudaMemcpy(cpuBuffers.cells.data(), deviceCellBuffer, numCells * sizeof(CellVertexData), cudaMemcpyDeviceToHost));
350+
CHECK_FOR_CUDA_ERROR(cudaFree(deviceCellBuffer));
351+
}
352+
if (numParticles > 0) {
353+
CHECK_FOR_CUDA_ERROR(cudaMemcpy(cpuBuffers.energyParticles.data(), deviceEnergyParticleBuffer, numParticles * sizeof(EnergyParticleVertexData), cudaMemcpyDeviceToHost));
354+
CHECK_FOR_CUDA_ERROR(cudaFree(deviceEnergyParticleBuffer));
355+
}
356+
if (numLocations > 0) {
357+
CHECK_FOR_CUDA_ERROR(cudaMemcpy(cpuBuffers.locations.data(), deviceLocationBuffer, numLocations * sizeof(LocationVertexData), cudaMemcpyDeviceToHost));
358+
CHECK_FOR_CUDA_ERROR(cudaFree(deviceLocationBuffer));
359+
}
360+
if (numSelectedObjects > 0) {
361+
CHECK_FOR_CUDA_ERROR(cudaMemcpy(cpuBuffers.selectedObjects.data(), deviceSelectedObjectBuffer, numSelectedObjects * sizeof(SelectedObjectVertexData), cudaMemcpyDeviceToHost));
362+
CHECK_FOR_CUDA_ERROR(cudaFree(deviceSelectedObjectBuffer));
363+
}
364+
if (numLineIndices > 0) {
365+
CHECK_FOR_CUDA_ERROR(cudaMemcpy(cpuBuffers.lineIndices.data(), deviceLineIndexBuffer, numLineIndices * sizeof(unsigned int), cudaMemcpyDeviceToHost));
366+
CHECK_FOR_CUDA_ERROR(cudaFree(deviceLineIndexBuffer));
367+
}
368+
if (numTriangleIndices > 0) {
369+
CHECK_FOR_CUDA_ERROR(cudaMemcpy(cpuBuffers.triangleIndices.data(), deviceTriangleIndexBuffer, numTriangleIndices * sizeof(unsigned int), cudaMemcpyDeviceToHost));
370+
CHECK_FOR_CUDA_ERROR(cudaFree(deviceTriangleIndexBuffer));
371+
}
372+
if (numConnectionArrows > 0) {
373+
CHECK_FOR_CUDA_ERROR(cudaMemcpy(cpuBuffers.connectionArrows.data(), deviceConnectionArrowBuffer, numConnectionArrows * sizeof(ConnectionArrowVertexData), cudaMemcpyDeviceToHost));
374+
CHECK_FOR_CUDA_ERROR(cudaFree(deviceConnectionArrowBuffer));
375+
}
376+
if (numAttackEvents > 0) {
377+
CHECK_FOR_CUDA_ERROR(cudaMemcpy(cpuBuffers.attackEvents.data(), deviceAttackEventBuffer, numAttackEvents * sizeof(AttackEventVertexData), cudaMemcpyDeviceToHost));
378+
CHECK_FOR_CUDA_ERROR(cudaFree(deviceAttackEventBuffer));
379+
}
380+
if (numDetonationEvents > 0) {
381+
CHECK_FOR_CUDA_ERROR(cudaMemcpy(cpuBuffers.detonationEvents.data(), deviceDetonationEventBuffer, numDetonationEvents * sizeof(DetonationEventVertexData), cudaMemcpyDeviceToHost));
382+
CHECK_FOR_CUDA_ERROR(cudaFree(deviceDetonationEventBuffer));
383+
}
271384
}

source/EngineGpuKernels/GeometryKernelsService.cuh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
#include <Base/Singleton.h>
44

5+
#include <EngineInterface/CpuGeometryBuffers.h>
56
#include <EngineInterface/GeometryBuffers.h>
67

78
#include "Base.cuh"
@@ -20,10 +21,8 @@ public:
2021
void correctPositionsForRendering(SettingsForSimulation const& settings, SimulationData data, RealRect const& visibleWorldRect);
2122
void restorePositions(SettingsForSimulation const& settings, SimulationData data);
2223
NumRenderObjects getNumRenderObjects(SettingsForSimulation const& settings, SimulationData data, RealRect const& visibleWorldRect);
23-
void extractObjectData(SettingsForSimulation const& settings, SimulationData data, CudaGeometryBuffers& renderingData, RealRect const& visibleWorldRect);
24-
25-
std::vector<SelectedObjectVertexData> testOnly_getSelectedObjectData(SettingsForSimulation const& settings, SimulationData data);
26-
std::vector<ConnectionArrowVertexData> testOnly_getConnectionArrowData(SettingsForSimulation const& settings, SimulationData data);
24+
void extractObjectData(SettingsForSimulation const& settings, SimulationData data, CudaGeometryBuffers& renderingData, RealRect const& visibleWorldRect, bool useInterop);
25+
void extractObjectDataToCpuBuffers(SettingsForSimulation const& settings, SimulationData data, CpuGeometryBuffers& cpuBuffers, RealRect const& visibleWorldRect);
2726

2827
private:
2928
GeometryKernelsService() = default;

source/EngineGpuKernels/SimulationCudaFacade.cu

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,11 @@ void _SimulationCudaFacade::copyBuffersFromCudaToOpenGL(GeometryBuffers const& g
134134

135135
if (GlobalSettings::get().isInterop()) {
136136
_cudaGeometryBuffers->registerBuffers(geometryBuffers);
137-
GeometryKernelsService::get().extractObjectData(_settings, simulationData, *_cudaGeometryBuffers, visibleWorldRect);
137+
GeometryKernelsService::get().extractObjectData(_settings, simulationData, *_cudaGeometryBuffers, visibleWorldRect, true);
138138
syncAndCheck();
139139
} else {
140140
_cudaGeometryBuffers->allocateBuffersForNoInterop(numRenderObjects);
141-
GeometryKernelsService::get().extractObjectData(_settings, simulationData, *_cudaGeometryBuffers, visibleWorldRect);
141+
GeometryKernelsService::get().extractObjectData(_settings, simulationData, *_cudaGeometryBuffers, visibleWorldRect, false);
142142
syncAndCheck();
143143
_cudaGeometryBuffers->copyToOpenGL(geometryBuffers, numRenderObjects);
144144
}
@@ -672,22 +672,15 @@ NumRenderObjects _SimulationCudaFacade::testOnly_getNumRenderObjects()
672672
return result;
673673
}
674674

675-
std::vector<SelectedObjectVertexData> _SimulationCudaFacade::testOnly_getSelectedObjectData()
675+
CpuGeometryBuffers _SimulationCudaFacade::testOnly_copyBuffersFromCudaToCpu()
676676
{
677677
checkAndProcessSimulationParameterChanges();
678678
auto simulationData = getSimulationDataPtrCopy();
679-
auto result = GeometryKernelsService::get().testOnly_getSelectedObjectData(_settings, simulationData);
680-
syncAndCheck();
681-
return result;
682-
}
683-
684-
std::vector<ConnectionArrowVertexData> _SimulationCudaFacade::testOnly_getConnectionArrowData()
685-
{
686-
checkAndProcessSimulationParameterChanges();
687-
auto simulationData = getSimulationDataPtrCopy();
688-
auto result = GeometryKernelsService::get().testOnly_getConnectionArrowData(_settings, simulationData);
679+
RealRect visibleWorldRect = {{0, 0}, {static_cast<float>(_settings.worldSizeX), static_cast<float>(_settings.worldSizeY)}};
680+
CpuGeometryBuffers cpuBuffers;
681+
GeometryKernelsService::get().extractObjectDataToCpuBuffers(_settings, simulationData, cpuBuffers, visibleWorldRect);
689682
syncAndCheck();
690-
return result;
683+
return cpuBuffers;
691684
}
692685

693686
void _SimulationCudaFacade::initCuda()

source/EngineGpuKernels/SimulationCudaFacade.cuh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
#include <EngineInterface/ArraySizesForGpu.h>
1313
#include <EngineInterface/ArraySizesForTO.h>
14+
#include <EngineInterface/CpuGeometryBuffers.h>
1415
#include <EngineInterface/Definitions.h>
1516
#include <EngineInterface/GeometryBuffers.h>
1617
#include <EngineInterface/MutationType.h>
@@ -113,8 +114,7 @@ public:
113114
void testOnly_resizeArrays(ArraySizesForGpu const& sizeDelta);
114115
bool testOnly_arePointersValid();
115116
NumRenderObjects testOnly_getNumRenderObjects();
116-
std::vector<SelectedObjectVertexData> testOnly_getSelectedObjectData();
117-
std::vector<ConnectionArrowVertexData> testOnly_getConnectionArrowData();
117+
CpuGeometryBuffers testOnly_copyBuffersFromCudaToCpu();
118118

119119
private:
120120
void initCuda();

source/EngineImpl/EngineWorker.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -508,16 +508,10 @@ NumRenderObjects EngineWorker::testOnly_getNumRenderObjects()
508508
return _simulationCudaFacade->testOnly_getNumRenderObjects();
509509
}
510510

511-
std::vector<SelectedObjectVertexData> EngineWorker::testOnly_getSelectedObjectData()
511+
CpuGeometryBuffers EngineWorker::testOnly_copyBuffersFromCudaToCpu()
512512
{
513513
EngineWorkerGuard access(this);
514-
return _simulationCudaFacade->testOnly_getSelectedObjectData();
515-
}
516-
517-
std::vector<ConnectionArrowVertexData> EngineWorker::testOnly_getConnectionArrowData()
518-
{
519-
EngineWorkerGuard access(this);
520-
return _simulationCudaFacade->testOnly_getConnectionArrowData();
514+
return _simulationCudaFacade->testOnly_copyBuffersFromCudaToCpu();
521515
}
522516

523517
void EngineWorker::resetTimeIntervalStatistics()

source/EngineImpl/EngineWorker.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <Base/Definitions.h>
1212

1313
#include <EngineInterface/ArraySizesForGpu.h>
14+
#include <EngineInterface/CpuGeometryBuffers.h>
1415
#include <EngineInterface/CudaSettings.h>
1516
#include <EngineInterface/Definitions.h>
1617
#include <EngineInterface/GeometryBuffers.h>
@@ -127,8 +128,7 @@ class EngineWorker
127128
void testOnly_resizeArrays(ArraySizesForGpu const& sizeDelta);
128129
bool testOnly_arePointersValid();
129130
NumRenderObjects testOnly_getNumRenderObjects();
130-
std::vector<SelectedObjectVertexData> testOnly_getSelectedObjectData();
131-
std::vector<ConnectionArrowVertexData> testOnly_getConnectionArrowData();
131+
CpuGeometryBuffers testOnly_copyBuffersFromCudaToCpu();
132132

133133
private:
134134
void resetTimeIntervalStatistics();

source/EngineImpl/SimulationFacadeImpl.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -417,12 +417,7 @@ NumRenderObjects _SimulationFacadeImpl::testOnly_getNumRenderObjects()
417417
return _worker.testOnly_getNumRenderObjects();
418418
}
419419

420-
std::vector<SelectedObjectVertexData> _SimulationFacadeImpl::testOnly_getSelectedObjectData()
420+
CpuGeometryBuffers _SimulationFacadeImpl::testOnly_copyBuffersFromCudaToCpu()
421421
{
422-
return _worker.testOnly_getSelectedObjectData();
423-
}
424-
425-
std::vector<ConnectionArrowVertexData> _SimulationFacadeImpl::testOnly_getConnectionArrowData()
426-
{
427-
return _worker.testOnly_getConnectionArrowData();
422+
return _worker.testOnly_copyBuffersFromCudaToCpu();
428423
}

source/EngineImpl/SimulationFacadeImpl.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,7 @@ class _SimulationFacadeImpl : public _SimulationFacade
114114
void testOnly_resizeArrays(ArraySizesForGpu const& sizeDelta) override;
115115
bool testOnly_arePointersValid() override;
116116
NumRenderObjects testOnly_getNumRenderObjects() override;
117-
std::vector<SelectedObjectVertexData> testOnly_getSelectedObjectData() override;
118-
std::vector<ConnectionArrowVertexData> testOnly_getConnectionArrowData() override;
117+
CpuGeometryBuffers testOnly_copyBuffersFromCudaToCpu() override;
119118

120119
private:
121120
bool _selectionNeedsUpdate = false;

0 commit comments

Comments
 (0)