Dolphin, the GameCube and Wii emulator - Forums

Full Version: GLX_EXT_swap_control_tear and NVIDIA stream hack info
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

LemonTree

Hi everybody (my first post here)!

I'm not an expert of OpenGL programming at all, but I'd like to know:
1) About the V-Sync graphic option, is GLX_EXT_swap_control_tear (or the WGL equivalent) used or not ? (AFAIK, that extension tries to vsync, but, if it's too late, just tears without waiting: it's used by passing a negative value (e.g. glXSwapIntervalEXT(-1)).
2) About the NVIDIA stream buffer speedup hack: how did you discover it ? Are there other known programs that update the buffer without mapping it again (on a possibly dangling pointer) and without any kind of synchronization (assuming that the pointer is still valid, one should re-orphan the buffer, or not?). I ask not because it's not working, but just because I'd like to know further info about it (is the hack worth the speedup or not?).

Thanks for making this emulator (it's probably the best multiplatform emulator I've tried so far).
Hi,

1) We don't use this extension in our opengl backend, but I think it's worth a try, Just change the line 572 and 1590 of https://code.google.com/p/dolphin-emu/so...Render.cpp

2) The CPU can't access the GPU memory, so everything most guys think about mapping buffer is just wrong. The only way to comunicate with the GPU is to use main memory as also the GPU can access it by dma. But the gpu isn't allowed to access the memory of your program directly as dma doesn't support mmu. So for usual copy operations, the driver will alloc a page locked (also called pinned) memory space for such a buffer.
So it's easy to just update this buffer internally. In fact, ogl4.4 provides an extension which allow this: https://www.opengl.org/registry/specs/AR...torage.txt
But there is still an issue on how the gpu access this buffer. The gpu may read from main memory whenever it's needed, but so we random access on pci-e+main memory. So some drivers (I think at least nouveau for uniform buffer) may just copy the content at once into vram and read in a random access way from there. So in this way, the hacked streaming isn't working any more. In fact, this is faster for random access, but we access all of our streaming content almost in order and only once, so it's faster not to copy twice.

LemonTree

Thanks for your suggestions and clarifications Smile !