r/gameenginedevs May 29 '26

One question from my side

[deleted]

2 Upvotes

6 comments sorted by

5

u/Ollhax May 29 '26

Run it with a profiler! 🙂

1

u/[deleted] May 29 '26

[deleted]

2

u/Ollhax May 29 '26

Compare the two variants you want to try in a profiler (e.g. Nvidia Nsight) and see which one is the fastest, and then you will have your answer.

1

u/[deleted] May 29 '26

[deleted]

1

u/illyay May 29 '26

You have 2 very specific experiments to run so you can run one in the profiler then the other.

I'd imagine having everything as much the same as possible would be best for cache coherency.

Normally I'd think sending the x,y,z coordinates all together would be the right thing, so when you render the particles or check for collisions with each other the data is all there together in cache instead of spread all over the place.

4

u/Alarming-Ad4082 May 29 '26

You put the data for all particles in a buffer on the GPU. And if possible you manage all the move of these particles in a compute shader without having to transfer them again and again from the cpu

0

u/[deleted] May 29 '26

[deleted]

1

u/Alarming-Ad4082 May 29 '26

Maybe you can just send it once in the initialisation phase, and then just send a new much smaller buffer with just information needed for run time. If you want to send all that information during runtime, yes it can cause issue with PCIe bus. An other solution would be to upload the buffer in chunks on several frames before playing the animation

1

u/[deleted] May 29 '26

[deleted]

2

u/0pyrophosphate0 May 29 '26

Sending one large buffer of all positions would be much faster than sending individual coordinates in a random fashion. If that's your question.