Also add requirements for using range functions.
And micro-optimize testing if a bit is set (GCC and MSVC struggle to emit `bt` or `tbz`/`tbnz` with `bs & (1 << n)` compared to `(bs >> n) & 1`).
GLX11Window::Create called XSelectInput(display, parent_window,
StructureNotifyMask) on the host's display connection, which replaces
the event mask that the host (DolphinQt or DolphinNoGUI) selected for
the window instead of adding to it.
As a result, Qt stopped receiving FocusIn/FocusOut, key and mouse
events for the render window once an OpenGL context had been created
on it. The same issue made DolphinNoGUI lose its key and focus events
with OpenGL.
The GL code doesn't process any events itself, and the hosts already
select StructureNotify, so just drop the call. Also stop discarding
pending events in XSync, as the event queue belongs to the host.
Fixes https://bugs.dolphin-emu.org/issues/13354
UpdateStats() was calculating the standard deviation from the entirety of m_dt_queue, which has a noticeable performance impact when the frame rates are very high.
On a scene so light it runs at 3000 FPS, UpdateStats() was taking around 5% of the profiling (at default 1s sample window). Now it doesn't.
Save states restored video FIFO pointers from unchecked offsets. A
crafted offset could place a pointer outside its backing allocation and
turn the next gather-pipe copy into an out-of-bounds native write.
Require pointer offsets to stay within their backing array and reject a
state when either offset is invalid or the read pointer follows the write
pointer.
Pending traversal packets were only expired after receive events. If a
client did not acknowledge a response and no more packets arrived, the
server retained the pending entry indefinitely.
Update the current time before handling socket timeouts. Pending packets
will then retry and expire while the server is idle.
Large anonymous mappings are split into 128 MB chunks. Without MAP_MEM_VM_SHARE,
mach_make_memory_entry_64 will only return an entry spanning the first chunk.
Attempting to map through that entry will fail if it extends beyond the 128 MB
boundary, which can happen when the sizes of MEM1/MEM2 are overridden.
We were previously delaying all aspects of branch instruction encoding
to when SetJumpTarget runs. Now we only delay encoding the branch
distance. This lets us get away with storing less data in the
FixupBranch struct, making it small enough to be passed in two
registers instead of in memory.
Many callers of AlignUp are dividing immediately after aligning. Let's
add a helper function for this so callers don't have to specify the
alignment size twice.
JitCache has been using a class called ValidBlockBitSet. This commit
replaces it with a new class called LazyMemoryRegionBitSet, which works
similarly but is backed by a LazyMemoryRegion, letting us skip
allocating memory for parts of the bit set that correspond to emulated
memory regions where the game isn't storing any code. I have also added
optimized functions for setting or clearing long runs of bits.
Additionally, this commit replaces JitBase's three std::unordered_sets
that are keeping track of instructions with LazyMemoryRegionBitSets.
Here the benefit is more speed than memory usage. This improves NBA Live
2005's menu performance by 1% or so in SuperSamus's testing.
This makes Android players show up as "Android" instead of "Lin".
(This is only visible in DolphinQt, not in the Android GUI.)
I'm also unabbreviating all the existing operating system names:
* Win -> Windows
* Mac -> macOS
* Lin -> Linux
If (offset + size) % BLOCK_SIZE was smaller than offset % BLOCK_SIZE,
the loop terminated one iteration too early, potentially leaving a block
read-only.
None of the existing users of LazyMemoryRegion could trigger this bug,
because they never made EnsureMemoryPagesWritable calls that straddled
across two blocks, but the next commit will add a new use that does.