gpu.TickWork() may lock the texture_cache and buffer_cache mutexes, which are owned by the thread prior to invoking TickWork().
Defer invoking gpu.TickWork() until the scope ends, where the owned mutexes are released.
It was reported that this method causes crashes on certain Linux decoding backends, hence the check to avoid it.
This subsequently caused Windows GPU decoders to never be selected and always fall back to CPU decoding, disable the check on Windows for now.
Fixes star pointer interactions in Super Mario Galaxy on some drivers, notably Nvidia.
Co-Authored-By: Fernando S. <1731197+fernandos27@users.noreply.github.com>
This makes constant buffer uploads safer and more accurate by updating the GPU memory as soon as the CB Data method is invoked. The previous implementation was deferring the updates until a different maxwell 3d method was detected, then writing all CB data at once.
When CreateRenderer fails, the GraphicsContext that was std::move'd into
it is destroyed before the Scoped that was created to manage its
currency. In that case, the GraphicsContext::Scoped will still call its
destructor at the ending of the function. And because the context is
destroyed, the Scoped will cause a crash as it attempts to call a
destroyed object's DoneCurrent function.
Since we know when the call would be invalid, call the Scoped's Cancel
method. This prevents it from calling a method on a destroyed object.
* gl_graphics_pipeline: Improve shader builder synchronization
Make use of GLsync objects to ensure better synchronization between shader builder threads and the main context
* gl_graphics_pipeline: Make built_fence access threadsafe
* gl_graphics_pipeline: Use GLsync objects only when building in parallel
* gl_graphics_pipeline: Replace GetSync calls with non-blocking waits
The spec states that a ClientWait on a Fence object ensures the changes propagate to the calling context
Per the spec, bufSize is the number of integers that will be written, in this case, 1.
Also, the length argument is optional if the information of the number of elements written is not needed.