Some initial fixes for the UI performance and alignment for FFXI fixes for Sims Bustin Out being broken because of draw buffering and misaligned bloom in Predator Concrete Jungle.
This issue occurs during the transition when Talk Topic ends and enters Dule Talk Topic: the device has already been set to paused by a previous fade-out; the transition script first does a 30 frames fade-out on the current BGM, then hardcodes a 31 frames waiting before set the new BGM. Because of Nearest EE rounding mode, on this platform the fade-out actually needs 31 frames to finish (PS2 is 30 frames). The hardcoded 31 frames wait is right on the fade-out completion boundary, so when the new stream starts binding, the EE side state machine is still in fade state. The game code assumes the device must be playing during fade-in/fade-out, so it directly sets the EE side state machine to playing, without sending resume to IOP/SPU. As a result, the corresponding SPU port is still paused and refuses later playback, while the EE side thinks it is playing. Changing the wait to 32 frames lets the fade-out finish first, EE-side state machine enters paused, and when the new binding comes it goes through the resume path, so the state keeps synchronized. The EU version needs +1 more frame; I guess it is also a frame boundary/rounding timing difference, but it is not fully confirmed yet. Other paths rarely have this issue: two consecutive fade-outs are rare; or the second wait is long enough for the fade-out to complete; or because there is only one fade-out---when the new binding comes, the fade has not finished yet and the pause command has not been sent, so the state will not be out of sync.
Depending on the gpu/driver in some situations it can be a little faster or a little slower. Usually faster on igpus and slower on dgpus, but we want to prioritize igpus since they are on the lower end.
GL: Support has been extended to older hardware GL version 3.3.
Drop requirement of GL_ARB_gpu_shader5, emulate bitfieldExtract and bitfieldInsert in the cas shader instead.
Make GL_ARB_shading_language_packing as a fallback when gl core 4.2 is not available.
DX11: Enable on feature level 10.
DX12/VK co author port by TJnotJT.
Metal co author port by TellowKrinkle.
Intel Haswell seems to be having issues on dx11/12 with running the bfi instruction in this specific case, so let's use an alternative that gives the same result, note this is only broken on Haswell, Ivy Bridge and Skylake are fine, the issue appears when running the D3D compiler with optimizations, running with D3DCOMPILE_SKIP_OPTIMIZATION is fine with bfi.
Adds vertex rewriting functionality to both HW/SW. Aggressive version is user hack. Adds a GameDB hack for Ridge Racer V and Destruction Derby Arena. For SW, a less aggressive version is used if the hack is not enabled.