12.07.2015 Views

4D Volume Rendering - Nvidia

4D Volume Rendering - Nvidia

4D Volume Rendering - Nvidia

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

GPU Async - ImplementationMain draw thread//Get 2 OpenGL contexts from same DCHGLRC downloadRC = wglCreateContext(hDC);HGLRC drawRC = wglCreateContext(hDC);//Before any loading, share textures between contextswglShareLists(downloadRC, drawRC); //Note order//Create download thread from the main render threadHANDLE downloadThread = CreateThread(NULL, NULL,threadFunc, NULL, NULL, NULL);while (!done) {wglMakeCurrent(hDC, drawRC);//Texture access and drawing does here}Frame DrawDownload threadDWORD WINAPI threadFunc( LPVOID lpParam ) {wglMakeCurrent(hDC, downloadRC);glGenTextures(1,&texID);while (1) {//PBOs + glTexSubImage download as before}} // whilereturn TRUE;Main App ThreadInitGPU Draw t0 Draw t1Draw t2Bus (with CE)CPUDownload t0 :PBO 0 Download t1 :PBO 1 Download t2 :PBO 0Copy t0 :PBO 0 Copy t1 :PBO 1 Copy t2 :PBO 0timeDrawDownload

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!