libobs: Remove extra gs_flush calls #10590
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
These calls introduce pipeline stalls in OpenGL on low end machines which can contribute to a fairly significant 10-30% of total rendering time. On average (since not every frame stalls) this is ~5% improvement with gpu time decreasing from 6.3ms to 6.0ms when encoders are active.
The driver already needs to synchronize events within the context so these calls are not needed for correctness for OpenGL.
Motivation and Context
Squeeze out a bit more perf on very low end devices where encoders could go faster if the rendering was faster. It matters more for intel than AMD in my tests but the intel is far weaker than my AMD device.
How Has This Been Tested?
Rendering vaapi and qsv texture encoders on amd and intel devices and I didnt notice any differences in output.
If I'm reading the D3D11 pages correctly for flush it seems it wont even introduce the gpu-gpu sync that it does on OpenGL so these are only trying to submit commands faster in Windows? I would appreciate testing on windows to know if these were providing any significant performance improvements there.
Types of changes
Checklist: