opengl - Fastest way to load data into buffer object? -
I am loading static data from CPU memory in a OpenGL buffer object. The data should be re-formatted (i.e. filtered).
Which of the following is the fastest:
1) Copy and filter the data on the CPU. Then call glBufferData once.
2) Filter the data as it allows multiple columns to be uploaded on the GPU by glBufferSubData
3) Filter the data as it uses the mapped buffer Uploaded on GPU, these three approaches end to filter the data on the CPU and thereafter earning commands for the command. To copy the GPU data card into the video card. GPU operations are going largely to depend on OpenGL implementation, but it seems like your best bet to get the minimum time for total operation (filtering and copying) to try to get as much concurrency as possible is.
For me, this would mean that your best method is to make a thread acting as a producer, and the primary thread (which can talk to OpenGL) can make a consumer So that the filter and the copy can be compacted concurrently, it was essential that you have to use the approach 2 or 3, because the approach will sort any operations.
In this way, write a thread that repeats the data to be filtered and pushes post-processed data into a shared queue. On the main thread, create a loop that currently takes data in the queue and copies it to OpenGL. You need a signal mechanism to tell the primary thread when all the data is pushed into buffer, so that at the time the buffer is empty, it can exit the loop.
Comments
Post a Comment