
406 V Transfers
main
–
hrc =
wglCreateContextAttribsARB(
hdc, NULL, attribs
);
worker1
–
hrc =
wglCreateContextAttribsARB(
hdc, main
–
hrc, NULL
);
worker2
–
hrc =
wglCreateContextAttribsARB(
hdc, main
–
hrc, NULL
);
OpenGL calls OpenGL calls OpenGL calls
Thread lane OpenGL call
CPU synchronization
wglMakeCurrent(
hdc, main
–
hrc
);
wglMakeCurrent(
hdc, worker1
–
hrc
);
wglMakeCurrent(
hdc, worker2
–
hrc
);
Main rendering thread
Worker thread 1 Worker thread 2
Figure 28.8. Shared-context creation on Windo w s.
28.6.2 Synchronization Issues
In a single-threaded scenario, it is perfectly valid to respecify a buffer while it is
currently in use: the driver will put glBufferData in